From 30f47dac4c4fc669ff56bc5e9f243aa8dd58cccf Mon Sep 17 00:00:00 2001 From: tianma-if Date: Sat, 8 Aug 2026 21:47:55 +0800 Subject: [PATCH] refactor: harden mobile editing and PWA caching --- .../Features/Workspace/MemoEditView.swift | 93 ++- .../Resources/EditorBundle/index.html | 560 +++++++++--------- apps/ios/EditorBundle/index.html | 560 +++++++++--------- apps/ios/EditorSource/src/main.ts | 26 + .../EdgeEverTests/ChromeParityTests.swift | 5 +- .../EdgeEverTests/MobileUIParityTests.swift | 12 +- .../TipTapContentSourceTests.swift | 50 ++ apps/mobile/src/screens/WorkspaceScreen.tsx | 6 +- apps/web/vite.config.ts | 3 + scripts/verify-web-performance.mjs | 12 +- tests/mobile-app-scope.test.ts | 4 + 11 files changed, 742 insertions(+), 589 deletions(-) diff --git a/apps/ios/EdgeEver/Features/Workspace/MemoEditView.swift b/apps/ios/EdgeEver/Features/Workspace/MemoEditView.swift index 4c8d97b7..1a092bed 100644 --- a/apps/ios/EdgeEver/Features/Workspace/MemoEditView.swift +++ b/apps/ios/EdgeEver/Features/Workspace/MemoEditView.swift @@ -31,6 +31,7 @@ struct MemoEditView: View { @State private var memoId: String? @State private var error: String? @State private var saveTask: Task? + @State private var editGeneration: UInt64 = 0 @State private var isMaterializing = false @State private var isDirty = false @State private var isSaving = false @@ -352,8 +353,9 @@ struct MemoEditView: View { token: env.session.session?.token, onChange: { md, json in guard contentHydrated, !suppressPersistence else { return } - // Always accept editor truth, even mid-upload (save stays gated). - // @tiptap/markdown can drop text or images — reconcile carefully. + // Accept the JSON and Markdown emitted by the same TipTap transaction. + // Native code only falls back to its compatibility serializer when the + // editor cannot provide Markdown at all. applyEditorPayload(markdown: md, json: json) if !isUploading { markDirtyAndScheduleSave() @@ -469,6 +471,7 @@ struct MemoEditView: View { private func markDirtyAndScheduleSave() { guard !suppressPersistence else { return } + editGeneration &+= 1 // Avoid autosaving mid-upload (placeholder / incomplete body). guard !isUploading else { isDirty = true @@ -496,8 +499,7 @@ struct MemoEditView: View { contentJSON = emptyDocJSON baselineMarkdown = seed.contentMarkdown editorReady = false - isDirty = true - scheduleSave() + markDirtyAndScheduleSave() // Re-push body into the shared editor runtime. Task { @MainActor in try? await Task.sleep(nanoseconds: 50_000_000) @@ -567,16 +569,11 @@ struct MemoEditView: View { return contentJSON }() - // Derive markdown from JSON whenever possible — preserves block order exactly. - let nextMD: String = { - if let derived = EditorContentCodec.markdownFromTipTapJSON(nextJSON) { - return derived - } - if !markdown.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty { - return markdown - } - return contentMarkdown - }() + let nextMD = EditorContentCodec.preferredMarkdown( + editorMarkdown: markdown, + documentJSON: nextJSON, + fallback: contentMarkdown + ) let nextText = EditorContentCodec.plainText(markdown: nextMD, json: nextJSON) let nextHasImage = EditorContentCodec.containsImageNode(nextJSON) @@ -710,7 +707,10 @@ struct MemoEditView: View { private func persistDraftOrQueue() async { guard let scope = env.session.dataScope else { return } guard contentHydrated, !suppressPersistence else { return } - // Last chance: re-sync markdown from JSON so outbox markdown cannot drop text. + guard !isSaving else { return } + let generationAtStart = editGeneration + // Last chance: only backfill Markdown when the editor supplied none. Never replace + // valid TipTap Markdown with the intentionally limited native compatibility serializer. reconcileMarkdownWithJSON() if wouldClobberNonEmptyBody { NSLog( @@ -724,7 +724,11 @@ struct MemoEditView: View { isSaving = true defer { isSaving = false - isDirty = false + if generationAtStart == editGeneration { + isDirty = false + } else if !suppressPersistence { + scheduleSave() + } } let now = EdgeEverDate.nowString() @@ -898,10 +902,25 @@ struct MemoEditView: View { } private func flushPending() async { - await persistDraftOrQueue() + await drainPendingSave() await env.runSyncCycle() } + /// Wait for an in-flight autosave before forcing the latest editor generation to disk. + private func drainPendingSave() async { + let pendingSave = saveTask + saveTask = nil + pendingSave?.cancel() + await pendingSave?.value + // An older save may have noticed a newer generation and scheduled another debounce. + // Cancel that debounce because this path persists the latest state immediately. + saveTask?.cancel() + saveTask = nil + if isDirty { + await persistDraftOrQueue() + } + } + /// K24 materialize: ensure a server memo id before image upload. private func materializeForImage() async throws -> String { if let memoId, !memoId.hasPrefix("local:") { @@ -1015,10 +1034,10 @@ struct MemoEditView: View { } else { reconcileMarkdownWithJSON() } + editGeneration &+= 1 isDirty = true // Persist immediately so leaving the editor cannot orphan the resource. - saveTask?.cancel() - await persistDraftOrQueue() + await drainPendingSave() NSLog( "MemoEditView insertImageData: done src=%@ mdHas=%d jsonHas=%d textLen=%d", imageSrc, @@ -1037,21 +1056,25 @@ struct MemoEditView: View { EditorContentCodec.protectedResourceRefs(in: text) } - /// Rebuild markdown from TipTap JSON so block order matches the editor (and detail view). + /// Compatibility fallback for legacy/editor failures that provide JSON without Markdown. private func reconcileMarkdownWithJSON() { - if let derived = EditorContentCodec.markdownFromTipTapJSON(contentJSON) { - contentMarkdown = derived - } + guard contentMarkdown.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty, + let recovered = EditorContentCodec.markdownFromTipTapJSON(contentJSON) + else { return } + contentMarkdown = recovered } - /// Last-resort: image missing from JSON after insert. Append only then, and rebuild md from JSON. + /// Last-resort: image missing from JSON after insert. Append it to both representations. private func ensureImageInContent(imageSrc: String, alt: String) { if EditorContentCodec.jsonContainsResource(contentJSON, src: imageSrc) { reconcileMarkdownWithJSON() return } contentJSON = EditorContentCodec.appendingImage(toJSON: contentJSON, src: imageSrc, alt: alt) - reconcileMarkdownWithJSON() + if !contentMarkdown.contains(imageSrc) { + let separator = contentMarkdown.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ? "" : "\n\n" + contentMarkdown += "\(separator)![\(alt)](\(imageSrc))\n" + } } /// When compression is off, still normalize HEIC → JPEG for reliable upload mime. @@ -1075,9 +1098,27 @@ struct MemoEditView: View { } } -// MARK: - TipTap content helpers (markdown serializer is lossy around images) +// MARK: - TipTap content helpers (native Markdown serializer is recovery-only) enum EditorContentCodec { + /// TipTap's Markdown extension is authoritative because it understands the complete + /// registered schema (tables, nested/ordered lists, code languages, links and images). + /// The native serializer remains only as a recovery path for an absent bridge payload. + static func preferredMarkdown( + editorMarkdown: String?, + documentJSON: String, + fallback: String + ) -> String { + // A present-but-empty payload means the user intentionally cleared the note. + if let editorMarkdown { + return editorMarkdown + } + if !fallback.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty { + return fallback + } + return markdownFromTipTapJSON(documentJSON) ?? "" + } + static func protectedResourceRefs(in text: String) -> [String] { guard let regex = try? NSRegularExpression( pattern: #"/api/v1/resources/[A-Za-z0-9_-]+(?:/blob)?"#, diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/index.html b/apps/ios/EdgeEver/Resources/EditorBundle/index.html index b176b1a6..6a4e1fb5 100644 --- a/apps/ios/EdgeEver/Resources/EditorBundle/index.html +++ b/apps/ios/EdgeEver/Resources/EditorBundle/index.html @@ -7,24 +7,24 @@ content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> EdgeEver Editor - - +`},"getStyles"),db,tl=(db=class{constructor(){this.d=""}moveTo(e,r){return this.d+=`M ${e} ${r} `,this}lineTo(e,r){return this.d+=`L ${e} ${r} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,r,n,i,a,s,o){return this.d+=`A ${e} ${r} ${n} ${i?1:0} ${a?1:0} ${s} ${o} `,this}build(){return this.d.trim()}},x(db,"PathBuilder"),db),fb,S$t=(fb=class{constructor(e,r=uY()){this.textCache=new Map,this.svg=e,this.config=r}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const r=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),n=r.node().getBBox(),i={width:n.width,height:n.height};return r.remove(),this.textCache.set(e,i),i}renderTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-terminal");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a).attr("rx",10).attr("ry",10),s.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderNonTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-nonterminal");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),s.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderSequence(e,r){const n=r.map(u=>this.renderExpression(e,u));let i=0,a=0,s=0;for(const u of n)i+=u.dimensions.width,a=Math.max(a,u.dimensions.up),s=Math.max(s,u.dimensions.down);i+=(n.length-1)*this.config.horizontalSeparation;const o=e.append("g").attr("class","railroad-sequence");let l=0;for(let u=0;uthis.renderExpression(e,f));let i=0,a=0;for(const f of n)i=Math.max(i,f.dimensions.width),a+=f.dimensions.height;a+=(n.length-1)*this.config.verticalSeparation;const s=this.config.arcRadius,o=s*4,l=i+o,u=e.append("g").attr("class","railroad-choice");let h=0;const d=a/2;for(const f of n){const p=h,g=p+f.dimensions.up,m=s*2+(i-f.dimensions.width)/2;u.node().appendChild(f.element).setAttribute("transform",`translate(${m}, ${p})`);const v=new tl,T=g>d;g===d?v.moveTo(0,d).lineTo(m,g):v.moveTo(0,d).arcTo(s,s,0,!1,T,s,d+(T?s:-s)).lineTo(s,g-(T?s:-s)).arcTo(s,s,0,!1,!T,s*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",v.build());const b=new tl,w=m+f.dimensions.width,C=l-s*2;g===d?b.moveTo(w,g).lineTo(l,d):b.moveTo(w,g).lineTo(C,g).arcTo(s,s,0,!1,!T,l-s,g+(T?-s:s)).lineTo(l-s,d+(T?s:-s)).arcTo(s,s,0,!1,T,l,d),u.append("path").attr("class","railroad-line").attr("d",b.build()),h+=f.dimensions.height+this.config.verticalSeparation}return{element:u.node(),dimensions:{width:l,height:a,up:d,down:a-d}}}renderOptional(e,r){const n=this.renderExpression(e,r),i=this.config.arcRadius,a=i*2,s=n.dimensions.width+i*4,o=n.dimensions.height+a,l=e.append("g").attr("class","railroad-optional"),u=i*2,h=a;l.node().appendChild(n.element).setAttribute("transform",`translate(${u}, ${h})`);const f=h+n.dimensions.up,p=new tl().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new tl().moveTo(u+n.dimensions.width,f).lineTo(s,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new tl().moveTo(0,f).arcTo(i,i,0,!1,!1,i,f-i).lineTo(i,i).arcTo(i,i,0,!1,!0,i*2,0).lineTo(s-i*2,0).arcTo(i,i,0,!1,!0,s-i,i).lineTo(s-i,f-i).arcTo(i,i,0,!1,!1,s,f);return l.append("path").attr("class","railroad-line").attr("d",m.build()),{element:l.node(),dimensions:{width:s,height:o,up:f,down:o-f}}}renderRepetition(e,r,n){const i=this.renderExpression(e,r),a=this.config.arcRadius,s=a*2,o=i.dimensions.width+a*4,l=n===0,u=i.dimensions.height+s+(l?s:0),h=e.append("g").attr("class","railroad-repetition"),d=a*2,f=l?s:0;h.node().appendChild(i.element).setAttribute("transform",`translate(${d}, ${f})`);const g=f+i.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(0,g).lineTo(a*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+a,y=new tl().moveTo(d+i.dimensions.width,g).arcTo(a,a,0,!1,!0,d+i.dimensions.width+a,g+a).lineTo(d+i.dimensions.width+a,m).arcTo(a,a,0,!1,!0,d+i.dimensions.width,m+a).lineTo(a*2,m+a).arcTo(a,a,0,!1,!0,a,m).lineTo(a,g+a).arcTo(a,a,0,!1,!0,a*2,g);if(h.append("path").attr("class","railroad-line").attr("d",y.build()),l){const v=new tl().moveTo(0,g).arcTo(a,a,0,!1,!1,a,g-a).lineTo(a,a).arcTo(a,a,0,!1,!0,a*2,0).lineTo(o-a*2,0).arcTo(a,a,0,!1,!0,o-a,a).lineTo(o-a,g-a).arcTo(a,a,0,!1,!1,o,g);h.append("path").attr("class","railroad-line").attr("d",v.build())}return{element:h.node(),dimensions:{width:o,height:u,up:g,down:u-g}}}renderSpecial(e,r){const n=this.measureText("? "+r+" ?"),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-special");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),s.append("text").attr("x",i/2).attr("y",a/2).text("? "+r+" ?"),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderExpression(e,r){switch(r.type){case"terminal":return this.renderTerminal(e,r.value);case"nonterminal":return this.renderNonTerminal(e,r.name);case"sequence":return this.renderSequence(e,r.elements);case"choice":return this.renderChoice(e,r.alternatives);case"optional":return this.renderOptional(e,r.element);case"repetition":return this.renderRepetition(e,r.element,r.min);case"special":return this.renderSpecial(e,r.text);default:throw new Error(`Unknown node type: ${r.type}`)}}renderRule(e,r){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${r})`),i=e.name+" =",a=this.measureText(i).width+20,s=a+20,o=n.append("g"),l=this.renderExpression(o,e.definition),u=Math.max(20,l.dimensions.up),h=u-l.dimensions.up;return o.attr("transform",`translate(${s}, ${h})`),n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",u).text(i),n.append("g").attr("class","railroad-start").append("circle").attr("cx",a).attr("cy",u).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",s+l.dimensions.width+10).attr("cy",u).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(a+this.config.markerRadius,u).lineTo(s,u).build()),n.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(s+l.dimensions.width,u).lineTo(s+l.dimensions.width+10-this.config.markerRadius,u).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:s+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let r=this.config.padding,n=0;for(const i of e){const a=this.renderRule(i,r);r+=a.height+this.config.verticalSeparation,n=Math.max(n,a.width)}return{width:n+this.config.padding*2,height:r+this.config.padding}}},x(fb,"RailroadRenderer"),fb),Tae=x((t,e,r)=>{Ai(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),E$t=x((t,e,r)=>{le.debug(`[Railroad] Rendering diagram +`+t);try{const n=xs(e);n.attr("class","railroad-diagram");const i=Xt().railroad,a=(i==null?void 0:i.useMaxWidth)??!0,s=ei.getRules();if(le.debug(`[Railroad] Rendering ${s.length} rules`),s.length===0){le.warn("[Railroad] No rules to render"),Tae(n,{height:100,width:200},a);return}const l=new S$t(n,uY()).renderDiagram(s);Tae(n,l,a),le.debug("[Railroad] Render complete")}catch(n){throw le.error("[Railroad] Render error:",n),n}},"draw"),Y7={draw:E$t},A$t=oU().Railroad.parser.LangiumParser,Vm=x(t=>{switch(t.$type){case"RailroadTerminalExpr":return{type:"terminal",value:t.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:t.name};case"RailroadSpecialExpr":return{type:"special",text:t.text};case"RailroadSequenceExpr":{const e=t.elements.map(Vm);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(Vm);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:Vm(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:Vm(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:Vm(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),_$t=x(t=>({name:t.name,definition:Vm(t.definition)}),"transformRule"),R$t=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(_$t(e)))},"populateDb"),L$t={parse:x(t=>{ei.clear(),le.debug("[Railroad Parser] Starting Langium parse");const e=A$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[Railroad Parser] Parsed rules:",r.rules.length),R$t(r),le.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:ei}},M$t={parser:L$t,db:ei,renderer:Y7,styles:U7};const I$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:M$t},Symbol.toStringTag,{value:"Module"}));var N$t=lU().RailroadEbnf.parser.LangiumParser,o5=x(t=>{const e=t.alternatives.map(D$t);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),D$t=x(t=>{const e=t.elements.map($$t);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),JLe=x(t=>{switch(t.$type){case"EbnfTerminal":return{type:"terminal",value:t.value};case"EbnfNonTerminal":return{type:"nonterminal",name:t.name};case"EbnfSpecial":return{type:"special",text:t.text};case"EbnfGroup":return o5(t.element);case"EbnfOptional":return{type:"optional",element:o5(t.element)};case"EbnfRepetition":return{type:"repetition",element:o5(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),O$t=x((t,e)=>{switch(e.$type){case"EbnfOptionalPostfix":return{type:"optional",element:t};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:t,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:t,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[t,{type:"terminal",value:"-"},JLe(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),$$t=x(t=>t.postfixes.reduce((e,r)=>O$t(e,r),JLe(t.base)),"transformTerm"),P$t=x(t=>({name:t.name,definition:o5(t.definition)}),"transformRule"),B$t=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(P$t(e)))},"populateDb"),F$t={parse:x(t=>{ei.clear(),le.debug("[EBNF Parser] Starting Langium parse");const e=N$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[EBNF Parser] Parsed rules:",r.rules.length),B$t(r),le.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:ei}},z$t={parser:F$t,db:ei,renderer:Y7,styles:U7};const V$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:z$t},Symbol.toStringTag,{value:"Module"}));var G$t=cU().RailroadAbnf.parser.LangiumParser,TF=x(t=>{const e=t.alternatives.map(W$t);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),W$t=x(t=>{const e=t.elements.map(q$t);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),H$t=x(t=>{if(t.includes("*")){const[r,n]=t.split("*"),i=r?parseInt(r,10):0,a=n?parseInt(n,10):1/0;return{min:i,max:a}}const e=parseInt(t,10);return{min:e,max:e}},"parseRepeat"),q$t=x(t=>{const e=U$t(t.primary);if(!t.repeat)return e;const{min:r,max:n}=H$t(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),U$t=x(t=>{switch(t.$type){case"AbnfStringLiteral":return{type:"terminal",value:t.value};case"AbnfNumVal":return{type:"terminal",value:t.value};case"AbnfRuleName":return{type:"nonterminal",name:t.name};case"AbnfGroup":return TF(t.element);case"AbnfOptionalGroup":return{type:"optional",element:TF(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),Y$t=x(t=>({name:t.name,definition:TF(t.definition)}),"transformRule"),X$t=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(Y$t(e)))},"populateDb"),j$t={parse:x(t=>{ei.clear(),le.debug("[ABNF Parser] Starting Langium parse");const e=G$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[ABNF Parser] Parsed rules:",r.rules.length),X$t(r),le.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:ei}},K$t={parser:j$t,db:ei,renderer:Y7,styles:U7};const Z$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:K$t},Symbol.toStringTag,{value:"Module"}));var Q$t=uU().RailroadPeg.parser.LangiumParser,e7e=x(t=>{const e=t.alternatives.map(J$t);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),J$t=x(t=>{const e=t.elements.map(ePt);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),ePt=x(t=>{const e=tPt(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${wae(e)}`:`!${wae(e)}`}:e},"transformPrefix"),wae=x(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),tPt=x(t=>{const e=rPt(t.primary);if(!t.operator)return e;switch(t.operator){case"?":return{type:"optional",element:e};case"*":return{type:"repetition",element:e,min:0,max:1/0};case"+":return{type:"repetition",element:e,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${t.operator}`)}},"transformSuffix"),rPt=x(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return e7e(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),nPt=x(t=>({name:t.name,definition:e7e(t.definition)}),"transformRule"),iPt=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(nPt(e)))},"populateDb"),aPt={parse:x(t=>{ei.clear(),le.debug("[PEG Parser] Starting Langium parse");const e=Q$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[PEG Parser] Parsed rules:",r.rules.length),iPt(r),le.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:ei}},sPt={parser:aPt,db:ei,renderer:Y7,styles:U7};const oPt=Object.freeze(Object.defineProperty({__proto__:null,diagram:sPt},Symbol.toStringTag,{value:"Module"}));var lPt=1;function hY(){if(!(typeof globalThis>"u"))return globalThis}x(hY,"getCaptureGlobal");function t7e(){var t;return!!((t=hY())!=null&&t.mermaidCaptureSizes)}x(t7e,"shouldCaptureSizes");function r7e(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}x(r7e,"capturedFromLocation");function n7e(t,e){const r=hY();if(!r)return;const n=e.node(),i=(n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n,a=(i==null?void 0:i.id)??"(unknown)";r.mermaidCapturedSizes??(r.mermaidCapturedSizes=[]);const s={svgId:a,sizes:t};r.mermaidCapturedSizes.push(s),r.mermaidLastCapturedSizes=s}x(n7e,"emitCapturedSizes");function i7e(t,e){const r=[];for(const n of e.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&n7e({metadata:{captureVersion:lPt,capturedAt:new Date().toISOString(),capturedFrom:r7e()},nodes:r},t)}x(i7e,"captureNodeSizes");const cPt=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:i7e,shouldCaptureSizes:t7e},Symbol.toStringTag,{value:"Module"})),uPt=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:vAe,createInfoServices:bAe},Symbol.toStringTag,{value:"Module"})),hPt=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:xAe,createPacketServices:TAe},Symbol.toStringTag,{value:"Module"})),dPt=Object.freeze(Object.defineProperty({__proto__:null,PieModule:wAe,createPieServices:CAe},Symbol.toStringTag,{value:"Module"})),fPt=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:kAe,createTreeViewServices:SAe},Symbol.toStringTag,{value:"Module"})),pPt=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:EAe,createArchitectureServices:AAe},Symbol.toStringTag,{value:"Module"})),gPt=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:mAe,createGitGraphServices:yAe},Symbol.toStringTag,{value:"Module"})),mPt=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:RAe,createEventModelingServices:LAe},Symbol.toStringTag,{value:"Module"})),yPt=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:nAe,createRadarServices:iAe},Symbol.toStringTag,{value:"Module"})),vPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:aAe,createRailroadServices:oU},Symbol.toStringTag,{value:"Module"})),bPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:sAe,createRailroadEbnfServices:lU},Symbol.toStringTag,{value:"Module"})),xPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:oAe,createRailroadAbnfServices:cU},Symbol.toStringTag,{value:"Module"})),TPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:lAe,createRailroadPegServices:uU},Symbol.toStringTag,{value:"Module"})),wPt=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:uAe,createTreemapServices:hAe},Symbol.toStringTag,{value:"Module"})),CPt=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:dAe,createWardleyServices:fAe},Symbol.toStringTag,{value:"Module"})),kPt=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:pAe,createCynefinServices:gAe},Symbol.toStringTag,{value:"Module"})); + |$))/,d9e=en("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",mz).replace("tag",j6).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ile=en(pz).replace("hr",qk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",j6).getRegex(),f9e=en(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ile).getRegex(),yz={blockquote:f9e,code:a9e,def:u9e,fences:s9e,heading:o9e,hr:qk,html:d9e,lheading:Mle,list:h9e,newline:i9e,paragraph:Ile,table:wp,text:c9e},KX=en("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",qk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",j6).getRegex(),p9e={...yz,lheading:l9e,table:KX,paragraph:en(pz).replace("hr",qk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",KX).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",j6).getRegex()},g9e={...yz,html:en(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",mz).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:wp,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:en(pz).replace("hr",qk).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",Mle).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},m9e=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,y9e=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Nle=/^( {2,}|\\)\n(?!\s*$)/,v9e=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",n9e?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ole=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,C9e=en(Ole,"u").replace(/punct/g,px).getRegex(),k9e=en(Ole,"u").replace(/punct/g,Dle).getRegex(),$le="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",S9e=en($le,"gu").replace(/notPunctSpace/g,vz).replace(/punctSpace/g,K6).replace(/punct/g,px).getRegex(),E9e=en($le,"gu").replace(/notPunctSpace/g,T9e).replace(/punctSpace/g,x9e).replace(/punct/g,Dle).getRegex(),A9e=en("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,vz).replace(/punctSpace/g,K6).replace(/punct/g,px).getRegex(),_9e=en(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,px).getRegex(),R9e="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",L9e=en(R9e,"gu").replace(/notPunctSpace/g,vz).replace(/punctSpace/g,K6).replace(/punct/g,px).getRegex(),M9e=en(/\\(punct)/,"gu").replace(/punct/g,px).getRegex(),I9e=en(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),N9e=en(mz).replace("(?:-->|$)","-->").getRegex(),D9e=en("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",N9e).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),K5=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,O9e=en(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",K5).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ple=en(/^!?\[(label)\]\[(ref)\]/).replace("label",K5).replace("ref",gz).getRegex(),Ble=en(/^!?\[(ref)\](?:\[\])?/).replace("ref",gz).getRegex(),$9e=en("reflink|nolink(?!\\()","g").replace("reflink",Ple).replace("nolink",Ble).getRegex(),ZX=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,bz={_backpedal:wp,anyPunctuation:M9e,autolink:I9e,blockSkip:w9e,br:Nle,code:y9e,del:wp,delLDelim:wp,delRDelim:wp,emStrongLDelim:C9e,emStrongRDelimAst:S9e,emStrongRDelimUnd:A9e,escape:m9e,link:O9e,nolink:Ble,punctuation:b9e,reflink:Ple,reflinkSearch:$9e,tag:D9e,text:v9e,url:wp},P9e={...bz,link:en(/^!?\[(label)\]\((.*?)\)/).replace("label",K5).getRegex(),reflink:en(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",K5).getRegex()},FD={...bz,emStrongRDelimAst:E9e,emStrongLDelim:k9e,delLDelim:_9e,delRDelim:L9e,url:en(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ZX).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:en(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},QX=t=>F9e[t];function xc(t,e){if(e){if(Ds.escapeTest.test(t))return t.replace(Ds.escapeReplace,QX)}else if(Ds.escapeTestNoEncode.test(t))return t.replace(Ds.escapeReplaceNoEncode,QX);return t}function JX(t){try{t=encodeURI(t).replace(Ds.percentDecode,"%")}catch{return null}return t}function ej(t,e){var a;let r=t.replace(Ds.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Ds.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function V9e(t,e=0){let r=e,n="";for(let i of t)if(i===" "){let a=4-r%4;n+=" ".repeat(a),r+=a}else n+=i,r++;return n}function tj(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function G9e(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` +`}),f}var t9e=e9e,r9e=ua.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:YPe,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:r,tableWidth:n,tableMinWidth:i}=XPe(t,this.options.cellMinWidth),a=e.style;function s(){return a||(n?`width: ${n}`:`min-width: ${i}`)}const o=["table",On(this.options.HTMLAttributes,e,{style:s()}),r,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},o]:o},parseMarkdown:(t,e)=>{const r=[],n=Array.isArray(t.align)?t.align:[];if(t.header){const i=[];t.header.forEach((a,s)=>{var o;const l=j5((o=n[s])!=null?o:a.align),u=l?{align:l}:{};i.push(e.createNode("tableHeader",u,[{type:"paragraph",content:e.parseInline(a.tokens)}]))}),r.push(e.createNode("tableRow",{},i))}return t.rows&&t.rows.forEach(i=>{const a=[];i.forEach((s,o)=>{var l;const u=j5((l=n[o])!=null?l:s.align),h=u?{align:u}:{};a.push(e.createNode("tableCell",h,[{type:"paragraph",content:e.parseInline(s.tokens)}]))}),r.push(e.createNode("tableRow",{},a))}),e.createNode("table",void 0,r)},renderMarkdown:(t,e)=>t9e(t,e),addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:r=!0}={})=>({tr:n,dispatch:i,editor:a})=>{const s=KPe(a.schema,t,e,r);if(i){const o=n.selection.from+1;n.replaceSelectionWith(s).scrollIntoView().setSelection(rr.near(n.doc.resolve(o)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>sPe(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>oPe(t,e),deleteColumn:()=>({state:t,dispatch:e})=>cPe(t,e),addRowBefore:()=>({state:t,dispatch:e})=>hPe(t,e),addRowAfter:()=>({state:t,dispatch:e})=>dPe(t,e),deleteRow:()=>({state:t,dispatch:e})=>pPe(t,e),deleteTable:()=>({state:t,dispatch:e})=>TPe(t,e),mergeCells:()=>({state:t,dispatch:e})=>PX(t,e),splitCell:()=>({state:t,dispatch:e})=>BX(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>kC("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>kC("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>bPe(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>PX(t,e)?!0:BX(t,e),setCellAttribute:(t,e)=>({state:r,dispatch:n})=>yPe(t,e)(r,n),goToNextCell:()=>({state:t,dispatch:e})=>zX(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>zX(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&kle(t),!0),setCellSelection:t=>({tr:e,dispatch:r})=>{if(r){const n=Wn.create(e.doc,t.anchorCell,t.headCell);e.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:fE,"Mod-Backspace":fE,Delete:fE,"Mod-Delete":fE}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[MPe({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],VPe({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){const t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:r,view:n,HTMLAttributes:i})=>{const a=On(this.options.HTMLAttributes,i);return new e(r,this.options.cellMinWidth,n,a)}},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:un(Ut(t,"tableRole",e))}}}),n9e=ci.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(r9e.configure(this.options.table)),this.options.tableCell!==!1&&t.push(HPe.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(qPe.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(UPe.configure(this.options.tableRow)),t}});function dz(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var J0=dz();function Lle(t){J0=t}var wp={exec:()=>null};function en(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(Ds.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var i9e=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},a9e=/^(?:[ \t]*(?:\n|$))+/,s9e=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,o9e=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,qk=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,l9e=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fz=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Mle=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ile=en(Mle).replace(/bull/g,fz).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),c9e=en(Mle).replace(/bull/g,fz).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),pz=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,u9e=/^[^\n]+/,gz=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,h9e=en(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",gz).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),d9e=en(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fz).getRegex(),j6="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",mz=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,f9e=en("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",mz).replace("tag",j6).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Nle=en(pz).replace("hr",qk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",j6).getRegex(),p9e=en(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Nle).getRegex(),yz={blockquote:p9e,code:s9e,def:h9e,fences:o9e,heading:l9e,hr:qk,html:f9e,lheading:Ile,list:d9e,newline:a9e,paragraph:Nle,table:wp,text:u9e},KX=en("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",qk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",j6).getRegex(),g9e={...yz,lheading:c9e,table:KX,paragraph:en(pz).replace("hr",qk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",KX).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",j6).getRegex()},m9e={...yz,html:en(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",mz).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:wp,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:en(pz).replace("hr",qk).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Ile).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},y9e=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,v9e=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Dle=/^( {2,}|\\)\n(?!\s*$)/,b9e=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",i9e?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),$le=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,k9e=en($le,"u").replace(/punct/g,px).getRegex(),S9e=en($le,"u").replace(/punct/g,Ole).getRegex(),Ple="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",E9e=en(Ple,"gu").replace(/notPunctSpace/g,vz).replace(/punctSpace/g,K6).replace(/punct/g,px).getRegex(),A9e=en(Ple,"gu").replace(/notPunctSpace/g,w9e).replace(/punctSpace/g,T9e).replace(/punct/g,Ole).getRegex(),_9e=en("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,vz).replace(/punctSpace/g,K6).replace(/punct/g,px).getRegex(),R9e=en(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,px).getRegex(),L9e="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",M9e=en(L9e,"gu").replace(/notPunctSpace/g,vz).replace(/punctSpace/g,K6).replace(/punct/g,px).getRegex(),I9e=en(/\\(punct)/,"gu").replace(/punct/g,px).getRegex(),N9e=en(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),D9e=en(mz).replace("(?:-->|$)","-->").getRegex(),O9e=en("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",D9e).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),K5=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,$9e=en(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",K5).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ble=en(/^!?\[(label)\]\[(ref)\]/).replace("label",K5).replace("ref",gz).getRegex(),Fle=en(/^!?\[(ref)\](?:\[\])?/).replace("ref",gz).getRegex(),P9e=en("reflink|nolink(?!\\()","g").replace("reflink",Ble).replace("nolink",Fle).getRegex(),ZX=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,bz={_backpedal:wp,anyPunctuation:I9e,autolink:N9e,blockSkip:C9e,br:Dle,code:v9e,del:wp,delLDelim:wp,delRDelim:wp,emStrongLDelim:k9e,emStrongRDelimAst:E9e,emStrongRDelimUnd:_9e,escape:y9e,link:$9e,nolink:Fle,punctuation:x9e,reflink:Ble,reflinkSearch:P9e,tag:O9e,text:b9e,url:wp},B9e={...bz,link:en(/^!?\[(label)\]\((.*?)\)/).replace("label",K5).getRegex(),reflink:en(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",K5).getRegex()},FD={...bz,emStrongRDelimAst:A9e,emStrongLDelim:S9e,delLDelim:R9e,delRDelim:M9e,url:en(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ZX).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:en(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},QX=t=>z9e[t];function xc(t,e){if(e){if(Ds.escapeTest.test(t))return t.replace(Ds.escapeReplace,QX)}else if(Ds.escapeTestNoEncode.test(t))return t.replace(Ds.escapeReplaceNoEncode,QX);return t}function JX(t){try{t=encodeURI(t).replace(Ds.percentDecode,"%")}catch{return null}return t}function ej(t,e){var a;let r=t.replace(Ds.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Ds.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function G9e(t,e=0){let r=e,n="";for(let i of t)if(i===" "){let a=4-r%4;n+=" ".repeat(a),r+=a}else n+=i,r++;return n}function tj(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function W9e(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` `).map(a=>{let s=a.match(r.other.beginningSpace);if(s===null)return a;let[o]=s;return o.length>=i.length?a.slice(i.length):a}).join(` `)}var Z5=class{constructor(e){jt(this,"options");jt(this,"rules");jt(this,"lexer");this.options=e||J0}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Zx(n,` -`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=G9e(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=Zx(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:Zx(r[0],` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=W9e(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=Zx(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:Zx(r[0],` `)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=Zx(r[0],` `).split(` `),i="",a="",s=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u1,o={type:"list",raw:"",ordered:s,start:s?+a.slice(0,-1):"",loose:!1,items:[]};a=s?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=s?a:"[*+-]");let l=this.rules.other.listItemRegex(a),u=!1;for(;e;){let d=!1,f="",p="";if(!(r=l.exec(e))||this.rules.block.hr.test(e))break;f=r[0],e=e.substring(f.length);let g=V9e(r[2].split(` +`);continue}}return{type:"blockquote",raw:i,tokens:s,text:a}}}list(e){var n,i;let r=this.rules.block.list.exec(e);if(r){let a=r[1].trim(),s=a.length>1,o={type:"list",raw:"",ordered:s,start:s?+a.slice(0,-1):"",loose:!1,items:[]};a=s?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=s?a:"[*+-]");let l=this.rules.other.listItemRegex(a),u=!1;for(;e;){let d=!1,f="",p="";if(!(r=l.exec(e))||this.rules.block.hr.test(e))break;f=r[0],e=e.substring(f.length);let g=G9e(r[2].split(` `,1)[0],r[1].length),m=e.split(` `,1)[0],y=!g.trim(),v=0;if(this.options.pedantic?(v=2,p=g.trimStart()):y?v=r[1].length+1:(v=g.search(this.rules.other.nonSpaceChar),v=v>4?1:v,p=g.slice(v),v+=r[1].length),y&&this.rules.other.blankLine.test(m)&&(f+=m+` `,e=e.substring(m.length+1),d=!0),!d){let T=this.rules.other.nextBulletRegex(v),b=this.rules.other.hrRegex(v),w=this.rules.other.fencesBeginRegex(v),C=this.rules.other.headingBeginRegex(v),S=this.rules.other.htmlBeginRegex(v),k=this.rules.other.blockquoteBeginRegex(v);for(;e;){let E=e.split(` @@ -179,7 +179,7 @@ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo `+m}y=!m.trim(),f+=E+` `,e=e.substring(E.length+1),g=_.slice(v)}}o.loose||(u?o.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(u=!0)),o.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),o.raw+=f}let h=o.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let d of o.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),((n=d.tokens[0])==null?void 0:n.type)==="text"||((i=d.tokens[0])==null?void 0:i.type)==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}}let f=this.rules.other.listTaskCheckbox.exec(d.raw);if(f){let p={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};d.checked=p.checked,o.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=p.raw+d.tokens[0].raw,d.tokens[0].text=p.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(p)):d.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):d.tokens.unshift(p)}}if(!o.loose){let f=d.tokens.filter(g=>g.type==="space"),p=f.length>0&&f.some(g=>this.rules.other.anyLine.test(g.raw));o.loose=p}}if(o.loose)for(let d of o.items){d.loose=!0;for(let f of d.tokens)f.type==="text"&&(f.type="paragraph")}return o}}html(e){let r=this.rules.block.html.exec(e);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(e){let r=this.rules.block.def.exec(e);if(r){let n=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:i,title:a}}}table(e){var o;let r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let n=ej(r[1]),i=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(o=r[3])!=null&&o.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(` `):[],s={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let l of i)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[h]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r){let n=r[1].trim();return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` -`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Zx(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=z9e(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),tj(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return tj(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e,r,n=""){let i=this.rules.inline.delLDelim.exec(e);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=this.rules.inline.delRDelim;for(u.lastIndex=0,r=r.slice(-1*e.length+a);(i=u.exec(r))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s||(o=[...s].length,o!==a))continue;if(i[3]||i[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let h=[...i[0]][0].length,d=e.slice(0,a+i.index+h+o),f=d.slice(a,-a);return{type:"del",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},$l=class zD{constructor(e){jt(this,"tokens");jt(this,"options");jt(this,"state");jt(this,"inlineQueue");jt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||J0,this.options.tokenizer=this.options.tokenizer||new Z5,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Ds,block:pE.normal,inline:Kx.normal};this.options.pedantic?(r.block=pE.pedantic,r.inline=Kx.pedantic):this.options.gfm&&(r.block=pE.gfm,this.options.breaks?r.inline=Kx.breaks:r.inline=Kx.gfm),this.tokenizer.rules=r}static get rules(){return{block:pE,inline:Kx}}static lex(e,r){return new zD(r).lex(e)}static lexInline(e,r){return new zD(r).inlineTokens(e)}lex(e){e=e.replace(Ds.carriageReturn,` +`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Zx(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=V9e(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),tj(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return tj(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e,r,n=""){let i=this.rules.inline.delLDelim.exec(e);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=this.rules.inline.delRDelim;for(u.lastIndex=0,r=r.slice(-1*e.length+a);(i=u.exec(r))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s||(o=[...s].length,o!==a))continue;if(i[3]||i[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let h=[...i[0]][0].length,d=e.slice(0,a+i.index+h+o),f=d.slice(a,-a);return{type:"del",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},$l=class zD{constructor(e){jt(this,"tokens");jt(this,"options");jt(this,"state");jt(this,"inlineQueue");jt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||J0,this.options.tokenizer=this.options.tokenizer||new Z5,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Ds,block:pE.normal,inline:Kx.normal};this.options.pedantic?(r.block=pE.pedantic,r.inline=Kx.pedantic):this.options.gfm&&(r.block=pE.gfm,this.options.breaks?r.inline=Kx.breaks:r.inline=Kx.gfm),this.tokenizer.rules=r}static get rules(){return{block:pE,inline:Kx}}static lex(e,r){return new zD(r).lex(e)}static lexInline(e,r){return new zD(r).inlineTokens(e)}lex(e){e=e.replace(Ds.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let r=0;r(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=` `:r.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` @@ -211,19 +211,19 @@ ${this.parser.parse(e)} `}tablerow({text:e}){return` ${e} `}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+` -`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${xc(e,!0)}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=JX(e);if(a===null)return i;e=a;let s='
",s}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=JX(e);if(a===null)return xc(n);e=a;let s=`${xc(n)}{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new Q5(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Z5(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new zT;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=a[o];zT.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&zT.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(a,h);return u.call(a,f)})();let d=l.call(a,h);return u.call(a,d)}:a[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(a,h);return f===!1&&(f=await u.apply(a,h)),f})();let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return $l.lex(e,r??this.defaults)}parser(e,r){return Pl.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer(e):e?$l.lex:$l.lexInline)(o,a),u=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(u,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser(e):e?Pl.parse:Pl.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let o=(a.hooks?a.hooks.provideLexer(e):e?$l.lex:$l.lexInline)(r,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let l=(a.hooks?a.hooks.provideParser(e):e?Pl.parse:Pl.parseInline)(o,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(e,r){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let i="

An error occurred:

"+xc(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},S0=new W9e;function En(t,e){return S0.parse(t,e)}En.options=En.setOptions=function(t){return S0.setOptions(t),En.defaults=S0.defaults,Rle(En.defaults),En};En.getDefaults=dz;En.defaults=J0;En.use=function(...t){return S0.use(...t),En.defaults=S0.defaults,Rle(En.defaults),En};En.walkTokens=function(t,e){return S0.walkTokens(t,e)};En.parseInline=S0.parseInline;En.Parser=Pl;En.parser=Pl.parse;En.Renderer=Q5;En.TextRenderer=xz;En.Lexer=$l;En.lexer=$l.lex;En.Tokenizer=Z5;En.Hooks=zT;En.parse=En;En.options;En.setOptions;En.use;En.walkTokens;En.parseInline;Pl.parse;$l.lex;function H9e(t,e){const n=e.split(` +`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${xc(e,!0)}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=JX(e);if(a===null)return i;e=a;let s='
",s}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=JX(e);if(a===null)return xc(n);e=a;let s=`${xc(n)}{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new Q5(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Z5(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new zT;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=a[o];zT.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&zT.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(a,h);return u.call(a,f)})();let d=l.call(a,h);return u.call(a,d)}:a[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(a,h);return f===!1&&(f=await u.apply(a,h)),f})();let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return $l.lex(e,r??this.defaults)}parser(e,r){return Pl.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer(e):e?$l.lex:$l.lexInline)(o,a),u=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(u,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser(e):e?Pl.parse:Pl.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let o=(a.hooks?a.hooks.provideLexer(e):e?$l.lex:$l.lexInline)(r,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let l=(a.hooks?a.hooks.provideParser(e):e?Pl.parse:Pl.parseInline)(o,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(e,r){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let i="

An error occurred:

"+xc(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},S0=new H9e;function En(t,e){return S0.parse(t,e)}En.options=En.setOptions=function(t){return S0.setOptions(t),En.defaults=S0.defaults,Lle(En.defaults),En};En.getDefaults=dz;En.defaults=J0;En.use=function(...t){return S0.use(...t),En.defaults=S0.defaults,Lle(En.defaults),En};En.walkTokens=function(t,e){return S0.walkTokens(t,e)};En.parseInline=S0.parseInline;En.Parser=Pl;En.parser=Pl.parse;En.Renderer=Q5;En.TextRenderer=xz;En.Lexer=$l;En.lexer=$l.lex;En.Tokenizer=Z5;En.Hooks=zT;En.parse=En;En.options;En.setOptions;En.use;En.walkTokens;En.parseInline;Pl.parse;$l.lex;function q9e(t,e){const n=e.split(` `).flatMap(i=>[i,""]).map(i=>`${t}${i}`).join(` -`);return n.slice(0,n.length-1)}function q9e(t,e){const r=[];return Array.from(t.entries()).forEach(([n,i])=>{if(!e){r.push(n);return}(e.marks||[]).find(s=>s.type===n&&bb(s.attrs,i.attrs))||r.push(n)}),r}function U9e(t,e){const r=[];return Array.from(e.entries()).forEach(([n,i])=>{const a=t.get(n);(!a||!bb(a.attrs,i.attrs))&&r.push({type:n,mark:i})}),r}function Y9e(t,e,r,n){const i=!r,a=r&&(!r.marks||r.marks.length===0),s=r&&r.marks&&!n(e,new Map(r.marks.map(l=>[l.type,l]))),o=[];return(i||a||s)&&(r&&r.marks?Array.from(t.entries()).reverse().forEach(([l,u])=>{r.marks.find(d=>d.type===l&&bb(d.attrs,u.attrs))||o.push(l)}):(i||a)&&o.push(...Array.from(t.keys()).reverse())),o}function X9e(t,e){let r="";return Array.from(t.keys()).reverse().forEach(n=>{const i=t.get(n),a=e(n,i);a&&(r=a+r)}),t.clear(),r}function j9e(t,e,r){let n="";return Array.from(t.entries()).forEach(([i,a])=>{const s=r(i,a);s&&(n+=s),e.set(i,a)}),n}function CM(t){const r=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return r?{isTask:!0,checked:r[2].toLowerCase()==="x",indentLevel:r[1].length}:{isTask:!1,indentLevel:0}}function gE(t,e){return typeof t!="string"?"json":e}var K9e=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","circle","clippath","defs","ellipse","foreignobject","g","image","line","lineargradient","mask","path","polygon","polyline","radialgradient","rect","stop","switch","symbol","textpath","tspan","use","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),Z9e=/<\/?([a-zA-Z][\w-]*)/g;function Q9e(t){const e=[];let r;for(;(r=Z9e.exec(t))!==null;)e.push(r[1].toLowerCase());return e}function J9e(t){const e=t.toLowerCase();return e.includes("-")?!1:!K9e.has(e)}function eBe(t,e){return Q9e(t).some(n=>J9e(n)?!e.has(n):!1)}var tBe=class{constructor(t){this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.lastParseResult=null;var e,r,n,i,a;this.markedInstance=(e=t==null?void 0:t.marked)!=null?e:En,this.indentStyle=(n=(r=t==null?void 0:t.indentation)==null?void 0:r.style)!=null?n:"space",this.indentSize=(a=(i=t==null?void 0:t.indentation)==null?void 0:i.size)!=null?a:2,this.baseExtensions=(t==null?void 0:t.extensions)||[],t!=null&&t.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(t.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,t!=null&&t.extensions&&(this.baseExtensions=t.extensions,ly(G6(t.extensions)).forEach(o=>this.registerExtension(o)))}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle==="space"?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(t){var e,r;this.extensions.push(t);const n=un(Ut(t,"code")),i=t.name;n&&this.codeTypes.add(i),this.extensionRanks.has(i)||this.extensionRanks.set(i,this.extensionRanks.size);const a=Ut(t,"markdownTokenName")||i,s=Ut(t,"parseMarkdown"),o=Ut(t,"renderMarkdown"),l=Ut(t,"markdownTokenizer"),u=(e=Ut(t,"markdownOptions"))!=null?e:null,h=(r=u==null?void 0:u.indentsContent)!=null?r:!1,d=u==null?void 0:u.htmlReopen,f={tokenName:a,nodeName:i,parseMarkdown:s,renderMarkdown:o,isIndenting:h,htmlReopen:d,tokenizer:l};if(a&&s){const p=this.registry.get(a)||[];p.push(f),this.registry.set(a,p)}if(o){const p=this.nodeTypeRegistry.get(i)||[];p.push(f),this.nodeTypeRegistry.set(i,p)}l&&this.hasMarked()&&this.registerTokenizer(l)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(t){return{inlineTokens:e=>t.inlineTokens(e),blockTokens:e=>t.blockTokens(e)}}tokenizeInline(t){var e;return((e=this.activeParseLexer)!=null?e:this.createLexer()).inlineTokens(t)}registerTokenizer(t){if(!this.hasMarked())return;const{name:e,start:r,level:n="inline",tokenize:i}=t,a=this.createTokenizerHelpers.bind(this),s=this.createLexer.bind(this);let o;r?o=typeof r=="function"?r:u=>u.indexOf(r):o=u=>{const h=i(u,[],this.createTokenizerHelpers(this.createLexer()));return h&&h.raw?u.indexOf(h.raw):-1};const l={name:e,level:n,start:o,tokenizer(u,h){const d=this.lexer?a(this.lexer):a(s()),f=i(u,h,d);if(f&&f.type)return{...f,type:f.type||e,raw:f.raw||"",tokens:f.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[l]})}getHandlersForToken(t){try{return this.registry.get(t)||[]}catch{return[]}}getHandlerForToken(t){const e=this.getHandlersForToken(t);if(e.length>0)return e[0];const r=this.getHandlersForNodeType(t);return r.length>0?r[0]:void 0}getHandlersForNodeType(t){try{return this.nodeTypeRegistry.get(t)||[]}catch{return[]}}serialize(t){if(!t)return"";const e=this.renderNodes(t,t);return this.isEmptyOutput(e)?"":e}isEmptyOutput(t){return!t||t.trim()===""?!0:t.replace(/ /g,"").replace(/\u00A0/g,"").trim()===""}parse(t){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const e=this.activeParseLexer,r=this.createLexer();this.activeParseLexer=r;try{const n=r.lex(t);return{type:"doc",content:this.parseTokens(n,!0)}}finally{this.activeParseLexer=e}}parseTokens(t,e=!1){const r=t.reduce((a,s,o)=>(s.type!=="space"&&a.push(o),a),[]);let n=-1,i=0;return t.flatMap((a,s)=>{for(var o;i({type:"paragraph",content:[]}))}countParagraphSeparators(t){return(t.replace(/\r\n/g,` +`);return n.slice(0,n.length-1)}function U9e(t,e){const r=[];return Array.from(t.entries()).forEach(([n,i])=>{if(!e){r.push(n);return}(e.marks||[]).find(s=>s.type===n&&bb(s.attrs,i.attrs))||r.push(n)}),r}function Y9e(t,e){const r=[];return Array.from(e.entries()).forEach(([n,i])=>{const a=t.get(n);(!a||!bb(a.attrs,i.attrs))&&r.push({type:n,mark:i})}),r}function X9e(t,e,r,n){const i=!r,a=r&&(!r.marks||r.marks.length===0),s=r&&r.marks&&!n(e,new Map(r.marks.map(l=>[l.type,l]))),o=[];return(i||a||s)&&(r&&r.marks?Array.from(t.entries()).reverse().forEach(([l,u])=>{r.marks.find(d=>d.type===l&&bb(d.attrs,u.attrs))||o.push(l)}):(i||a)&&o.push(...Array.from(t.keys()).reverse())),o}function j9e(t,e){let r="";return Array.from(t.keys()).reverse().forEach(n=>{const i=t.get(n),a=e(n,i);a&&(r=a+r)}),t.clear(),r}function K9e(t,e,r){let n="";return Array.from(t.entries()).forEach(([i,a])=>{const s=r(i,a);s&&(n+=s),e.set(i,a)}),n}function CM(t){const r=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return r?{isTask:!0,checked:r[2].toLowerCase()==="x",indentLevel:r[1].length}:{isTask:!1,indentLevel:0}}function gE(t,e){return typeof t!="string"?"json":e}var Z9e=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","circle","clippath","defs","ellipse","foreignobject","g","image","line","lineargradient","mask","path","polygon","polyline","radialgradient","rect","stop","switch","symbol","textpath","tspan","use","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),Q9e=/<\/?([a-zA-Z][\w-]*)/g;function J9e(t){const e=[];let r;for(;(r=Q9e.exec(t))!==null;)e.push(r[1].toLowerCase());return e}function eBe(t){const e=t.toLowerCase();return e.includes("-")?!1:!Z9e.has(e)}function tBe(t,e){return J9e(t).some(n=>eBe(n)?!e.has(n):!1)}var rBe=class{constructor(t){this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.lastParseResult=null;var e,r,n,i,a;this.markedInstance=(e=t==null?void 0:t.marked)!=null?e:En,this.indentStyle=(n=(r=t==null?void 0:t.indentation)==null?void 0:r.style)!=null?n:"space",this.indentSize=(a=(i=t==null?void 0:t.indentation)==null?void 0:i.size)!=null?a:2,this.baseExtensions=(t==null?void 0:t.extensions)||[],t!=null&&t.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(t.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,t!=null&&t.extensions&&(this.baseExtensions=t.extensions,ly(G6(t.extensions)).forEach(o=>this.registerExtension(o)))}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle==="space"?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(t){var e,r;this.extensions.push(t);const n=un(Ut(t,"code")),i=t.name;n&&this.codeTypes.add(i),this.extensionRanks.has(i)||this.extensionRanks.set(i,this.extensionRanks.size);const a=Ut(t,"markdownTokenName")||i,s=Ut(t,"parseMarkdown"),o=Ut(t,"renderMarkdown"),l=Ut(t,"markdownTokenizer"),u=(e=Ut(t,"markdownOptions"))!=null?e:null,h=(r=u==null?void 0:u.indentsContent)!=null?r:!1,d=u==null?void 0:u.htmlReopen,f={tokenName:a,nodeName:i,parseMarkdown:s,renderMarkdown:o,isIndenting:h,htmlReopen:d,tokenizer:l};if(a&&s){const p=this.registry.get(a)||[];p.push(f),this.registry.set(a,p)}if(o){const p=this.nodeTypeRegistry.get(i)||[];p.push(f),this.nodeTypeRegistry.set(i,p)}l&&this.hasMarked()&&this.registerTokenizer(l)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(t){return{inlineTokens:e=>t.inlineTokens(e),blockTokens:e=>t.blockTokens(e)}}tokenizeInline(t){var e;return((e=this.activeParseLexer)!=null?e:this.createLexer()).inlineTokens(t)}registerTokenizer(t){if(!this.hasMarked())return;const{name:e,start:r,level:n="inline",tokenize:i}=t,a=this.createTokenizerHelpers.bind(this),s=this.createLexer.bind(this);let o;r?o=typeof r=="function"?r:u=>u.indexOf(r):o=u=>{const h=i(u,[],this.createTokenizerHelpers(this.createLexer()));return h&&h.raw?u.indexOf(h.raw):-1};const l={name:e,level:n,start:o,tokenizer(u,h){const d=this.lexer?a(this.lexer):a(s()),f=i(u,h,d);if(f&&f.type)return{...f,type:f.type||e,raw:f.raw||"",tokens:f.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[l]})}getHandlersForToken(t){try{return this.registry.get(t)||[]}catch{return[]}}getHandlerForToken(t){const e=this.getHandlersForToken(t);if(e.length>0)return e[0];const r=this.getHandlersForNodeType(t);return r.length>0?r[0]:void 0}getHandlersForNodeType(t){try{return this.nodeTypeRegistry.get(t)||[]}catch{return[]}}serialize(t){if(!t)return"";const e=this.renderNodes(t,t);return this.isEmptyOutput(e)?"":e}isEmptyOutput(t){return!t||t.trim()===""?!0:t.replace(/ /g,"").replace(/\u00A0/g,"").trim()===""}parse(t){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const e=this.activeParseLexer,r=this.createLexer();this.activeParseLexer=r;try{const n=r.lex(t);return{type:"doc",content:this.parseTokens(n,!0)}}finally{this.activeParseLexer=e}}parseTokens(t,e=!1){const r=t.reduce((a,s,o)=>(s.type!=="space"&&a.push(o),a),[]);let n=-1,i=0;return t.flatMap((a,s)=>{for(var o;i({type:"paragraph",content:[]}))}countParagraphSeparators(t){return(t.replace(/\r\n/g,` `).match(/\n\n/g)||[]).length}parseToken(t,e=!1){if(!t.type)return null;if(t.type==="list")return this.parseListToken(t);const r=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(r.find(a=>{if(!a.parseMarkdown)return!1;const s=a.parseMarkdown(t,n),o=this.normalizeParseResult(s);return o&&(!Array.isArray(o)||o.length>0)?(this.lastParseResult=o,!0):!1})&&this.lastParseResult){const a=this.lastParseResult;return this.lastParseResult=null,a}return this.parseFallbackToken(t,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(o=>CM(o).isTask),r=t.items.some(o=>!CM(o).isTask);if(!e||!r||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const n=[];let i=[],a=null;for(let o=0;o1&&m.slice(1).join(` `).trim()){const w=m.slice(1),C=w.filter(S=>S.trim());if(C.length>0){const S=Math.min(...C.map(_=>_.length-_.trimStart().length)),E=w.map(_=>_.trim()?_.slice(S):"").join(` `).trim();E&&(T=this.markedInstance.lexer(`${E} -`))}}f={type:"taskItem",raw:"",mainContent:v,indentLevel:d,checked:h??!1,text:v,tokens:this.tokenizeInline(v),nestedTokens:T}}const p=u?"taskList":"list";a!==p?(i.length>0&&n.push({type:a,items:i}),i=[f],a=p):i.push(f)}i.length>0&&n.push({type:a,items:i});const s=[];for(let o=0;o0?s:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),r=this.createParseHelpers();if(e.find(i=>{if(!i.parseMarkdown)return!1;const a=i.parseMarkdown(t,r),s=this.normalizeParseResult(a);return s&&(!Array.isArray(s)||s.length>0)?(this.lastParseResult=s,!0):!1})&&this.lastParseResult){const i=this.lastParseResult;return this.lastParseResult=null,i}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),tokenizeInline:t=>this.tokenizeInline(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,r)=>{const n={type:t,attrs:e||void 0,content:r||void 0};return(!e||Object.keys(e).length===0)&&delete n.attrs,n},applyMark:(t,e,r)=>({mark:t,content:e,attrs:r&&Object.keys(r).length>0?r:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){var e,r,n,i;const a=[];for(let s=0;s|\/|$)/i);if(!u&&h&&!/\/>$/.test(l)){const f=h[1],p=this.escapeRegex(f),g=new RegExp(`^<\\/\\s*${p}\\b`,"i");let m=-1;const y=[l];for(let v=s+1;v0;s-=1){const o=a[s],l=a[s-1];if(o.type==="text"&&l.type==="text"){const u=o.marks||[],h=l.marks||[];rDe(u,h)&&(l.text=(l.text||"")+(o.text||""),a.splice(s,1))}}return a}applyMarkToContent(t,e,r){return e.map(n=>{if(n.type==="text"){const i=n.marks||[],a=r?{type:t,attrs:r}:{type:t};return{...n,marks:[...i,a]}}return{...n,content:n.content?this.applyMarkToContent(t,n.content,r):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:bX(t.text||"")};case"html":return this.parseHTMLToken(t);case"escape":return{type:"text",text:t.text||""};case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!t.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(e,!!t.block);try{const r=uNe(e,this.baseExtensions);return r.type==="doc"&&r.content?t.block?r.content:r.content.length===1&&r.content[0].type==="paragraph"&&r.content[0].content?r.content[0].content:r.content:r}catch(r){throw new Error(`Failed to parse HTML in markdown: ${r}`)}}isUnrecognizedHtml(t){return eBe(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=hoe(this.baseExtensions),r=n=>{const i=n==null?void 0:n.parseDOM;Array.isArray(i)&&i.forEach(a=>{if(typeof(a==null?void 0:a.tag)=="string"){const s=a.tag.match(/^[a-zA-Z][\w-]*/);s&&t.add(s[0].toLowerCase())}})};Object.values(e.nodes).forEach(n=>r(n.spec)),Object.values(e.marks).forEach(n=>r(n.spec))}catch{}return this.schemaParseDomTagsCache=t,t}htmlAsLiteralText(t,e){const r=t.replace(/\s+$/,"");return r?e?{type:"paragraph",content:[{type:"text",text:r}]}:{type:"text",text:r}:null}encodeTextForMarkdown(t,e,r){return(r==null?void 0:r.type)!=null&&this.codeTypes.has(r.type)||(e.marks||[]).some(i=>this.codeTypes.has(typeof i=="string"?i:i.type))?t:this.escapeMarkdownSyntax(YNe(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,r=0,n=0,i={}){var a;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const s=this.getHandlerForToken(t.type);if(!s)return"";const o=Array.isArray(e==null?void 0:e.content)&&r>0?e.content[r-1]:void 0,l={renderChildren:(d,f)=>{const p=s.isIndenting?n+1:n;return!Array.isArray(d)&&d.content?this.renderNodes(d.content,t,f||"",r,p):this.renderNodes(d,t,f||"",r,p)},renderChild:(d,f)=>{const p=s.isIndenting?n+1:n;return this.renderNodeToMarkdown(d,t,f,p)},indent:d=>this.indentString+d,wrapInBlock:H9e},u={index:r,level:n,parentType:e==null?void 0:e.type,previousNode:o,meta:{parentAttrs:e==null?void 0:e.attrs,...i}};return((a=s.renderMarkdown)==null?void 0:a.call(s,t,l,u))||""}renderNodes(t,e,r="",n=0,i=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,r,i):t.type?this.renderNodeToMarkdown(t,e,n,i):""}renderNodesWithMarkBoundaries(t,e,r="",n=0){const i=[],a=new Map,s=new Set,o=new Map;return t.forEach((l,u)=>{const h=u[C.type,C])),p=this.getMarksToOpenForSerialization(a,f,h),g=q9e(f,h),m=g.filter(C=>a.has(C)),y=m.length>0&&p.length>0;let v="";if(g.length>0&&!y){const C=d.match(/(\s+)$/);C&&(v=C[1],d=d.slice(0,-v.length))}y||g.slice().reverse().forEach(C=>{if(!a.has(C))return;const S=f.get(C),k=this.getMarkClosing(C,S,o.get(C));k&&(d+=k),a.has(C)&&(a.delete(C),o.delete(C))});let T="";if(p.length>0){const C=d.match(/^(\s+)/);C&&(T=C[1],d=d.slice(T.length))}p.forEach(({type:C,mark:S})=>{const k=s.has(C)?"html":"markdown",E=this.getMarkOpening(C,S,k);E&&(d=E+d),o.set(C,k),s.delete(C)}),y||p.slice().reverse().forEach(({type:C,mark:S})=>{a.set(C,S)}),d=T+d;let b;if(y){const C=new Set(((h==null?void 0:h.marks)||[]).map(E=>E.type));p.forEach(({type:E})=>{C.has(E)&&this.getHtmlReopenTags(E)&&s.add(E)});const S=Array.from(a.keys()),k=m.slice().sort((E,_)=>S.indexOf(_)-S.indexOf(E));b=[...p.map(E=>E.type),...k]}else b=Y9e(a,f,h,this.markSetsEqual.bind(this));let w="";if(b.length>0){const C=d.match(/(\s+)$/);C&&(w=C[1],d=d.slice(0,-w.length))}b.forEach(C=>{var S;const k=(S=a.get(C))!=null?S:f.get(C),E=this.getMarkClosing(C,k,o.get(C));E&&(d+=E),a.delete(C),o.delete(C)}),d+=w,d+=v,i.push(d)}else{const d=new Set((l.marks||[]).map(v=>v.type)),f=new Map,p=new Map;a.forEach((v,T)=>{var b;d.has(T)&&(f.set(T,v),p.set(T,(b=o.get(T))!=null?b:"markdown"))});const g=X9e(a,(v,T)=>this.getMarkClosing(v,T,o.get(v)));o.clear();const m=this.renderNodeToMarkdown(l,e,u,n),y=l.type==="hardBreak"?"":j9e(f,a,(v,T)=>{var b;const w=(b=p.get(v))!=null?b:"markdown";return o.set(v,w),this.getMarkOpening(v,T,w)});i.push(g+m+y)}}),i.join(r)}getMarkOpening(t,e,r="markdown"){var n;if(r==="html")return((n=this.getHtmlReopenTags(t))==null?void 0:n.open)||"";const i=this.getHandlersForNodeType(t),a=i.length>0?i[0]:void 0;if(!a||!a.renderMarkdown)return"";const s="__TIPTAP_MARKDOWN_PLACEHOLDER__",o={type:t,attrs:e.attrs||{},content:[{type:"text",text:s}]};try{const l=a.renderMarkdown(o,{renderChildren:()=>s,renderChild:()=>s,indent:h=>h,wrapInBlock:(h,d)=>h+d},{index:0,level:0,parentType:"text",meta:{}}),u=l.indexOf(s);return u>=0?l.substring(0,u):""}catch(l){throw new Error(`Failed to get mark opening for ${t}: ${l}`)}}getMarkClosing(t,e,r="markdown"){var n;if(r==="html")return((n=this.getHtmlReopenTags(t))==null?void 0:n.close)||"";const i=this.getHandlersForNodeType(t),a=i.length>0?i[0]:void 0;if(!a||!a.renderMarkdown)return"";const s="__TIPTAP_MARKDOWN_PLACEHOLDER__",o={type:t,attrs:e.attrs||{},content:[{type:"text",text:s}]};try{const l=a.renderMarkdown(o,{renderChildren:()=>s,renderChild:()=>s,indent:d=>d,wrapInBlock:(d,f)=>d+f},{index:0,level:0,parentType:"text",meta:{}}),u=l.indexOf(s),h=u+s.length;return u>=0?l.substring(h):""}catch(l){throw new Error(`Failed to get mark closing for ${t}: ${l}`)}}getHtmlReopenTags(t){const e=this.getHandlersForNodeType(t),r=e.length>0?e[0]:void 0;return r==null?void 0:r.htmlReopen}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([r,n])=>{const i=e.get(r);return i&&bb(n.attrs,i.attrs)})}getMarksToOpenForSerialization(t,e,r){const n=U9e(t,e);if(n.length<=1)return n;const i=(r==null?void 0:r.marks)||[],a=(u,h)=>i.some(d=>d.type===u&&bb(d.attrs,h)),s=(u,h)=>{var d,f;const p=(d=this.extensionRanks.get(u.type))!=null?d:Number.MAX_SAFE_INTEGER,g=(f=this.extensionRanks.get(h.type))!=null?f:Number.MAX_SAFE_INTEGER;return p!==g?g-p:u.type.localeCompare(h.type)},o=n.filter(u=>!a(u.type,u.mark.attrs)).sort(s),l=n.filter(u=>a(u.type,u.mark.attrs)).sort(s);return[...o,...l]}},rj=tBe,rBe=ci.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!(e!=null&&e.contentType)||gE(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return Ml.setContent(t,e);const n=this.editor.markdown.parse(t);return Ml.setContent(n,e)},insertContent:(t,e)=>{if(!(e!=null&&e.contentType)||gE(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return Ml.insertContent(t,e);const n=this.editor.markdown.parse(t);return Ml.insertContent(n,e)},insertContentAt:(t,e,r)=>{if(!(r!=null&&r.contentType)||gE(e,r==null?void 0:r.contentType)!=="markdown"||!this.editor.markdown)return Ml.insertContentAt(t,e,r);const i=this.editor.markdown.parse(e);return Ml.insertContentAt(t,i,r)}}},addStorage(){return{manager:new rj({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var t;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new rj({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||gE(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const r=this.editor.markdown.parse(this.editor.options.content);(t=r.content)!=null&&t.length&&(this.editor.options.content=r)}});const nBe="modulepreload",iBe=function(t,e){return new URL(t,e).href},nj={},tr=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){let s=function(h){return Promise.all(h.map(d=>Promise.resolve(d).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=s(r.map(h=>{if(h=iBe(h,n),h in nj)return;nj[h]=!0;const d=h.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(!!n)for(let m=o.length-1;m>=0;m--){const y=o[m];if(y.href===h&&(!d||y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${f}`))return;const g=document.createElement("link");if(g.rel=d?"stylesheet":nBe,d||(g.as="script"),g.crossOrigin="",g.href=h,u&&g.setAttribute("nonce",u),document.head.appendChild(g),d)return new Promise((m,y)=>{g.addEventListener("load",m),g.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};var Fle=Object.defineProperty,x=(t,e)=>Fle(t,"name",{value:e,configurable:!0}),Z6=(t,e)=>{for(var r in e)Fle(t,r,{get:e[r],enumerable:!0})};function eg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var F4={exports:{}},aBe=F4.exports,ij;function sBe(){return ij||(ij=1,(function(t,e){(function(r,n){t.exports=n()})(aBe,(function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,T={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(R){var I=["th","st","nd","rd"],$=R%100;return"["+R+(I[($-20)%10]||I[$]||I[0])+"]"}},b=function(R,I,$){var O=String(R);return!O||O.length>=I?R:""+Array(I+1-O.length).join($)+R},w={s:b,z:function(R){var I=-R.utcOffset(),$=Math.abs(I),O=Math.floor($/60),N=$%60;return(I<=0?"+":"-")+b(O,2,"0")+":"+b(N,2,"0")},m:function R(I,$){if(I.date()<$.date())return-R($,I);var O=12*($.year()-I.year())+($.month()-I.month()),N=I.clone().add(O,d),F=$-N<0,z=I.clone().add(O+(F?-1:1),d);return+(-(O+($-N)/(F?N-z:z-N))||0)},a:function(R){return R<0?Math.ceil(R)||0:Math.floor(R)},p:function(R){return{M:d,y:p,w:h,d:u,D:g,h:l,m:o,s,ms:a,Q:f}[R]||String(R||"").toLowerCase().replace(/s$/,"")},u:function(R){return R===void 0}},C="en",S={};S[C]=T;var k="$isDayjsObject",E=function(R){return R instanceof P||!(!R||!R[k])},_=function R(I,$,O){var N;if(!I)return C;if(typeof I=="string"){var F=I.toLowerCase();S[F]&&(N=F),$&&(S[F]=$,N=F);var z=I.split("-");if(!N&&z.length>1)return R(z[0])}else{var V=I.name;S[V]=I,N=V}return!O&&N&&(C=N),N||!O&&C},M=function(R,I){if(E(R))return R.clone();var $=typeof I=="object"?I:{};return $.date=R,$.args=arguments,new P($)},L=w;L.l=_,L.i=E,L.w=function(R,I){return M(R,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var P=(function(){function R($){this.$L=_($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[k]=!0}var I=R.prototype;return I.parse=function($){this.$d=(function(O){var N=O.date,F=O.utc;if(N===null)return new Date(NaN);if(L.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var z=N.match(y);if(z){var V=z[2]-1||0,B=(z[7]||"0").substring(0,3);return F?new Date(Date.UTC(z[1],V,z[3]||1,z[4]||0,z[5]||0,z[6]||0,B)):new Date(z[1],V,z[3]||1,z[4]||0,z[5]||0,z[6]||0,B)}}return new Date(N)})($),this.init()},I.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},I.$utils=function(){return L},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function($,O){var N=M($);return this.startOf(O)<=N&&N<=this.endOf(O)},I.isAfter=function($,O){return M($){},"trace"),debug:x((...t)=>{},"debug"),info:x((...t)=>{},"info"),warn:x((...t)=>{},"warn"),error:x((...t)=>{},"error"),fatal:x((...t)=>{},"fatal")},Tz=x(function(t="fatal"){let e=Au.fatal;typeof t=="string"?t.toLowerCase()in Au&&(e=Au[t]):typeof t=="number"&&(e=t),le.trace=()=>{},le.debug=()=>{},le.info=()=>{},le.warn=()=>{},le.error=()=>{},le.fatal=()=>{},e<=Au.fatal&&(le.fatal=console.error?console.error.bind(console,Qo("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Qo("FATAL"))),e<=Au.error&&(le.error=console.error?console.error.bind(console,Qo("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Qo("ERROR"))),e<=Au.warn&&(le.warn=console.warn?console.warn.bind(console,Qo("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Qo("WARN"))),e<=Au.info&&(le.info=console.info?console.info.bind(console,Qo("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Qo("INFO"))),e<=Au.debug&&(le.debug=console.debug?console.debug.bind(console,Qo("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Qo("DEBUG"))),e<=Au.trace&&(le.trace=console.debug?console.debug.bind(console,Qo("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Qo("TRACE")))},"setLogLevel"),Qo=x(t=>`%c${xa().format("ss.SSS")} : ${t} : `,"format");const z4={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return z4.hue2rgb(a,i,t+1/3)*255;case"g":return z4.hue2rgb(a,i,t)*255;case"b":return z4.hue2rgb(a,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,l=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(ee>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},cBe={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},Ar={channel:z4,lang:lBe,unit:cBe},cd={};for(let t=0;t<=255;t++)cd[t]=Ar.unit.dec2hex(t);const ss={ALL:0,RGB:1,HSL:2};let uBe=class{constructor(){this.type=ss.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=ss.ALL}is(e){return this.type===e}};class hBe{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new uBe}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=ss.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Ar.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Ar.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Ar.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Ar.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Ar.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Ar.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(ss.HSL)&&r!==void 0?r:(this._ensureHSL(),Ar.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(ss.HSL)&&r!==void 0?r:(this._ensureHSL(),Ar.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(ss.HSL)&&r!==void 0?r:(this._ensureHSL(),Ar.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(ss.RGB)&&r!==void 0?r:(this._ensureRGB(),Ar.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(ss.RGB)&&r!==void 0?r:(this._ensureRGB(),Ar.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(ss.RGB)&&r!==void 0?r:(this._ensureRGB(),Ar.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(ss.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(ss.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(ss.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(ss.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(ss.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(ss.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const Q6=new hBe({r:0,g:0,b:0,a:0},"transparent"),cy={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(cy.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,l=s?8:4,u=a?0:-1,h=s?255:15;return Q6.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:a?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${cd[Math.round(e)]}${cd[Math.round(r)]}${cd[Math.round(n)]}${cd[Math.round(i*255)]}`:`#${cd[Math.round(e)]}${cd[Math.round(r)]}${cd[Math.round(n)]}`}},Xp={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Xp.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return Ar.channel.clamp.h(parseFloat(r)*.9);case"rad":return Ar.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Ar.channel.clamp.h(parseFloat(r)*360)}}return Ar.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(Xp.re);if(!r)return;const[,n,i,a,s,o]=r;return Q6.set({h:Xp._hue2deg(n),s:Ar.channel.clamp.s(parseFloat(i)),l:Ar.channel.clamp.l(parseFloat(a)),a:s?Ar.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Ar.lang.round(e)}, ${Ar.lang.round(r)}%, ${Ar.lang.round(n)}%, ${i})`:`hsl(${Ar.lang.round(e)}, ${Ar.lang.round(r)}%, ${Ar.lang.round(n)}%)`}},Nw={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=Nw.colors[t];if(e)return cy.parse(e)},stringify:t=>{const e=cy.stringify(t);for(const r in Nw.colors)if(Nw.colors[r]===e)return r}},VT={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(VT.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return Q6.set({r:Ar.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Ar.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:Ar.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?Ar.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${Ar.lang.round(e)}, ${Ar.lang.round(r)}, ${Ar.lang.round(n)}, ${Ar.lang.round(i)})`:`rgb(${Ar.lang.round(e)}, ${Ar.lang.round(r)}, ${Ar.lang.round(n)})`}},sc={format:{keyword:Nw,hex:cy,rgb:VT,rgba:VT,hsl:Xp,hsla:Xp},parse:t=>{if(typeof t!="string")return t;const e=cy.parse(t)||VT.parse(t)||Xp.parse(t)||Nw.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(ss.HSL)||t.data.r===void 0?Xp.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?VT.stringify(t):cy.stringify(t)},zle=(t,e)=>{const r=sc.parse(t);for(const n in e)r[n]=Ar.channel.clamp[n](e[n]);return sc.stringify(r)},jl=(t,e,r=0,n=1)=>{if(typeof t!="number")return zle(t,{a:e});const i=Q6.set({r:Ar.channel.clamp.r(t),g:Ar.channel.clamp.g(e),b:Ar.channel.clamp.b(r),a:Ar.channel.clamp.a(n)});return sc.stringify(i)},wz=(t,e)=>Ar.lang.round(sc.parse(t)[e]),dBe=t=>{const{r:e,g:r,b:n}=sc.parse(t),i=.2126*Ar.channel.toLinear(e)+.7152*Ar.channel.toLinear(r)+.0722*Ar.channel.toLinear(n);return Ar.lang.round(i)},fBe=t=>dBe(t)>=.5,Zs=t=>!fBe(t),Cz=(t,e,r)=>{const n=sc.parse(t),i=n[e],a=Ar.channel.clamp[e](i+r);return i!==a&&(n[e]=a),sc.stringify(n)},Je=(t,e)=>Cz(t,"l",e),et=(t,e)=>Cz(t,"l",-e),aj=(t,e)=>Cz(t,"a",-e),me=(t,e)=>{const r=sc.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return zle(t,n)},pBe=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=sc.parse(t),{r:o,g:l,b:u,a:h}=sc.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,y=1-m,v=n*m+o*y,T=i*m+l*y,b=a*m+u*y,w=s*d+h*(1-d);return jl(v,T,b,w)},Xe=(t,e=100)=>{const r=sc.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,pBe(r,t,e)};/*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */function sj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r2?n-2:0),a=2;a1?r-1:0),i=1;i"u"?null:Ki(BigInt.prototype.toString),dj=typeof Symbol>"u"?null:Ki(Symbol.prototype.toString),pa=Ki(Object.prototype.hasOwnProperty),Jx=Ki(Object.prototype.toString),fa=Ki(RegExp.prototype.test),Gf=_Be(TypeError);function Ki(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:GT;if(oj&&oj(t,null),!kd(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(xBe(e)||(e[n]=a),i=a)}t[i]=!0}return t}function RBe(t){for(let e=0;e/g),$Be=Ja(/\${[\w\W]*/g),PBe=Ja(/^data-[\-\w.\u00B7-\uFFFF]+$/),BBe=Ja(/^aria-[\-\w]+$/),yj=Ja(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),FBe=Ja(/^(?:\w+script|data):/i),zBe=Ja(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),VBe=Ja(/^html$/i),GBe=Ja(/^[a-z][.\w]*(-[.\w]+)+$/i),vj=Ja(/<[/\w!]/g),bj=Ja(/<[/\w]/g),WBe=Ja(/<\/no(script|embed|frames)/i),HBe=Ja(/\/>/i),Eo={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},qBe=function(){return typeof window>"u"?null:window},UBe=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},xj=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ed=function(e,r,n,i){return pa(e,r)&&kd(e[r])?Jr(i.base?as(i.base):{},e[r],i.transform):n};function Wle(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qBe();const e=wt=>Wle(wt);if(e.version="3.4.13",e.removed=[],!t||!t.document||t.document.nodeType!==Eo.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,s=t.Node,o=t.Element,l=t.NodeFilter,u=t.NamedNodeMap;u===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,d=t.trustedTypes,f=o.prototype,p=Rl(f,"cloneNode"),g=Rl(f,"remove"),m=Rl(f,"nextSibling"),y=Rl(f,"childNodes"),v=Rl(f,"parentNode"),T=Rl(f,"shadowRoot"),b=Rl(f,"attributes"),w=s&&s.prototype?Rl(s.prototype,"nodeType"):null,C=s&&s.prototype?Rl(s.prototype,"nodeName"):null,S=s&&s.prototype?Rl(s.prototype,"ownerDocument"):null;if(typeof a=="function"){const wt=r.createElement("template");wt.content&&wt.content.ownerDocument&&(r=wt.content.ownerDocument)}let k,E="",_,M=!1,L=0;const P=function(){if(L>0)throw Gf('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},D=function(Le){P(),L++;try{return k.createHTML(Le)}finally{L--}},R=function(Le){P(),L++;try{return k.createScriptURL(Le)}finally{L--}},I=function(){return M||(_=UBe(d,i),M=!0),_},$=r,O=$.implementation,N=$.createNodeIterator,F=$.createDocumentFragment,z=$.getElementsByTagName,V=n.importNode;let B=xj();e.isSupported=typeof Vle=="function"&&typeof v=="function"&&O&&O.createHTMLDocument!==void 0;const G=DBe,H=OBe,q=$Be,Z=PBe,Y=BBe,ie=FBe,K=zBe,Q=GBe;let te=yj,J=null;const ge=Jr({},[...fj,...SM,...EM,...AM,...pj]);let ee=null;const Re=Jr({},[...gj,..._M,...mj,...mE]);let Ie=Object.seal(ym(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Be=null,ce=null;const oe=Object.seal(ym(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let be=!0,fe=!0,Pe=!1,ve=!0,Ce=!1,Ve=!0,se=!1,de=!1,Te=null,ae=null,he=!1,W=!1,ne=!1,j=!1,ue=!0,X=!1;const Oe="user-content-";let xe=!0,Ge=!1,_e={},$e=null;const Me=Jr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let He=null;const De=Jr({},["audio","video","img","source","image","track"]);let Ke=null;const Ae=Jr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),at="http://www.w3.org/1998/Math/MathML",Ee="http://www.w3.org/2000/svg",pt="http://www.w3.org/1999/xhtml";let ht=pt,rt=!1,Et=null;const vt=Jr({},[at,Ee,pt],kM),ot=Xa(["mi","mo","mn","ms","mtext"]);let pe=Jr({},ot);const Ct=Xa(["annotation-xml"]);let lt=Jr({},Ct);const st=Jr({},["title","style","font","a","script"]);let mt=null;const _r=["application/xhtml+xml","text/html"],Se="text/html";let Ue=null,tt=null;const kt=r.createElement("form"),Nt=function(Le){return Le instanceof RegExp||Le instanceof Function},sr=function(){let Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(tt&&tt===Le)return;(!Le||typeof Le!="object")&&(Le={}),Le=as(Le),mt=_r.indexOf(Le.PARSER_MEDIA_TYPE)===-1?Se:Le.PARSER_MEDIA_TYPE,Ue=mt==="application/xhtml+xml"?kM:GT,J=ed(Le,"ALLOWED_TAGS",ge,{transform:Ue}),ee=ed(Le,"ALLOWED_ATTR",Re,{transform:Ue}),Et=ed(Le,"ALLOWED_NAMESPACES",vt,{transform:kM}),Ke=ed(Le,"ADD_URI_SAFE_ATTR",Ae,{transform:Ue,base:Ae}),He=ed(Le,"ADD_DATA_URI_TAGS",De,{transform:Ue,base:De}),$e=ed(Le,"FORBID_CONTENTS",Me,{transform:Ue}),Be=ed(Le,"FORBID_TAGS",as({}),{transform:Ue}),ce=ed(Le,"FORBID_ATTR",as({}),{transform:Ue}),_e=pa(Le,"USE_PROFILES")?Le.USE_PROFILES&&typeof Le.USE_PROFILES=="object"?as(Le.USE_PROFILES):Le.USE_PROFILES:!1,be=Le.ALLOW_ARIA_ATTR!==!1,fe=Le.ALLOW_DATA_ATTR!==!1,Pe=Le.ALLOW_UNKNOWN_PROTOCOLS||!1,ve=Le.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ce=Le.SAFE_FOR_TEMPLATES||!1,Ve=Le.SAFE_FOR_XML!==!1,se=Le.WHOLE_DOCUMENT||!1,W=Le.RETURN_DOM||!1,ne=Le.RETURN_DOM_FRAGMENT||!1,j=Le.RETURN_TRUSTED_TYPE||!1,he=Le.FORCE_BODY||!1,ue=Le.SANITIZE_DOM!==!1,X=Le.SANITIZE_NAMED_PROPS||!1,xe=Le.KEEP_CONTENT!==!1,Ge=Le.IN_PLACE||!1,te=MBe(Le.ALLOWED_URI_REGEXP)?Le.ALLOWED_URI_REGEXP:yj,ht=typeof Le.NAMESPACE=="string"?Le.NAMESPACE:pt,pe=pa(Le,"MATHML_TEXT_INTEGRATION_POINTS")&&Le.MATHML_TEXT_INTEGRATION_POINTS&&typeof Le.MATHML_TEXT_INTEGRATION_POINTS=="object"?as(Le.MATHML_TEXT_INTEGRATION_POINTS):Jr({},ot),lt=pa(Le,"HTML_INTEGRATION_POINTS")&&Le.HTML_INTEGRATION_POINTS&&typeof Le.HTML_INTEGRATION_POINTS=="object"?as(Le.HTML_INTEGRATION_POINTS):Jr({},Ct);const je=pa(Le,"CUSTOM_ELEMENT_HANDLING")&&Le.CUSTOM_ELEMENT_HANDLING&&typeof Le.CUSTOM_ELEMENT_HANDLING=="object"?as(Le.CUSTOM_ELEMENT_HANDLING):ym(null);if(Ie=ym(null),pa(je,"tagNameCheck")&&Nt(je.tagNameCheck)&&(Ie.tagNameCheck=je.tagNameCheck),pa(je,"attributeNameCheck")&&Nt(je.attributeNameCheck)&&(Ie.attributeNameCheck=je.attributeNameCheck),pa(je,"allowCustomizedBuiltInElements")&&typeof je.allowCustomizedBuiltInElements=="boolean"&&(Ie.allowCustomizedBuiltInElements=je.allowCustomizedBuiltInElements),Ja(Ie),Ce&&(fe=!1),ne&&(W=!0),_e&&(J=Jr({},pj),ee=ym(null),_e.html===!0&&(Jr(J,fj),Jr(ee,gj)),_e.svg===!0&&(Jr(J,SM),Jr(ee,_M),Jr(ee,mE)),_e.svgFilters===!0&&(Jr(J,EM),Jr(ee,_M),Jr(ee,mE)),_e.mathMl===!0&&(Jr(J,AM),Jr(ee,mj),Jr(ee,mE))),oe.tagCheck=null,oe.attributeCheck=null,pa(Le,"ADD_TAGS")&&(typeof Le.ADD_TAGS=="function"?oe.tagCheck=Le.ADD_TAGS:kd(Le.ADD_TAGS)&&(J===ge&&(J=as(J)),Jr(J,Le.ADD_TAGS,Ue))),pa(Le,"ADD_ATTR")&&(typeof Le.ADD_ATTR=="function"?oe.attributeCheck=Le.ADD_ATTR:kd(Le.ADD_ATTR)&&(ee===Re&&(ee=as(ee)),Jr(ee,Le.ADD_ATTR,Ue))),pa(Le,"ADD_URI_SAFE_ATTR")&&kd(Le.ADD_URI_SAFE_ATTR)&&Jr(Ke,Le.ADD_URI_SAFE_ATTR,Ue),pa(Le,"FORBID_CONTENTS")&&kd(Le.FORBID_CONTENTS)&&($e===Me&&($e=as($e)),Jr($e,Le.FORBID_CONTENTS,Ue)),pa(Le,"ADD_FORBID_CONTENTS")&&kd(Le.ADD_FORBID_CONTENTS)&&($e===Me&&($e=as($e)),Jr($e,Le.ADD_FORBID_CONTENTS,Ue)),xe&&(J["#text"]=!0),se&&Jr(J,["html","head","body"]),J.table&&(Jr(J,["tbody"]),delete Be.tbody),Le.TRUSTED_TYPES_POLICY){if(typeof Le.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Le.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const dt=k;k=Le.TRUSTED_TYPES_POLICY;try{E=D("")}catch(Ft){throw k=dt,Ft}}else Le.TRUSTED_TYPES_POLICY===null?(k=void 0,E=""):(k===void 0&&(k=I()),k&&typeof E=="string"&&(E=D("")));Xa&&Xa(Le),tt=Le},Qt=Jr({},[...SM,...EM,...IBe]),vr=Jr({},[...AM,...NBe]),nr=function(Le,je,dt){return je.namespaceURI===pt?Le==="svg":je.namespaceURI===at?Le==="svg"&&(dt==="annotation-xml"||pe[dt]):!!Qt[Le]},Rr=function(Le,je,dt){return je.namespaceURI===pt?Le==="math":je.namespaceURI===Ee?Le==="math"&<[dt]:!!vr[Le]},Zt=function(Le,je,dt){return je.namespaceURI===Ee&&!lt[dt]||je.namespaceURI===at&&!pe[dt]?!1:!vr[Le]&&(st[Le]||!Qt[Le])},gr=function(Le){let je=v(Le);(!je||!je.tagName)&&(je={namespaceURI:ht,tagName:"template"});const dt=GT(Le.tagName),Ft=GT(je.tagName);return Et[Le.namespaceURI]?Le.namespaceURI===Ee?nr(dt,je,Ft):Le.namespaceURI===at?Rr(dt,je,Ft):Le.namespaceURI===pt?Zt(dt,je,Ft):!!(mt==="application/xhtml+xml"&&Et[Le.namespaceURI]):!1},Dr=function(Le){Wg(e.removed,{element:Le});try{v(Le).removeChild(Le)}catch{if(g(Le),!v(Le))throw Gf("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Qe=function(Le){cr(Le);const je=y(Le);if(je){const Ft=[];Gg(je,er=>{Wg(Ft,er)}),Gg(Ft,er=>{try{g(er)}catch{}})}const dt=b(Le);if(dt)for(let Ft=dt.length-1;Ft>=0;--Ft){const er=dt[Ft],ur=er&&er.name;if(typeof ur=="string")try{Le.removeAttribute(ur)}catch{}}},ct=function(Le,je){try{Wg(e.removed,{attribute:je.getAttributeNode(Le),from:je})}catch{Wg(e.removed,{attribute:null,from:je})}if(je.removeAttribute(Le),Le==="is")if(W||ne)try{Dr(je)}catch{}else try{je.setAttribute(Le,"")}catch{}},It=function(Le){const je=b(Le);if(je)for(let dt=je.length-1;dt>=0;--dt){const Ft=je[dt],er=Ft&&Ft.name;if(!(typeof er!="string"||ee[Ue(er)]))try{Le.removeAttribute(er)}catch{}}},cr=function(Le){const je=[Le];for(;je.length>0;){const dt=je.pop();(w?w(dt):dt.nodeType)===Eo.element&&It(dt);const er=y(dt);if(er)for(let ur=er.length-1;ur>=0;--ur)je.push(er[ur])}},Or=function(Le){if(!Ve)return;const je=[Le];for(;je.length>0;){const dt=je.pop(),Ft=w?w(dt):dt.nodeType;if(Ft===Eo.processingInstruction||Ft===Eo.comment&&fa(bj,dt.data)){try{g(dt)}catch{}continue}if(Ft===Eo.element){const ur=dt,gn=Ue(C?C(dt):dt.nodeName);try{ur.hasAttribute&&ur.hasAttribute("patchsrc")&&ur.removeAttribute("patchsrc"),ur.hasAttribute&&ur.hasAttribute("for")&&gn!=="label"&&gn!=="output"&&ur.removeAttribute("for")}catch{}}const er=y(dt);if(er)for(let ur=er.length-1;ur>=0;--ur)je.push(er[ur])}},yt=function(Le){let je=null,dt=null;if(he)Le=""+Le;else{const ur=cj(Le,/^[\r\n\t ]+/);dt=ur&&ur[0]}mt==="application/xhtml+xml"&&ht===pt&&(Le=''+Le+"");const Ft=k?D(Le):Le;if(ht===pt)try{je=new h().parseFromString(Ft,mt)}catch{}if(!je||!je.documentElement){je=O.createDocument(ht,"template",null);try{je.documentElement.innerHTML=rt?E:Ft}catch{}}const er=je.body||je.documentElement;return Le&&dt&&er.insertBefore(r.createTextNode(dt),er.childNodes[0]||null),ht===pt?z.call(je,se?"html":"body")[0]:se?je.documentElement:er},it=function(Le){const je=S?S(Le):Le.ownerDocument;return N.call(je||Le,Le,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},xt=function(Le){return Le=Qx(Le,G," "),Le=Qx(Le,H," "),Le=Qx(Le,q," "),Le},nt=function(Le){var je;Le.normalize();const dt=S?S(Le):Le.ownerDocument,Ft=N.call(dt||Le,Le,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let er=Ft.nextNode();for(;er;)er.data=xt(er.data),er=Ft.nextNode();const ur=(je=Le.querySelectorAll)===null||je===void 0?void 0:je.call(Le,"template");ur&&Gg(ur,gn=>{ke(gn.content)&&nt(gn.content)})},Ht=function(Le){const je=C?C(Le):null;return typeof je!="string"||Ue(je)!=="form"?!1:typeof Le.nodeName!="string"||typeof Le.textContent!="string"||typeof Le.removeChild!="function"||Le.attributes!==b(Le)||typeof Le.removeAttribute!="function"||typeof Le.setAttribute!="function"||typeof Le.namespaceURI!="string"||typeof Le.insertBefore!="function"||typeof Le.hasChildNodes!="function"||Le.nodeType!==w(Le)||Le.childNodes!==y(Le)},ke=function(Le){if(!w||typeof Le!="object"||Le===null)return!1;try{return w(Le)===Eo.documentFragment}catch{return!1}},rn=function(Le){if(!w||typeof Le!="object"||Le===null)return!1;try{return typeof w(Le)=="number"}catch{return!1}};function Ne(wt,Le,je){wt.length!==0&&Gg(wt,dt=>{dt.call(e,Le,je,tt)})}const Mr=function(Le,je){return!!(Ve&&Le.hasChildNodes()&&!rn(Le.firstElementChild)&&fa(vj,Le.textContent)&&fa(vj,Le.innerHTML)||Ve&&Le.namespaceURI===pt&&je==="style"&&rn(Le.firstElementChild)||Le.nodeType===Eo.processingInstruction||Ve&&Le.nodeType===Eo.comment&&fa(bj,Le.data))},nn=function(Le,je,dt){if(!Be[je]&&Da(je)&&(Ie.tagNameCheck instanceof RegExp&&fa(Ie.tagNameCheck,je)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(je)))return!1;if(xe&&!$e[je]){const Ft=v(Le),er=y(Le);if(er&&Ft){const ur=er.length;for(let gn=ur-1;gn>=0;--gn){const An=Le===dt?p(er[gn],!0):er[gn];Ft.insertBefore(An,m(Le))}}}return Dr(Le),!0},Bi=function(Le,je,dt,Ft){return Le.length===0?je:je===dt||je===Ft?as(je):je},Qr=function(Le,je){if(Ne(B.beforeSanitizeElements,Le,null),Le!==je&&v(Le)===null)return Ge&&cr(Le),!0;if(Ht(Le))return Dr(Le),!0;const dt=Ue(C?C(Le):Le.nodeName);if(J=Bi(B.uponSanitizeElement,J,ge,Te),Ne(B.uponSanitizeElement,Le,{tagName:dt,allowedTags:J}),Le!==je&&v(Le)===null)return Ge&&cr(Le),!0;if(Mr(Le,dt))return Dr(Le),!0;if(Be[dt]||!(oe.tagCheck instanceof Function&&oe.tagCheck(dt))&&!J[dt]){const er=nn(Le,dt,je);return er===!1&&Ne(B.afterSanitizeElements,Le,null),er}if((w?w(Le):Le.nodeType)===Eo.element&&!gr(Le)||(dt==="noscript"||dt==="noembed"||dt==="noframes")&&fa(WBe,Le.innerHTML))return Dr(Le),!0;if(Ce&&Le.nodeType===Eo.text){const er=xt(Le.textContent);Le.textContent!==er&&(Wg(e.removed,{element:Le.cloneNode()}),Le.textContent=er)}return Ne(B.afterSanitizeElements,Le,null),!1},bn=function(Le,je,dt){if(ce[je]||Ve&&je==="patchsrc"||Ve&&je==="for"&&Le!=="label"&&Le!=="output"||ue&&(je==="id"||je==="name")&&(dt in r||dt in kt))return!1;const Ft=ee[je]||oe.attributeCheck instanceof Function&&oe.attributeCheck(je,Le);if(!(fe&&fa(Z,je))){if(!(be&&fa(Y,je))){if(Ft){if(!Ke[je]){if(!fa(te,Qx(dt,K,""))){if(!((je==="src"||je==="xlink:href"||je==="href")&&Le!=="script"&&uj(dt,"data:")===0&&He[Le])){if(!(Pe&&!fa(ie,Qx(dt,K,"")))){if(dt)return!1}}}}}else if(!(Da(Le)&&(Ie.tagNameCheck instanceof RegExp&&fa(Ie.tagNameCheck,Le)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(Le))&&(Ie.attributeNameCheck instanceof RegExp&&fa(Ie.attributeNameCheck,je)||Ie.attributeNameCheck instanceof Function&&Ie.attributeNameCheck(je,Le))||je==="is"&&Ie.allowCustomizedBuiltInElements&&(Ie.tagNameCheck instanceof RegExp&&fa(Ie.tagNameCheck,dt)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(dt))))return!1}}return!0},Yr=Jr({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Da=function(Le){return!Yr[GT(Le)]&&fa(Q,Le)},gc=function(Le,je,dt,Ft){if(k&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!dt)switch(d.getAttributeType(Le,je)){case"TrustedHTML":return D(Ft);case"TrustedScriptURL":return R(Ft)}return Ft},xu=function(Le,je,dt,Ft){try{dt?Le.setAttributeNS(dt,je,Ft):Le.setAttribute(je,Ft),Ht(Le)?Dr(Le):lj(e.removed)}catch{ct(je,Le)}},Vf=function(Le){Ne(B.beforeSanitizeAttributes,Le,null);const je=Le.attributes;if(!je||Ht(Le))return;ee=Bi(B.uponSanitizeAttribute,ee,Re,ae);const dt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee,forceKeepAttr:void 0};let Ft=je.length;const er=Ue(Le.nodeName);for(;Ft--;){const ur=je[Ft],gn=ur.name,An=ur.namespaceURI,da=ur.value,_n=Ue(gn),X7=da;let Ss=gn==="value"?X7:SBe(X7);if(dt.attrName=_n,dt.attrValue=Ss,dt.keepAttr=!0,dt.forceKeepAttr=void 0,Ne(B.uponSanitizeAttribute,Le,dt),Ss=dt.attrValue,X&&(_n==="id"||_n==="name")&&uj(Ss,Oe)!==0&&(ct(gn,Le),Ss=Oe+Ss),Ve&&fa(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ss)){ct(gn,Le);continue}if(_n==="attributename"&&cj(Ss,"href")){ct(gn,Le);continue}if(!dt.forceKeepAttr){if(!dt.keepAttr){ct(gn,Le);continue}if(!ve&&fa(HBe,Ss)){ct(gn,Le);continue}if(Ce&&(Ss=xt(Ss)),!bn(er,_n,Ss)){ct(gn,Le);continue}Ss=gc(er,_n,An,Ss),Ss!==X7&&xu(Le,gn,An,Ss)}}Ne(B.afterSanitizeAttributes,Le,null)},Tu=function(Le){let je=null;const dt=it(Le);for(Ne(B.beforeSanitizeShadowDOM,Le,null);je=dt.nextNode();)if(Ne(B.uponSanitizeShadowNode,je,null),Qr(je,Le),Vf(je),ke(je.content)&&Tu(je.content),(w?w(je):je.nodeType)===Eo.element){const er=T(je);ke(er)&&(wu(er),Tu(er))}Ne(B.afterSanitizeShadowDOM,Le,null)},wu=function(Le){const je=[{node:Le,shadow:null}];for(;je.length>0;){const dt=je.pop();if(dt.shadow){Tu(dt.shadow);continue}const Ft=dt.node,ur=(w?w(Ft):Ft.nodeType)===Eo.element,gn=y(Ft);if(gn)for(let An=gn.length-1;An>=0;--An)je.push({node:gn[An],shadow:null});if(ur){const An=C?C(Ft):null;if(typeof An=="string"&&Ue(An)==="template"){const da=Ft.content;ke(da)&&je.push({node:da,shadow:null})}}if(ur){const An=T(Ft);ke(An)&&je.push({node:null,shadow:An},{node:An,shadow:null})}}};return e.sanitize=function(wt){let Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},je=null,dt=null,Ft=null,er=null;if(rt=!wt,rt&&(wt="\x3C!-->"),typeof wt!="string"&&!rn(wt)&&(wt=LBe(wt),typeof wt!="string"))throw Gf("dirty is not a string, aborting");if(!e.isSupported)return wt;de?(J=Te,ee=ae):sr(Le),(B.uponSanitizeElement.length>0||B.uponSanitizeAttribute.length>0)&&(J=as(J)),B.uponSanitizeAttribute.length>0&&(ee=as(ee)),e.removed=[];const ur=Ge&&typeof wt!="string"&&rn(wt);if(ur){Or(wt);const da=C?C(wt):wt.nodeName;if(typeof da=="string"){const _n=Ue(da);if(!J[_n]||Be[_n])throw Qe(wt),Gf("root node is forbidden and cannot be sanitized in-place")}if(Ht(wt))throw Qe(wt),Gf("root node is clobbered and cannot be sanitized in-place");try{wu(wt)}catch(_n){throw Qe(wt),_n}}else if(rn(wt))je=yt("\x3C!---->"),dt=je.ownerDocument.importNode(wt,!0),dt.nodeType===Eo.element&&dt.nodeName==="BODY"||dt.nodeName==="HTML"?je=dt:je.appendChild(dt),wu(dt);else{if(!W&&!Ce&&!se&&wt.indexOf("<")===-1)return k&&j?D(wt):wt;if(je=yt(wt),!je)return W?null:j?E:""}je&&he&&Dr(je.firstChild);const gn=ur?wt:je;try{const da=it(gn);for(;Ft=da.nextNode();)Qr(Ft,gn),Vf(Ft),ke(Ft.content)&&Tu(Ft.content)}catch(da){throw ur&&(Qe(wt),Gg(e.removed,_n=>{_n.element&&cr(_n.element)})),da}if(ur)return Gg(e.removed,da=>{da.element&&cr(da.element)}),Ce&&nt(wt),wt;if(W){if(Ce&&nt(je),ne)for(er=F.call(je.ownerDocument);je.firstChild;)er.appendChild(je.firstChild);else er=je;return(ee.shadowroot||ee.shadowrootmode)&&(er=V.call(n,er,!0)),er}let An=se?je.outerHTML:je.innerHTML;return se&&J["!doctype"]&&je.ownerDocument&&je.ownerDocument.doctype&&je.ownerDocument.doctype.name&&fa(VBe,je.ownerDocument.doctype.name)&&(An=" -`+An),Ce&&(An=xt(An)),k&&j?D(An):An},e.setConfig=function(){let wt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sr(wt),de=!0,Te=J,ae=ee},e.clearConfig=function(){tt=null,de=!1,Te=null,ae=null,k=_,E=""},e.isValidAttribute=function(wt,Le,je){tt||sr({});const dt=Ue(wt),Ft=Ue(Le);return bn(dt,Ft,je)},e.addHook=function(wt,Le){typeof Le=="function"&&pa(B,wt)&&Wg(B[wt],Le)},e.removeHook=function(wt,Le){if(pa(B,wt)){if(Le!==void 0){const je=CBe(B[wt],Le);return je===-1?void 0:kBe(B[wt],je,1)[0]}return lj(B[wt])}},e.removeHooks=function(wt){pa(B,wt)&&(B[wt]=[])},e.removeAllHooks=function(){B=xj()},e}var ph=Wle(),HD=x((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>HD(t,i,n)),t;if(Array.isArray(e)&&Array.isArray(t))return e.forEach(i=>{t.includes(i)||t.push(i)}),t;if(t==null||r<=0)return t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e;if(e!=null&&typeof t=="object"&&typeof e=="object"){const i=t;Object.entries(e).forEach(([a,s])=>{if(typeof s=="object"){if(s===null)return;Object.hasOwn(t,a)||Object.defineProperty(t,a,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),i[a]===void 0&&(i[a]=Array.isArray(s)?[]:{}),typeof i[a]=="object"&&(i[a]=HD(i[a],s,{depth:r-1}))}else typeof i[a]!="object"&&(Object.hasOwn(t,a)?i[a]=s:Object.defineProperty(t,a,{value:s,writable:!0,enumerable:!0,configurable:!0}))})}return t},"assignWithDepth"),Wi=HD,iu="#ffffff",au="#f2f2f2",Sr=x((t,e)=>e?me(t,{s:-40,l:10}):me(t,{s:-40,l:-10}),"mkBorder"),My,YBe=(My=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,C,S,k,E,_,M,L,P,D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge,ee;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||et(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||et(this.mainBkg,10)):(this.rowOdd=this.rowOdd||Je(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Je(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330}),this.darkMode)for(let Re=0;Re{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(My,"Theme"),My),XBe=x(t=>{const e=new YBe;return e.calculate(t),e},"getThemeVariables"),Iy,jBe=(Iy=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Je(this.primaryColor,16),this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Xe(this.background),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.lineColor=Xe(this.background),this.textColor=Xe(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Je(Xe("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=jl(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=et("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=et(this.sectionBkgColor,10),this.taskBorderColor=jl(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=jl(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||Je(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||et(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,C,S,k,E,_,M,L,P,D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge;this.secondBkg=Je(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=Je(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=Je(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=Xe(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=me(this.primaryColor,{h:64}),this.fillType3=me(this.secondaryColor,{h:64}),this.fillType4=me(this.primaryColor,{h:-64}),this.fillType5=me(this.secondaryColor,{h:-64}),this.fillType6=me(this.primaryColor,{h:128}),this.fillType7=me(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330});for(let ee=0;ee{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Iy,"Theme"),Iy),KBe=x(t=>{const e=new jBe;return e.calculate(t),e},"getThemeVariables"),Ny,ZBe=(Ny=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=me(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.lineColor=Xe(this.background),this.textColor=Xe(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=jl(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,C,S,k,E,_,M,L,P,D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||et(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||et(this.tertiaryColor,40);for(let ee=0;ee{this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Ny,"Theme"),Ny),Dh=x(t=>{const e=new ZBe;return e.calculate(t),e},"getThemeVariables"),Dy,QBe=(Dy=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=Je("#cde498",10),this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.primaryColor),this.lineColor=Xe(this.background),this.textColor=Xe(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,C,S,k,E,_,M,L,P,D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge;this.actorBorder=et(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||et(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||et(this.tertiaryColor,40);for(let ee=0;ee{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Dy,"Theme"),Dy),JBe=x(t=>{const e=new QBe;return e.calculate(t),e},"getThemeVariables"),Oy,eFe=(Oy=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Je(this.contrast,55),this.background="#ffffff",this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.lineColor=Xe(this.background),this.textColor=Xe(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||Je(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,C,S,k,E,_,M,L,P,D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge;this.secondBkg=Je(this.contrast,55),this.border2=this.contrast,this.actorBorder=Je(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let ee=0;ee{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Oy,"Theme"),Oy),tFe=x(t=>{const e=new eFe;return e.calculate(t),e},"getThemeVariables"),$y,rFe=($y=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=me(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||me(e,{h:30}),this.cScale4=this.cScale4||me(e,{h:60}),this.cScale5=this.cScale5||me(e,{h:90}),this.cScale6=this.cScale6||me(e,{h:120}),this.cScale7=this.cScale7||me(e,{h:150}),this.cScale8=this.cScale8||me(e,{h:210,l:150}),this.cScale9=this.cScale9||me(e,{h:270}),this.cScale10=this.cScale10||me(e,{h:300}),this.cScale11=this.cScale11||me(e,{h:330}),this.darkMode)for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x($y,"Theme"),$y),nFe=x(t=>{const e=new rFe;return e.calculate(t),e},"getThemeVariables"),Py,iFe=(Py=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Je(this.primaryColor,16),this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Xe(this.background),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Je(Xe("#323D47"),10),this.border1="#ccc",this.border2=jl(255,255,255,.25),this.arrowheadColor=Xe(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Py,"Theme"),Py),aFe=x(t=>{const e=new iFe;return e.calculate(t),e},"getThemeVariables"),By,sFe=(By=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Sr("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=me(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(By,"Theme"),By),oFe=x(t=>{const e=new sFe;return e.calculate(t),e},"getThemeVariables"),Fy,lFe=(Fy=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Je(this.primaryColor,16),this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Xe(this.background),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Je(Xe("#323D47"),10),this.border1="#ccc",this.border2=jl(255,255,255,.25),this.arrowheadColor=Xe(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Fy,"Theme"),Fy),cFe=x(t=>{const e=new lFe;return e.calculate(t),e},"getThemeVariables"),zy,uFe=(zy=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=me(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(zy,"Theme"),zy),hFe=x(t=>{const e=new uFe;return e.calculate(t),e},"getThemeVariables"),Vy,dFe=(Vy=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Je(this.primaryColor,16),this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Xe(this.background),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Je(Xe("#323D47"),10),this.border1="#ccc",this.border2=jl(255,255,255,.25),this.arrowheadColor=Xe(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Vy,"Theme"),Vy),fFe=x(t=>{const e=new dFe;return e.calculate(t),e},"getThemeVariables"),ch={base:{getThemeVariables:XBe},dark:{getThemeVariables:KBe},default:{getThemeVariables:Dh},forest:{getThemeVariables:JBe},neutral:{getThemeVariables:tFe},neo:{getThemeVariables:nFe},"neo-dark":{getThemeVariables:aFe},redux:{getThemeVariables:oFe},"redux-dark":{getThemeVariables:cFe},"redux-color":{getThemeVariables:hFe},"redux-dark-color":{getThemeVariables:fFe}},Oa={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Hle={...Oa,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:ch.default.getThemeVariables(),sequence:{...Oa.sequence,messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:x(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:x(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Oa.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Oa.c4,useWidth:void 0,personFont:x(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Oa.flowchart,inheritDir:!1},external_personFont:x(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:x(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:x(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:x(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:x(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:x(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:x(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:x(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:x(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:x(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:x(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:x(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:x(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:x(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:x(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:x(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:x(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:x(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:x(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:x(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Oa.pie,useWidth:984},xyChart:{...Oa.xyChart,useWidth:void 0},requirement:{...Oa.requirement,useWidth:void 0},packet:{...Oa.packet},eventmodeling:{...Oa.eventmodeling},treeView:{...Oa.treeView,useWidth:void 0},radar:{...Oa.radar},railroad:{...Oa.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Oa.ishikawa},sankey:{...Oa.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Oa.venn},cynefin:{...Oa.cynefin}},qle=x((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...qle(t[n],"")]:[...r,e+n],[]),"keyify"),pFe=new Set(qle(Hle,"")),Vr=Hle,gFe={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},mFe=x((t,e)=>{for(const r of Object.keys(t)){const n=t[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof n!="string"||!e.test(n))&&(le.debug("sanitize deleting dictionary entry:",r,n),delete t[r])}},"sanitizeDictionaryConfig"),J5=x(t=>{if(le.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>J5(e));return}for(const e of Object.keys(t)){if(le.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!pFe.has(e)||t[e]==null){le.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=gFe[e];n?mFe(t[e],n):(le.debug("sanitizing object",e),J5(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(le.debug("sanitizing css option",e),t[e]=Ule(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}le.debug("After sanitization",t)}},"sanitizeDirective"),Ule=x(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),ho=Wi({},Tb),eA,E0=[],Dw=Wi({},Tb),Uk=x((t,e)=>{let r=Wi({},t),n={};for(const i of e)jle(i),n=Wi(n,i);if(r=Wi(r,n),n.theme&&n.theme in ch){const i=Wi({},eA),a=Wi(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in ch&&(r.themeVariables=ch[r.theme].getThemeVariables(a))}return Dw=r,wFe(Dw),Dw},"updateCurrentConfig"),yFe=x(t=>(ho=Wi({},Tb),ho=Wi(ho,t),t.theme&&ch[t.theme]&&(ho.themeVariables=ch[t.theme].getThemeVariables(t.themeVariables)),Uk(ho,E0),ho),"setSiteConfig"),vFe=x(t=>{eA=Wi({},t)},"saveConfigFromInitialize"),bFe=x(t=>(ho=Wi(ho,t),Uk(ho,E0),ho),"updateSiteConfig"),Yle=x(()=>Wi({},ho),"getSiteConfig"),Xle=x(t=>(Uk(Dw,[t]),Xt()),"setConfig"),Xt=x(()=>Wi({},Dw),"getConfig"),jle=x(t=>{t&&(["secure",...ho.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(le.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&jle(t[e])}))},"sanitize"),xFe=x(t=>{var e;J5(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),E0.push(t),Uk(ho,E0)},"addDirective"),tA=x((t=ho)=>{E0=[],Uk(t,E0)},"reset"),TFe={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},Tj={},Kle=x(t=>{Tj[t]||(le.warn(TFe[t]),Tj[t]=!0)},"issueWarning"),wFe=x(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&Kle("LAZY_LOAD_DEPRECATED")},"checkConfig"),Zle=x(()=>{let t={};eA&&(t=Wi(t,eA));for(const e of E0)t=Wi(t,e);return t},"getUserDefinedConfig"),xn=x(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&Kle("FLOWCHART_HTML_LABELS_DEPRECATED"),su(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),Qle=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Ow=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,CFe=/\s*%%.*\n/gm,Gy,Jle=(Gy=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},x(Gy,"UnknownDiagramError"),Gy),A0={},kz=x(function(t,e){t=t.replace(Qle,"").replace(Ow,"").replace(CFe,` -`);for(const[r,{detector:n}]of Object.entries(A0))if(n(t,e))return r;throw new Jle(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),qD=x((...t)=>{for(const{id:e,detector:r,loader:n}of t)ece(e,r,n)},"registerLazyLoadedDiagrams"),ece=x((t,e,r)=>{A0[t]&&le.warn(`Detector with key ${t} already exists. Overwriting.`),A0[t]={detector:e,loader:r},le.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),kFe=x(t=>A0[t].loader,"getDiagramLoader"),gx=//gi,SFe=x(t=>t?nce(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),EFe=(()=>{let t=!1;return()=>{t||(tce(),t=!0)}})();function tce(){const t="data-temp-href-target";ph.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),ph.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}x(tce,"setupDompurifyHooks");var rce=x(t=>(EFe(),ph.sanitize(t)),"removeScript"),wj=x((t,e)=>{if(xn(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=rce(t):r!=="loose"&&(t=nce(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=LFe(t))}return t},"sanitizeMore"),Wr=x((t,e)=>t&&(e.dompurifyConfig?t=ph.sanitize(wj(t,e),e.dompurifyConfig).toString():t=ph.sanitize(wj(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),AFe=x((t,e)=>typeof t=="string"?Wr(t,e):t.flat().map(r=>Wr(r,e)),"sanitizeTextOrArray"),_Fe=x(t=>gx.test(t),"hasBreaks"),RFe=x(t=>t.split(gx),"splitBreaks"),LFe=x(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),nce=x(t=>t.replace(gx,"#br#"),"breakToPlaceholder"),J6=x(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),MFe=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),IFe=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),fd=x(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),NFe=x((t,e)=>{const r=UD(t,"~"),n=UD(e,"~");return r===1&&n===1},"shouldCombineSets"),DFe=x(t=>{const e=UD(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),Cj=x(()=>window.MathMLElement!==void 0,"isMathMLSupported"),YD=/\$\$(.*?)\$\$/g,$i=x(t=>{var e;return(((e=t.match(YD))==null?void 0:e.length)??0)>0},"hasKatex"),Yk=x(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await eR(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),OFe=x(async(t,e)=>{if(!$i(t))return t;if(!(Cj()||e.legacyMathML||e.forceLegacyMathML))return t.replace(YD,"MathML is unsupported in this environment.");{const{default:r}=await tr(async()=>{const{default:i}=await Promise.resolve().then(()=>wrt);return{default:i}},void 0,import.meta.url),n=e.forceLegacyMathML||!Cj()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(gx).map(i=>$i(i)?`
${i}
`:`
${i}
`).join("").replace(YD,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),eR=x(async(t,e)=>Wr(await OFe(t,e),e),"renderKatexSanitized"),At={getRows:SFe,sanitizeText:Wr,sanitizeTextOrArray:AFe,hasBreaks:_Fe,splitBreaks:RFe,lineBreakRegex:gx,removeScript:rce,getUrl:J6,evaluate:su,getMax:MFe,getMin:IFe},$Fe=x(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),PFe=x(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),Ai=x(function(t,e,r,n){const i=PFe(e,r,n);$Fe(t,i)},"configureSvgSize"),mx=x(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;le.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;le.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,le.info(`Calculated bounds: ${o}x${l}`),Ai(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),V4={};function XD(t){return[...t.cssRules].map(e=>e.cssText).join(` -`)}x(XD,"cssStyleSheetToString");var BFe=x((t,e,r,n)=>{let i="";return t in V4&&V4[t]?i=V4[t]({...r,svgId:n}):le.warn(`No theme found for ${t}`),`& { +`))}}f={type:"taskItem",raw:"",mainContent:v,indentLevel:d,checked:h??!1,text:v,tokens:this.tokenizeInline(v),nestedTokens:T}}const p=u?"taskList":"list";a!==p?(i.length>0&&n.push({type:a,items:i}),i=[f],a=p):i.push(f)}i.length>0&&n.push({type:a,items:i});const s=[];for(let o=0;o0?s:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),r=this.createParseHelpers();if(e.find(i=>{if(!i.parseMarkdown)return!1;const a=i.parseMarkdown(t,r),s=this.normalizeParseResult(a);return s&&(!Array.isArray(s)||s.length>0)?(this.lastParseResult=s,!0):!1})&&this.lastParseResult){const i=this.lastParseResult;return this.lastParseResult=null,i}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),tokenizeInline:t=>this.tokenizeInline(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,r)=>{const n={type:t,attrs:e||void 0,content:r||void 0};return(!e||Object.keys(e).length===0)&&delete n.attrs,n},applyMark:(t,e,r)=>({mark:t,content:e,attrs:r&&Object.keys(r).length>0?r:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){var e,r,n,i;const a=[];for(let s=0;s|\/|$)/i);if(!u&&h&&!/\/>$/.test(l)){const f=h[1],p=this.escapeRegex(f),g=new RegExp(`^<\\/\\s*${p}\\b`,"i");let m=-1;const y=[l];for(let v=s+1;v0;s-=1){const o=a[s],l=a[s-1];if(o.type==="text"&&l.type==="text"){const u=o.marks||[],h=l.marks||[];nDe(u,h)&&(l.text=(l.text||"")+(o.text||""),a.splice(s,1))}}return a}applyMarkToContent(t,e,r){return e.map(n=>{if(n.type==="text"){const i=n.marks||[],a=r?{type:t,attrs:r}:{type:t};return{...n,marks:[...i,a]}}return{...n,content:n.content?this.applyMarkToContent(t,n.content,r):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:bX(t.text||"")};case"html":return this.parseHTMLToken(t);case"escape":return{type:"text",text:t.text||""};case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!t.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(e,!!t.block);try{const r=hNe(e,this.baseExtensions);return r.type==="doc"&&r.content?t.block?r.content:r.content.length===1&&r.content[0].type==="paragraph"&&r.content[0].content?r.content[0].content:r.content:r}catch(r){throw new Error(`Failed to parse HTML in markdown: ${r}`)}}isUnrecognizedHtml(t){return tBe(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=doe(this.baseExtensions),r=n=>{const i=n==null?void 0:n.parseDOM;Array.isArray(i)&&i.forEach(a=>{if(typeof(a==null?void 0:a.tag)=="string"){const s=a.tag.match(/^[a-zA-Z][\w-]*/);s&&t.add(s[0].toLowerCase())}})};Object.values(e.nodes).forEach(n=>r(n.spec)),Object.values(e.marks).forEach(n=>r(n.spec))}catch{}return this.schemaParseDomTagsCache=t,t}htmlAsLiteralText(t,e){const r=t.replace(/\s+$/,"");return r?e?{type:"paragraph",content:[{type:"text",text:r}]}:{type:"text",text:r}:null}encodeTextForMarkdown(t,e,r){return(r==null?void 0:r.type)!=null&&this.codeTypes.has(r.type)||(e.marks||[]).some(i=>this.codeTypes.has(typeof i=="string"?i:i.type))?t:this.escapeMarkdownSyntax(XNe(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,r=0,n=0,i={}){var a;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const s=this.getHandlerForToken(t.type);if(!s)return"";const o=Array.isArray(e==null?void 0:e.content)&&r>0?e.content[r-1]:void 0,l={renderChildren:(d,f)=>{const p=s.isIndenting?n+1:n;return!Array.isArray(d)&&d.content?this.renderNodes(d.content,t,f||"",r,p):this.renderNodes(d,t,f||"",r,p)},renderChild:(d,f)=>{const p=s.isIndenting?n+1:n;return this.renderNodeToMarkdown(d,t,f,p)},indent:d=>this.indentString+d,wrapInBlock:q9e},u={index:r,level:n,parentType:e==null?void 0:e.type,previousNode:o,meta:{parentAttrs:e==null?void 0:e.attrs,...i}};return((a=s.renderMarkdown)==null?void 0:a.call(s,t,l,u))||""}renderNodes(t,e,r="",n=0,i=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,r,i):t.type?this.renderNodeToMarkdown(t,e,n,i):""}renderNodesWithMarkBoundaries(t,e,r="",n=0){const i=[],a=new Map,s=new Set,o=new Map;return t.forEach((l,u)=>{const h=u[C.type,C])),p=this.getMarksToOpenForSerialization(a,f,h),g=U9e(f,h),m=g.filter(C=>a.has(C)),y=m.length>0&&p.length>0;let v="";if(g.length>0&&!y){const C=d.match(/(\s+)$/);C&&(v=C[1],d=d.slice(0,-v.length))}y||g.slice().reverse().forEach(C=>{if(!a.has(C))return;const S=f.get(C),k=this.getMarkClosing(C,S,o.get(C));k&&(d+=k),a.has(C)&&(a.delete(C),o.delete(C))});let T="";if(p.length>0){const C=d.match(/^(\s+)/);C&&(T=C[1],d=d.slice(T.length))}p.forEach(({type:C,mark:S})=>{const k=s.has(C)?"html":"markdown",E=this.getMarkOpening(C,S,k);E&&(d=E+d),o.set(C,k),s.delete(C)}),y||p.slice().reverse().forEach(({type:C,mark:S})=>{a.set(C,S)}),d=T+d;let b;if(y){const C=new Set(((h==null?void 0:h.marks)||[]).map(E=>E.type));p.forEach(({type:E})=>{C.has(E)&&this.getHtmlReopenTags(E)&&s.add(E)});const S=Array.from(a.keys()),k=m.slice().sort((E,_)=>S.indexOf(_)-S.indexOf(E));b=[...p.map(E=>E.type),...k]}else b=X9e(a,f,h,this.markSetsEqual.bind(this));let w="";if(b.length>0){const C=d.match(/(\s+)$/);C&&(w=C[1],d=d.slice(0,-w.length))}b.forEach(C=>{var S;const k=(S=a.get(C))!=null?S:f.get(C),E=this.getMarkClosing(C,k,o.get(C));E&&(d+=E),a.delete(C),o.delete(C)}),d+=w,d+=v,i.push(d)}else{const d=new Set((l.marks||[]).map(v=>v.type)),f=new Map,p=new Map;a.forEach((v,T)=>{var b;d.has(T)&&(f.set(T,v),p.set(T,(b=o.get(T))!=null?b:"markdown"))});const g=j9e(a,(v,T)=>this.getMarkClosing(v,T,o.get(v)));o.clear();const m=this.renderNodeToMarkdown(l,e,u,n),y=l.type==="hardBreak"?"":K9e(f,a,(v,T)=>{var b;const w=(b=p.get(v))!=null?b:"markdown";return o.set(v,w),this.getMarkOpening(v,T,w)});i.push(g+m+y)}}),i.join(r)}getMarkOpening(t,e,r="markdown"){var n;if(r==="html")return((n=this.getHtmlReopenTags(t))==null?void 0:n.open)||"";const i=this.getHandlersForNodeType(t),a=i.length>0?i[0]:void 0;if(!a||!a.renderMarkdown)return"";const s="__TIPTAP_MARKDOWN_PLACEHOLDER__",o={type:t,attrs:e.attrs||{},content:[{type:"text",text:s}]};try{const l=a.renderMarkdown(o,{renderChildren:()=>s,renderChild:()=>s,indent:h=>h,wrapInBlock:(h,d)=>h+d},{index:0,level:0,parentType:"text",meta:{}}),u=l.indexOf(s);return u>=0?l.substring(0,u):""}catch(l){throw new Error(`Failed to get mark opening for ${t}: ${l}`)}}getMarkClosing(t,e,r="markdown"){var n;if(r==="html")return((n=this.getHtmlReopenTags(t))==null?void 0:n.close)||"";const i=this.getHandlersForNodeType(t),a=i.length>0?i[0]:void 0;if(!a||!a.renderMarkdown)return"";const s="__TIPTAP_MARKDOWN_PLACEHOLDER__",o={type:t,attrs:e.attrs||{},content:[{type:"text",text:s}]};try{const l=a.renderMarkdown(o,{renderChildren:()=>s,renderChild:()=>s,indent:d=>d,wrapInBlock:(d,f)=>d+f},{index:0,level:0,parentType:"text",meta:{}}),u=l.indexOf(s),h=u+s.length;return u>=0?l.substring(h):""}catch(l){throw new Error(`Failed to get mark closing for ${t}: ${l}`)}}getHtmlReopenTags(t){const e=this.getHandlersForNodeType(t),r=e.length>0?e[0]:void 0;return r==null?void 0:r.htmlReopen}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([r,n])=>{const i=e.get(r);return i&&bb(n.attrs,i.attrs)})}getMarksToOpenForSerialization(t,e,r){const n=Y9e(t,e);if(n.length<=1)return n;const i=(r==null?void 0:r.marks)||[],a=(u,h)=>i.some(d=>d.type===u&&bb(d.attrs,h)),s=(u,h)=>{var d,f;const p=(d=this.extensionRanks.get(u.type))!=null?d:Number.MAX_SAFE_INTEGER,g=(f=this.extensionRanks.get(h.type))!=null?f:Number.MAX_SAFE_INTEGER;return p!==g?g-p:u.type.localeCompare(h.type)},o=n.filter(u=>!a(u.type,u.mark.attrs)).sort(s),l=n.filter(u=>a(u.type,u.mark.attrs)).sort(s);return[...o,...l]}},rj=rBe,nBe=ci.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!(e!=null&&e.contentType)||gE(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return Ml.setContent(t,e);const n=this.editor.markdown.parse(t);return Ml.setContent(n,e)},insertContent:(t,e)=>{if(!(e!=null&&e.contentType)||gE(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return Ml.insertContent(t,e);const n=this.editor.markdown.parse(t);return Ml.insertContent(n,e)},insertContentAt:(t,e,r)=>{if(!(r!=null&&r.contentType)||gE(e,r==null?void 0:r.contentType)!=="markdown"||!this.editor.markdown)return Ml.insertContentAt(t,e,r);const i=this.editor.markdown.parse(e);return Ml.insertContentAt(t,i,r)}}},addStorage(){return{manager:new rj({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var t;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new rj({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||gE(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const r=this.editor.markdown.parse(this.editor.options.content);(t=r.content)!=null&&t.length&&(this.editor.options.content=r)}});const iBe="modulepreload",aBe=function(t,e){return new URL(t,e).href},nj={},tr=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){let s=function(h){return Promise.all(h.map(d=>Promise.resolve(d).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=s(r.map(h=>{if(h=aBe(h,n),h in nj)return;nj[h]=!0;const d=h.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(!!n)for(let m=o.length-1;m>=0;m--){const y=o[m];if(y.href===h&&(!d||y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${f}`))return;const g=document.createElement("link");if(g.rel=d?"stylesheet":iBe,d||(g.as="script"),g.crossOrigin="",g.href=h,u&&g.setAttribute("nonce",u),document.head.appendChild(g),d)return new Promise((m,y)=>{g.addEventListener("load",m),g.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};var zle=Object.defineProperty,x=(t,e)=>zle(t,"name",{value:e,configurable:!0}),Z6=(t,e)=>{for(var r in e)zle(t,r,{get:e[r],enumerable:!0})};function eg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var F4={exports:{}},sBe=F4.exports,ij;function oBe(){return ij||(ij=1,(function(t,e){(function(r,n){t.exports=n()})(sBe,(function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,T={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(R){var I=["th","st","nd","rd"],$=R%100;return"["+R+(I[($-20)%10]||I[$]||I[0])+"]"}},b=function(R,I,$){var O=String(R);return!O||O.length>=I?R:""+Array(I+1-O.length).join($)+R},w={s:b,z:function(R){var I=-R.utcOffset(),$=Math.abs(I),O=Math.floor($/60),N=$%60;return(I<=0?"+":"-")+b(O,2,"0")+":"+b(N,2,"0")},m:function R(I,$){if(I.date()<$.date())return-R($,I);var O=12*($.year()-I.year())+($.month()-I.month()),N=I.clone().add(O,d),F=$-N<0,z=I.clone().add(O+(F?-1:1),d);return+(-(O+($-N)/(F?N-z:z-N))||0)},a:function(R){return R<0?Math.ceil(R)||0:Math.floor(R)},p:function(R){return{M:d,y:p,w:h,d:u,D:g,h:l,m:o,s,ms:a,Q:f}[R]||String(R||"").toLowerCase().replace(/s$/,"")},u:function(R){return R===void 0}},C="en",S={};S[C]=T;var k="$isDayjsObject",E=function(R){return R instanceof P||!(!R||!R[k])},_=function R(I,$,O){var N;if(!I)return C;if(typeof I=="string"){var F=I.toLowerCase();S[F]&&(N=F),$&&(S[F]=$,N=F);var z=I.split("-");if(!N&&z.length>1)return R(z[0])}else{var V=I.name;S[V]=I,N=V}return!O&&N&&(C=N),N||!O&&C},M=function(R,I){if(E(R))return R.clone();var $=typeof I=="object"?I:{};return $.date=R,$.args=arguments,new P($)},L=w;L.l=_,L.i=E,L.w=function(R,I){return M(R,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var P=(function(){function R($){this.$L=_($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[k]=!0}var I=R.prototype;return I.parse=function($){this.$d=(function(O){var N=O.date,F=O.utc;if(N===null)return new Date(NaN);if(L.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var z=N.match(y);if(z){var V=z[2]-1||0,B=(z[7]||"0").substring(0,3);return F?new Date(Date.UTC(z[1],V,z[3]||1,z[4]||0,z[5]||0,z[6]||0,B)):new Date(z[1],V,z[3]||1,z[4]||0,z[5]||0,z[6]||0,B)}}return new Date(N)})($),this.init()},I.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},I.$utils=function(){return L},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function($,O){var N=M($);return this.startOf(O)<=N&&N<=this.endOf(O)},I.isAfter=function($,O){return M($){},"trace"),debug:x((...t)=>{},"debug"),info:x((...t)=>{},"info"),warn:x((...t)=>{},"warn"),error:x((...t)=>{},"error"),fatal:x((...t)=>{},"fatal")},Tz=x(function(t="fatal"){let e=Au.fatal;typeof t=="string"?t.toLowerCase()in Au&&(e=Au[t]):typeof t=="number"&&(e=t),le.trace=()=>{},le.debug=()=>{},le.info=()=>{},le.warn=()=>{},le.error=()=>{},le.fatal=()=>{},e<=Au.fatal&&(le.fatal=console.error?console.error.bind(console,Qo("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Qo("FATAL"))),e<=Au.error&&(le.error=console.error?console.error.bind(console,Qo("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Qo("ERROR"))),e<=Au.warn&&(le.warn=console.warn?console.warn.bind(console,Qo("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Qo("WARN"))),e<=Au.info&&(le.info=console.info?console.info.bind(console,Qo("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Qo("INFO"))),e<=Au.debug&&(le.debug=console.debug?console.debug.bind(console,Qo("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Qo("DEBUG"))),e<=Au.trace&&(le.trace=console.debug?console.debug.bind(console,Qo("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Qo("TRACE")))},"setLogLevel"),Qo=x(t=>`%c${Ta().format("ss.SSS")} : ${t} : `,"format");const z4={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return z4.hue2rgb(a,i,t+1/3)*255;case"g":return z4.hue2rgb(a,i,t)*255;case"b":return z4.hue2rgb(a,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,l=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(ee>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},uBe={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},Ar={channel:z4,lang:cBe,unit:uBe},cd={};for(let t=0;t<=255;t++)cd[t]=Ar.unit.dec2hex(t);const ss={ALL:0,RGB:1,HSL:2};let hBe=class{constructor(){this.type=ss.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=ss.ALL}is(e){return this.type===e}};class dBe{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new hBe}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=ss.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Ar.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Ar.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Ar.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Ar.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Ar.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Ar.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(ss.HSL)&&r!==void 0?r:(this._ensureHSL(),Ar.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(ss.HSL)&&r!==void 0?r:(this._ensureHSL(),Ar.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(ss.HSL)&&r!==void 0?r:(this._ensureHSL(),Ar.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(ss.RGB)&&r!==void 0?r:(this._ensureRGB(),Ar.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(ss.RGB)&&r!==void 0?r:(this._ensureRGB(),Ar.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(ss.RGB)&&r!==void 0?r:(this._ensureRGB(),Ar.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(ss.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(ss.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(ss.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(ss.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(ss.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(ss.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const Q6=new dBe({r:0,g:0,b:0,a:0},"transparent"),cy={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(cy.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,l=s?8:4,u=a?0:-1,h=s?255:15;return Q6.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:a?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${cd[Math.round(e)]}${cd[Math.round(r)]}${cd[Math.round(n)]}${cd[Math.round(i*255)]}`:`#${cd[Math.round(e)]}${cd[Math.round(r)]}${cd[Math.round(n)]}`}},Xp={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Xp.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return Ar.channel.clamp.h(parseFloat(r)*.9);case"rad":return Ar.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Ar.channel.clamp.h(parseFloat(r)*360)}}return Ar.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(Xp.re);if(!r)return;const[,n,i,a,s,o]=r;return Q6.set({h:Xp._hue2deg(n),s:Ar.channel.clamp.s(parseFloat(i)),l:Ar.channel.clamp.l(parseFloat(a)),a:s?Ar.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Ar.lang.round(e)}, ${Ar.lang.round(r)}%, ${Ar.lang.round(n)}%, ${i})`:`hsl(${Ar.lang.round(e)}, ${Ar.lang.round(r)}%, ${Ar.lang.round(n)}%)`}},Nw={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=Nw.colors[t];if(e)return cy.parse(e)},stringify:t=>{const e=cy.stringify(t);for(const r in Nw.colors)if(Nw.colors[r]===e)return r}},VT={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(VT.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return Q6.set({r:Ar.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Ar.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:Ar.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?Ar.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${Ar.lang.round(e)}, ${Ar.lang.round(r)}, ${Ar.lang.round(n)}, ${Ar.lang.round(i)})`:`rgb(${Ar.lang.round(e)}, ${Ar.lang.round(r)}, ${Ar.lang.round(n)})`}},sc={format:{keyword:Nw,hex:cy,rgb:VT,rgba:VT,hsl:Xp,hsla:Xp},parse:t=>{if(typeof t!="string")return t;const e=cy.parse(t)||VT.parse(t)||Xp.parse(t)||Nw.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(ss.HSL)||t.data.r===void 0?Xp.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?VT.stringify(t):cy.stringify(t)},Vle=(t,e)=>{const r=sc.parse(t);for(const n in e)r[n]=Ar.channel.clamp[n](e[n]);return sc.stringify(r)},jl=(t,e,r=0,n=1)=>{if(typeof t!="number")return Vle(t,{a:e});const i=Q6.set({r:Ar.channel.clamp.r(t),g:Ar.channel.clamp.g(e),b:Ar.channel.clamp.b(r),a:Ar.channel.clamp.a(n)});return sc.stringify(i)},wz=(t,e)=>Ar.lang.round(sc.parse(t)[e]),fBe=t=>{const{r:e,g:r,b:n}=sc.parse(t),i=.2126*Ar.channel.toLinear(e)+.7152*Ar.channel.toLinear(r)+.0722*Ar.channel.toLinear(n);return Ar.lang.round(i)},pBe=t=>fBe(t)>=.5,Zs=t=>!pBe(t),Cz=(t,e,r)=>{const n=sc.parse(t),i=n[e],a=Ar.channel.clamp[e](i+r);return i!==a&&(n[e]=a),sc.stringify(n)},Je=(t,e)=>Cz(t,"l",e),et=(t,e)=>Cz(t,"l",-e),aj=(t,e)=>Cz(t,"a",-e),me=(t,e)=>{const r=sc.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return Vle(t,n)},gBe=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=sc.parse(t),{r:o,g:l,b:u,a:h}=sc.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,y=1-m,v=n*m+o*y,T=i*m+l*y,b=a*m+u*y,w=s*d+h*(1-d);return jl(v,T,b,w)},Xe=(t,e=100)=>{const r=sc.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,gBe(r,t,e)};/*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */function sj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r2?n-2:0),a=2;a1?r-1:0),i=1;i"u"?null:Ki(BigInt.prototype.toString),dj=typeof Symbol>"u"?null:Ki(Symbol.prototype.toString),ga=Ki(Object.prototype.hasOwnProperty),Jx=Ki(Object.prototype.toString),pa=Ki(RegExp.prototype.test),Gf=RBe(TypeError);function Ki(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:GT;if(oj&&oj(t,null),!kd(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(TBe(e)||(e[n]=a),i=a)}t[i]=!0}return t}function LBe(t){for(let e=0;e/g),PBe=Ja(/\${[\w\W]*/g),BBe=Ja(/^data-[\-\w.\u00B7-\uFFFF]+$/),FBe=Ja(/^aria-[\-\w]+$/),yj=Ja(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),zBe=Ja(/^(?:\w+script|data):/i),VBe=Ja(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),GBe=Ja(/^html$/i),WBe=Ja(/^[a-z][.\w]*(-[.\w]+)+$/i),vj=Ja(/<[/\w!]/g),bj=Ja(/<[/\w]/g),HBe=Ja(/<\/no(script|embed|frames)/i),qBe=Ja(/\/>/i),Eo={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},UBe=function(){return typeof window>"u"?null:window},YBe=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},xj=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ed=function(e,r,n,i){return ga(e,r)&&kd(e[r])?Jr(i.base?as(i.base):{},e[r],i.transform):n};function Hle(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:UBe();const e=wt=>Hle(wt);if(e.version="3.4.13",e.removed=[],!t||!t.document||t.document.nodeType!==Eo.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,s=t.Node,o=t.Element,l=t.NodeFilter,u=t.NamedNodeMap;u===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,d=t.trustedTypes,f=o.prototype,p=Rl(f,"cloneNode"),g=Rl(f,"remove"),m=Rl(f,"nextSibling"),y=Rl(f,"childNodes"),v=Rl(f,"parentNode"),T=Rl(f,"shadowRoot"),b=Rl(f,"attributes"),w=s&&s.prototype?Rl(s.prototype,"nodeType"):null,C=s&&s.prototype?Rl(s.prototype,"nodeName"):null,S=s&&s.prototype?Rl(s.prototype,"ownerDocument"):null;if(typeof a=="function"){const wt=r.createElement("template");wt.content&&wt.content.ownerDocument&&(r=wt.content.ownerDocument)}let k,E="",_,M=!1,L=0;const P=function(){if(L>0)throw Gf('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},D=function(Le){P(),L++;try{return k.createHTML(Le)}finally{L--}},R=function(Le){P(),L++;try{return k.createScriptURL(Le)}finally{L--}},I=function(){return M||(_=YBe(d,i),M=!0),_},$=r,O=$.implementation,N=$.createNodeIterator,F=$.createDocumentFragment,z=$.getElementsByTagName,V=n.importNode;let B=xj();e.isSupported=typeof Gle=="function"&&typeof v=="function"&&O&&O.createHTMLDocument!==void 0;const G=OBe,H=$Be,q=PBe,Z=BBe,Y=FBe,ie=zBe,K=VBe,Q=WBe;let te=yj,J=null;const ge=Jr({},[...fj,...SM,...EM,...AM,...pj]);let ee=null;const Re=Jr({},[...gj,..._M,...mj,...mE]);let Ie=Object.seal(ym(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Be=null,ce=null;const oe=Object.seal(ym(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let be=!0,fe=!0,Pe=!1,ve=!0,Ce=!1,Ve=!0,se=!1,de=!1,Te=null,ae=null,he=!1,W=!1,ne=!1,j=!1,ue=!0,X=!1;const Oe="user-content-";let xe=!0,Ge=!1,_e={},$e=null;const Me=Jr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let He=null;const De=Jr({},["audio","video","img","source","image","track"]);let Ke=null;const Ae=Jr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),at="http://www.w3.org/1998/Math/MathML",Ee="http://www.w3.org/2000/svg",pt="http://www.w3.org/1999/xhtml";let ht=pt,rt=!1,Et=null;const vt=Jr({},[at,Ee,pt],kM),ot=Xa(["mi","mo","mn","ms","mtext"]);let pe=Jr({},ot);const Ct=Xa(["annotation-xml"]);let lt=Jr({},Ct);const st=Jr({},["title","style","font","a","script"]);let mt=null;const _r=["application/xhtml+xml","text/html"],Se="text/html";let Ue=null,tt=null;const kt=r.createElement("form"),Nt=function(Le){return Le instanceof RegExp||Le instanceof Function},sr=function(){let Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(tt&&tt===Le)return;(!Le||typeof Le!="object")&&(Le={}),Le=as(Le),mt=_r.indexOf(Le.PARSER_MEDIA_TYPE)===-1?Se:Le.PARSER_MEDIA_TYPE,Ue=mt==="application/xhtml+xml"?kM:GT,J=ed(Le,"ALLOWED_TAGS",ge,{transform:Ue}),ee=ed(Le,"ALLOWED_ATTR",Re,{transform:Ue}),Et=ed(Le,"ALLOWED_NAMESPACES",vt,{transform:kM}),Ke=ed(Le,"ADD_URI_SAFE_ATTR",Ae,{transform:Ue,base:Ae}),He=ed(Le,"ADD_DATA_URI_TAGS",De,{transform:Ue,base:De}),$e=ed(Le,"FORBID_CONTENTS",Me,{transform:Ue}),Be=ed(Le,"FORBID_TAGS",as({}),{transform:Ue}),ce=ed(Le,"FORBID_ATTR",as({}),{transform:Ue}),_e=ga(Le,"USE_PROFILES")?Le.USE_PROFILES&&typeof Le.USE_PROFILES=="object"?as(Le.USE_PROFILES):Le.USE_PROFILES:!1,be=Le.ALLOW_ARIA_ATTR!==!1,fe=Le.ALLOW_DATA_ATTR!==!1,Pe=Le.ALLOW_UNKNOWN_PROTOCOLS||!1,ve=Le.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ce=Le.SAFE_FOR_TEMPLATES||!1,Ve=Le.SAFE_FOR_XML!==!1,se=Le.WHOLE_DOCUMENT||!1,W=Le.RETURN_DOM||!1,ne=Le.RETURN_DOM_FRAGMENT||!1,j=Le.RETURN_TRUSTED_TYPE||!1,he=Le.FORCE_BODY||!1,ue=Le.SANITIZE_DOM!==!1,X=Le.SANITIZE_NAMED_PROPS||!1,xe=Le.KEEP_CONTENT!==!1,Ge=Le.IN_PLACE||!1,te=IBe(Le.ALLOWED_URI_REGEXP)?Le.ALLOWED_URI_REGEXP:yj,ht=typeof Le.NAMESPACE=="string"?Le.NAMESPACE:pt,pe=ga(Le,"MATHML_TEXT_INTEGRATION_POINTS")&&Le.MATHML_TEXT_INTEGRATION_POINTS&&typeof Le.MATHML_TEXT_INTEGRATION_POINTS=="object"?as(Le.MATHML_TEXT_INTEGRATION_POINTS):Jr({},ot),lt=ga(Le,"HTML_INTEGRATION_POINTS")&&Le.HTML_INTEGRATION_POINTS&&typeof Le.HTML_INTEGRATION_POINTS=="object"?as(Le.HTML_INTEGRATION_POINTS):Jr({},Ct);const je=ga(Le,"CUSTOM_ELEMENT_HANDLING")&&Le.CUSTOM_ELEMENT_HANDLING&&typeof Le.CUSTOM_ELEMENT_HANDLING=="object"?as(Le.CUSTOM_ELEMENT_HANDLING):ym(null);if(Ie=ym(null),ga(je,"tagNameCheck")&&Nt(je.tagNameCheck)&&(Ie.tagNameCheck=je.tagNameCheck),ga(je,"attributeNameCheck")&&Nt(je.attributeNameCheck)&&(Ie.attributeNameCheck=je.attributeNameCheck),ga(je,"allowCustomizedBuiltInElements")&&typeof je.allowCustomizedBuiltInElements=="boolean"&&(Ie.allowCustomizedBuiltInElements=je.allowCustomizedBuiltInElements),Ja(Ie),Ce&&(fe=!1),ne&&(W=!0),_e&&(J=Jr({},pj),ee=ym(null),_e.html===!0&&(Jr(J,fj),Jr(ee,gj)),_e.svg===!0&&(Jr(J,SM),Jr(ee,_M),Jr(ee,mE)),_e.svgFilters===!0&&(Jr(J,EM),Jr(ee,_M),Jr(ee,mE)),_e.mathMl===!0&&(Jr(J,AM),Jr(ee,mj),Jr(ee,mE))),oe.tagCheck=null,oe.attributeCheck=null,ga(Le,"ADD_TAGS")&&(typeof Le.ADD_TAGS=="function"?oe.tagCheck=Le.ADD_TAGS:kd(Le.ADD_TAGS)&&(J===ge&&(J=as(J)),Jr(J,Le.ADD_TAGS,Ue))),ga(Le,"ADD_ATTR")&&(typeof Le.ADD_ATTR=="function"?oe.attributeCheck=Le.ADD_ATTR:kd(Le.ADD_ATTR)&&(ee===Re&&(ee=as(ee)),Jr(ee,Le.ADD_ATTR,Ue))),ga(Le,"ADD_URI_SAFE_ATTR")&&kd(Le.ADD_URI_SAFE_ATTR)&&Jr(Ke,Le.ADD_URI_SAFE_ATTR,Ue),ga(Le,"FORBID_CONTENTS")&&kd(Le.FORBID_CONTENTS)&&($e===Me&&($e=as($e)),Jr($e,Le.FORBID_CONTENTS,Ue)),ga(Le,"ADD_FORBID_CONTENTS")&&kd(Le.ADD_FORBID_CONTENTS)&&($e===Me&&($e=as($e)),Jr($e,Le.ADD_FORBID_CONTENTS,Ue)),xe&&(J["#text"]=!0),se&&Jr(J,["html","head","body"]),J.table&&(Jr(J,["tbody"]),delete Be.tbody),Le.TRUSTED_TYPES_POLICY){if(typeof Le.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Le.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const dt=k;k=Le.TRUSTED_TYPES_POLICY;try{E=D("")}catch(Ft){throw k=dt,Ft}}else Le.TRUSTED_TYPES_POLICY===null?(k=void 0,E=""):(k===void 0&&(k=I()),k&&typeof E=="string"&&(E=D("")));Xa&&Xa(Le),tt=Le},Qt=Jr({},[...SM,...EM,...NBe]),vr=Jr({},[...AM,...DBe]),nr=function(Le,je,dt){return je.namespaceURI===pt?Le==="svg":je.namespaceURI===at?Le==="svg"&&(dt==="annotation-xml"||pe[dt]):!!Qt[Le]},Rr=function(Le,je,dt){return je.namespaceURI===pt?Le==="math":je.namespaceURI===Ee?Le==="math"&<[dt]:!!vr[Le]},Zt=function(Le,je,dt){return je.namespaceURI===Ee&&!lt[dt]||je.namespaceURI===at&&!pe[dt]?!1:!vr[Le]&&(st[Le]||!Qt[Le])},gr=function(Le){let je=v(Le);(!je||!je.tagName)&&(je={namespaceURI:ht,tagName:"template"});const dt=GT(Le.tagName),Ft=GT(je.tagName);return Et[Le.namespaceURI]?Le.namespaceURI===Ee?nr(dt,je,Ft):Le.namespaceURI===at?Rr(dt,je,Ft):Le.namespaceURI===pt?Zt(dt,je,Ft):!!(mt==="application/xhtml+xml"&&Et[Le.namespaceURI]):!1},Dr=function(Le){Wg(e.removed,{element:Le});try{v(Le).removeChild(Le)}catch{if(g(Le),!v(Le))throw Gf("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Qe=function(Le){cr(Le);const je=y(Le);if(je){const Ft=[];Gg(je,er=>{Wg(Ft,er)}),Gg(Ft,er=>{try{g(er)}catch{}})}const dt=b(Le);if(dt)for(let Ft=dt.length-1;Ft>=0;--Ft){const er=dt[Ft],ur=er&&er.name;if(typeof ur=="string")try{Le.removeAttribute(ur)}catch{}}},ct=function(Le,je){try{Wg(e.removed,{attribute:je.getAttributeNode(Le),from:je})}catch{Wg(e.removed,{attribute:null,from:je})}if(je.removeAttribute(Le),Le==="is")if(W||ne)try{Dr(je)}catch{}else try{je.setAttribute(Le,"")}catch{}},It=function(Le){const je=b(Le);if(je)for(let dt=je.length-1;dt>=0;--dt){const Ft=je[dt],er=Ft&&Ft.name;if(!(typeof er!="string"||ee[Ue(er)]))try{Le.removeAttribute(er)}catch{}}},cr=function(Le){const je=[Le];for(;je.length>0;){const dt=je.pop();(w?w(dt):dt.nodeType)===Eo.element&&It(dt);const er=y(dt);if(er)for(let ur=er.length-1;ur>=0;--ur)je.push(er[ur])}},Or=function(Le){if(!Ve)return;const je=[Le];for(;je.length>0;){const dt=je.pop(),Ft=w?w(dt):dt.nodeType;if(Ft===Eo.processingInstruction||Ft===Eo.comment&&pa(bj,dt.data)){try{g(dt)}catch{}continue}if(Ft===Eo.element){const ur=dt,gn=Ue(C?C(dt):dt.nodeName);try{ur.hasAttribute&&ur.hasAttribute("patchsrc")&&ur.removeAttribute("patchsrc"),ur.hasAttribute&&ur.hasAttribute("for")&&gn!=="label"&&gn!=="output"&&ur.removeAttribute("for")}catch{}}const er=y(dt);if(er)for(let ur=er.length-1;ur>=0;--ur)je.push(er[ur])}},yt=function(Le){let je=null,dt=null;if(he)Le=""+Le;else{const ur=cj(Le,/^[\r\n\t ]+/);dt=ur&&ur[0]}mt==="application/xhtml+xml"&&ht===pt&&(Le=''+Le+"");const Ft=k?D(Le):Le;if(ht===pt)try{je=new h().parseFromString(Ft,mt)}catch{}if(!je||!je.documentElement){je=O.createDocument(ht,"template",null);try{je.documentElement.innerHTML=rt?E:Ft}catch{}}const er=je.body||je.documentElement;return Le&&dt&&er.insertBefore(r.createTextNode(dt),er.childNodes[0]||null),ht===pt?z.call(je,se?"html":"body")[0]:se?je.documentElement:er},it=function(Le){const je=S?S(Le):Le.ownerDocument;return N.call(je||Le,Le,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},xt=function(Le){return Le=Qx(Le,G," "),Le=Qx(Le,H," "),Le=Qx(Le,q," "),Le},nt=function(Le){var je;Le.normalize();const dt=S?S(Le):Le.ownerDocument,Ft=N.call(dt||Le,Le,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let er=Ft.nextNode();for(;er;)er.data=xt(er.data),er=Ft.nextNode();const ur=(je=Le.querySelectorAll)===null||je===void 0?void 0:je.call(Le,"template");ur&&Gg(ur,gn=>{ke(gn.content)&&nt(gn.content)})},Ht=function(Le){const je=C?C(Le):null;return typeof je!="string"||Ue(je)!=="form"?!1:typeof Le.nodeName!="string"||typeof Le.textContent!="string"||typeof Le.removeChild!="function"||Le.attributes!==b(Le)||typeof Le.removeAttribute!="function"||typeof Le.setAttribute!="function"||typeof Le.namespaceURI!="string"||typeof Le.insertBefore!="function"||typeof Le.hasChildNodes!="function"||Le.nodeType!==w(Le)||Le.childNodes!==y(Le)},ke=function(Le){if(!w||typeof Le!="object"||Le===null)return!1;try{return w(Le)===Eo.documentFragment}catch{return!1}},rn=function(Le){if(!w||typeof Le!="object"||Le===null)return!1;try{return typeof w(Le)=="number"}catch{return!1}};function Ne(wt,Le,je){wt.length!==0&&Gg(wt,dt=>{dt.call(e,Le,je,tt)})}const Mr=function(Le,je){return!!(Ve&&Le.hasChildNodes()&&!rn(Le.firstElementChild)&&pa(vj,Le.textContent)&&pa(vj,Le.innerHTML)||Ve&&Le.namespaceURI===pt&&je==="style"&&rn(Le.firstElementChild)||Le.nodeType===Eo.processingInstruction||Ve&&Le.nodeType===Eo.comment&&pa(bj,Le.data))},nn=function(Le,je,dt){if(!Be[je]&&Da(je)&&(Ie.tagNameCheck instanceof RegExp&&pa(Ie.tagNameCheck,je)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(je)))return!1;if(xe&&!$e[je]){const Ft=v(Le),er=y(Le);if(er&&Ft){const ur=er.length;for(let gn=ur-1;gn>=0;--gn){const An=Le===dt?p(er[gn],!0):er[gn];Ft.insertBefore(An,m(Le))}}}return Dr(Le),!0},Bi=function(Le,je,dt,Ft){return Le.length===0?je:je===dt||je===Ft?as(je):je},Qr=function(Le,je){if(Ne(B.beforeSanitizeElements,Le,null),Le!==je&&v(Le)===null)return Ge&&cr(Le),!0;if(Ht(Le))return Dr(Le),!0;const dt=Ue(C?C(Le):Le.nodeName);if(J=Bi(B.uponSanitizeElement,J,ge,Te),Ne(B.uponSanitizeElement,Le,{tagName:dt,allowedTags:J}),Le!==je&&v(Le)===null)return Ge&&cr(Le),!0;if(Mr(Le,dt))return Dr(Le),!0;if(Be[dt]||!(oe.tagCheck instanceof Function&&oe.tagCheck(dt))&&!J[dt]){const er=nn(Le,dt,je);return er===!1&&Ne(B.afterSanitizeElements,Le,null),er}if((w?w(Le):Le.nodeType)===Eo.element&&!gr(Le)||(dt==="noscript"||dt==="noembed"||dt==="noframes")&&pa(HBe,Le.innerHTML))return Dr(Le),!0;if(Ce&&Le.nodeType===Eo.text){const er=xt(Le.textContent);Le.textContent!==er&&(Wg(e.removed,{element:Le.cloneNode()}),Le.textContent=er)}return Ne(B.afterSanitizeElements,Le,null),!1},bn=function(Le,je,dt){if(ce[je]||Ve&&je==="patchsrc"||Ve&&je==="for"&&Le!=="label"&&Le!=="output"||ue&&(je==="id"||je==="name")&&(dt in r||dt in kt))return!1;const Ft=ee[je]||oe.attributeCheck instanceof Function&&oe.attributeCheck(je,Le);if(!(fe&&pa(Z,je))){if(!(be&&pa(Y,je))){if(Ft){if(!Ke[je]){if(!pa(te,Qx(dt,K,""))){if(!((je==="src"||je==="xlink:href"||je==="href")&&Le!=="script"&&uj(dt,"data:")===0&&He[Le])){if(!(Pe&&!pa(ie,Qx(dt,K,"")))){if(dt)return!1}}}}}else if(!(Da(Le)&&(Ie.tagNameCheck instanceof RegExp&&pa(Ie.tagNameCheck,Le)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(Le))&&(Ie.attributeNameCheck instanceof RegExp&&pa(Ie.attributeNameCheck,je)||Ie.attributeNameCheck instanceof Function&&Ie.attributeNameCheck(je,Le))||je==="is"&&Ie.allowCustomizedBuiltInElements&&(Ie.tagNameCheck instanceof RegExp&&pa(Ie.tagNameCheck,dt)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(dt))))return!1}}return!0},Yr=Jr({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Da=function(Le){return!Yr[GT(Le)]&&pa(Q,Le)},gc=function(Le,je,dt,Ft){if(k&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!dt)switch(d.getAttributeType(Le,je)){case"TrustedHTML":return D(Ft);case"TrustedScriptURL":return R(Ft)}return Ft},xu=function(Le,je,dt,Ft){try{dt?Le.setAttributeNS(dt,je,Ft):Le.setAttribute(je,Ft),Ht(Le)?Dr(Le):lj(e.removed)}catch{ct(je,Le)}},Vf=function(Le){Ne(B.beforeSanitizeAttributes,Le,null);const je=Le.attributes;if(!je||Ht(Le))return;ee=Bi(B.uponSanitizeAttribute,ee,Re,ae);const dt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee,forceKeepAttr:void 0};let Ft=je.length;const er=Ue(Le.nodeName);for(;Ft--;){const ur=je[Ft],gn=ur.name,An=ur.namespaceURI,fa=ur.value,_n=Ue(gn),X7=fa;let Ss=gn==="value"?X7:EBe(X7);if(dt.attrName=_n,dt.attrValue=Ss,dt.keepAttr=!0,dt.forceKeepAttr=void 0,Ne(B.uponSanitizeAttribute,Le,dt),Ss=dt.attrValue,X&&(_n==="id"||_n==="name")&&uj(Ss,Oe)!==0&&(ct(gn,Le),Ss=Oe+Ss),Ve&&pa(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ss)){ct(gn,Le);continue}if(_n==="attributename"&&cj(Ss,"href")){ct(gn,Le);continue}if(!dt.forceKeepAttr){if(!dt.keepAttr){ct(gn,Le);continue}if(!ve&&pa(qBe,Ss)){ct(gn,Le);continue}if(Ce&&(Ss=xt(Ss)),!bn(er,_n,Ss)){ct(gn,Le);continue}Ss=gc(er,_n,An,Ss),Ss!==X7&&xu(Le,gn,An,Ss)}}Ne(B.afterSanitizeAttributes,Le,null)},Tu=function(Le){let je=null;const dt=it(Le);for(Ne(B.beforeSanitizeShadowDOM,Le,null);je=dt.nextNode();)if(Ne(B.uponSanitizeShadowNode,je,null),Qr(je,Le),Vf(je),ke(je.content)&&Tu(je.content),(w?w(je):je.nodeType)===Eo.element){const er=T(je);ke(er)&&(wu(er),Tu(er))}Ne(B.afterSanitizeShadowDOM,Le,null)},wu=function(Le){const je=[{node:Le,shadow:null}];for(;je.length>0;){const dt=je.pop();if(dt.shadow){Tu(dt.shadow);continue}const Ft=dt.node,ur=(w?w(Ft):Ft.nodeType)===Eo.element,gn=y(Ft);if(gn)for(let An=gn.length-1;An>=0;--An)je.push({node:gn[An],shadow:null});if(ur){const An=C?C(Ft):null;if(typeof An=="string"&&Ue(An)==="template"){const fa=Ft.content;ke(fa)&&je.push({node:fa,shadow:null})}}if(ur){const An=T(Ft);ke(An)&&je.push({node:null,shadow:An},{node:An,shadow:null})}}};return e.sanitize=function(wt){let Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},je=null,dt=null,Ft=null,er=null;if(rt=!wt,rt&&(wt="\x3C!-->"),typeof wt!="string"&&!rn(wt)&&(wt=MBe(wt),typeof wt!="string"))throw Gf("dirty is not a string, aborting");if(!e.isSupported)return wt;de?(J=Te,ee=ae):sr(Le),(B.uponSanitizeElement.length>0||B.uponSanitizeAttribute.length>0)&&(J=as(J)),B.uponSanitizeAttribute.length>0&&(ee=as(ee)),e.removed=[];const ur=Ge&&typeof wt!="string"&&rn(wt);if(ur){Or(wt);const fa=C?C(wt):wt.nodeName;if(typeof fa=="string"){const _n=Ue(fa);if(!J[_n]||Be[_n])throw Qe(wt),Gf("root node is forbidden and cannot be sanitized in-place")}if(Ht(wt))throw Qe(wt),Gf("root node is clobbered and cannot be sanitized in-place");try{wu(wt)}catch(_n){throw Qe(wt),_n}}else if(rn(wt))je=yt("\x3C!---->"),dt=je.ownerDocument.importNode(wt,!0),dt.nodeType===Eo.element&&dt.nodeName==="BODY"||dt.nodeName==="HTML"?je=dt:je.appendChild(dt),wu(dt);else{if(!W&&!Ce&&!se&&wt.indexOf("<")===-1)return k&&j?D(wt):wt;if(je=yt(wt),!je)return W?null:j?E:""}je&&he&&Dr(je.firstChild);const gn=ur?wt:je;try{const fa=it(gn);for(;Ft=fa.nextNode();)Qr(Ft,gn),Vf(Ft),ke(Ft.content)&&Tu(Ft.content)}catch(fa){throw ur&&(Qe(wt),Gg(e.removed,_n=>{_n.element&&cr(_n.element)})),fa}if(ur)return Gg(e.removed,fa=>{fa.element&&cr(fa.element)}),Ce&&nt(wt),wt;if(W){if(Ce&&nt(je),ne)for(er=F.call(je.ownerDocument);je.firstChild;)er.appendChild(je.firstChild);else er=je;return(ee.shadowroot||ee.shadowrootmode)&&(er=V.call(n,er,!0)),er}let An=se?je.outerHTML:je.innerHTML;return se&&J["!doctype"]&&je.ownerDocument&&je.ownerDocument.doctype&&je.ownerDocument.doctype.name&&pa(GBe,je.ownerDocument.doctype.name)&&(An=" +`+An),Ce&&(An=xt(An)),k&&j?D(An):An},e.setConfig=function(){let wt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sr(wt),de=!0,Te=J,ae=ee},e.clearConfig=function(){tt=null,de=!1,Te=null,ae=null,k=_,E=""},e.isValidAttribute=function(wt,Le,je){tt||sr({});const dt=Ue(wt),Ft=Ue(Le);return bn(dt,Ft,je)},e.addHook=function(wt,Le){typeof Le=="function"&&ga(B,wt)&&Wg(B[wt],Le)},e.removeHook=function(wt,Le){if(ga(B,wt)){if(Le!==void 0){const je=kBe(B[wt],Le);return je===-1?void 0:SBe(B[wt],je,1)[0]}return lj(B[wt])}},e.removeHooks=function(wt){ga(B,wt)&&(B[wt]=[])},e.removeAllHooks=function(){B=xj()},e}var ph=Hle(),HD=x((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>HD(t,i,n)),t;if(Array.isArray(e)&&Array.isArray(t))return e.forEach(i=>{t.includes(i)||t.push(i)}),t;if(t==null||r<=0)return t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e;if(e!=null&&typeof t=="object"&&typeof e=="object"){const i=t;Object.entries(e).forEach(([a,s])=>{if(typeof s=="object"){if(s===null)return;Object.hasOwn(t,a)||Object.defineProperty(t,a,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),i[a]===void 0&&(i[a]=Array.isArray(s)?[]:{}),typeof i[a]=="object"&&(i[a]=HD(i[a],s,{depth:r-1}))}else typeof i[a]!="object"&&(Object.hasOwn(t,a)?i[a]=s:Object.defineProperty(t,a,{value:s,writable:!0,enumerable:!0,configurable:!0}))})}return t},"assignWithDepth"),Wi=HD,iu="#ffffff",au="#f2f2f2",Sr=x((t,e)=>e?me(t,{s:-40,l:10}):me(t,{s:-40,l:-10}),"mkBorder"),My,XBe=(My=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,C,S,k,E,_,M,L,P,D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge,ee;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||et(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||et(this.mainBkg,10)):(this.rowOdd=this.rowOdd||Je(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Je(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330}),this.darkMode)for(let Re=0;Re{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(My,"Theme"),My),jBe=x(t=>{const e=new XBe;return e.calculate(t),e},"getThemeVariables"),Iy,KBe=(Iy=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Je(this.primaryColor,16),this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Xe(this.background),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.lineColor=Xe(this.background),this.textColor=Xe(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Je(Xe("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=jl(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=et("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=et(this.sectionBkgColor,10),this.taskBorderColor=jl(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=jl(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||Je(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||et(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,C,S,k,E,_,M,L,P,D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge;this.secondBkg=Je(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=Je(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=Je(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=Xe(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=me(this.primaryColor,{h:64}),this.fillType3=me(this.secondaryColor,{h:64}),this.fillType4=me(this.primaryColor,{h:-64}),this.fillType5=me(this.secondaryColor,{h:-64}),this.fillType6=me(this.primaryColor,{h:128}),this.fillType7=me(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330});for(let ee=0;ee{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Iy,"Theme"),Iy),ZBe=x(t=>{const e=new KBe;return e.calculate(t),e},"getThemeVariables"),Ny,QBe=(Ny=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=me(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.lineColor=Xe(this.background),this.textColor=Xe(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=jl(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,C,S,k,E,_,M,L,P,D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||et(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||et(this.tertiaryColor,40);for(let ee=0;ee{this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Ny,"Theme"),Ny),Dh=x(t=>{const e=new QBe;return e.calculate(t),e},"getThemeVariables"),Dy,JBe=(Dy=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=Je("#cde498",10),this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.primaryColor),this.lineColor=Xe(this.background),this.textColor=Xe(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,C,S,k,E,_,M,L,P,D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge;this.actorBorder=et(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||et(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||et(this.tertiaryColor,40);for(let ee=0;ee{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Dy,"Theme"),Dy),eFe=x(t=>{const e=new JBe;return e.calculate(t),e},"getThemeVariables"),Oy,tFe=(Oy=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Je(this.contrast,55),this.background="#ffffff",this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.lineColor=Xe(this.background),this.textColor=Xe(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||Je(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,C,S,k,E,_,M,L,P,D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge;this.secondBkg=Je(this.contrast,55),this.border2=this.contrast,this.actorBorder=Je(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let ee=0;ee{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Oy,"Theme"),Oy),rFe=x(t=>{const e=new tFe;return e.calculate(t),e},"getThemeVariables"),$y,nFe=($y=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=me(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||me(e,{h:30}),this.cScale4=this.cScale4||me(e,{h:60}),this.cScale5=this.cScale5||me(e,{h:90}),this.cScale6=this.cScale6||me(e,{h:120}),this.cScale7=this.cScale7||me(e,{h:150}),this.cScale8=this.cScale8||me(e,{h:210,l:150}),this.cScale9=this.cScale9||me(e,{h:270}),this.cScale10=this.cScale10||me(e,{h:300}),this.cScale11=this.cScale11||me(e,{h:330}),this.darkMode)for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x($y,"Theme"),$y),iFe=x(t=>{const e=new nFe;return e.calculate(t),e},"getThemeVariables"),Py,aFe=(Py=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Je(this.primaryColor,16),this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Xe(this.background),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Je(Xe("#323D47"),10),this.border1="#ccc",this.border2=jl(255,255,255,.25),this.arrowheadColor=Xe(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Py,"Theme"),Py),sFe=x(t=>{const e=new aFe;return e.calculate(t),e},"getThemeVariables"),By,oFe=(By=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Sr("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=me(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(By,"Theme"),By),lFe=x(t=>{const e=new oFe;return e.calculate(t),e},"getThemeVariables"),Fy,cFe=(Fy=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Je(this.primaryColor,16),this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Xe(this.background),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Je(Xe("#323D47"),10),this.border1="#ccc",this.border2=jl(255,255,255,.25),this.arrowheadColor=Xe(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Fy,"Theme"),Fy),uFe=x(t=>{const e=new cFe;return e.calculate(t),e},"getThemeVariables"),zy,hFe=(zy=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=me(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(zy,"Theme"),zy),dFe=x(t=>{const e=new hFe;return e.calculate(t),e},"getThemeVariables"),Vy,fFe=(Vy=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Je(this.primaryColor,16),this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Xe(this.background),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Je(Xe("#323D47"),10),this.border1="#ccc",this.border2=jl(255,255,255,.25),this.arrowheadColor=Xe(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Vy,"Theme"),Vy),pFe=x(t=>{const e=new fFe;return e.calculate(t),e},"getThemeVariables"),ch={base:{getThemeVariables:jBe},dark:{getThemeVariables:ZBe},default:{getThemeVariables:Dh},forest:{getThemeVariables:eFe},neutral:{getThemeVariables:rFe},neo:{getThemeVariables:iFe},"neo-dark":{getThemeVariables:sFe},redux:{getThemeVariables:lFe},"redux-dark":{getThemeVariables:uFe},"redux-color":{getThemeVariables:dFe},"redux-dark-color":{getThemeVariables:pFe}},Oa={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},qle={...Oa,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:ch.default.getThemeVariables(),sequence:{...Oa.sequence,messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:x(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:x(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Oa.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Oa.c4,useWidth:void 0,personFont:x(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Oa.flowchart,inheritDir:!1},external_personFont:x(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:x(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:x(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:x(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:x(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:x(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:x(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:x(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:x(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:x(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:x(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:x(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:x(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:x(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:x(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:x(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:x(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:x(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:x(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:x(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Oa.pie,useWidth:984},xyChart:{...Oa.xyChart,useWidth:void 0},requirement:{...Oa.requirement,useWidth:void 0},packet:{...Oa.packet},eventmodeling:{...Oa.eventmodeling},treeView:{...Oa.treeView,useWidth:void 0},radar:{...Oa.radar},railroad:{...Oa.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Oa.ishikawa},sankey:{...Oa.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Oa.venn},cynefin:{...Oa.cynefin}},Ule=x((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...Ule(t[n],"")]:[...r,e+n],[]),"keyify"),gFe=new Set(Ule(qle,"")),Vr=qle,mFe={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},yFe=x((t,e)=>{for(const r of Object.keys(t)){const n=t[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof n!="string"||!e.test(n))&&(le.debug("sanitize deleting dictionary entry:",r,n),delete t[r])}},"sanitizeDictionaryConfig"),J5=x(t=>{if(le.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>J5(e));return}for(const e of Object.keys(t)){if(le.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!gFe.has(e)||t[e]==null){le.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=mFe[e];n?yFe(t[e],n):(le.debug("sanitizing object",e),J5(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(le.debug("sanitizing css option",e),t[e]=Yle(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}le.debug("After sanitization",t)}},"sanitizeDirective"),Yle=x(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),ho=Wi({},Tb),eA,E0=[],Dw=Wi({},Tb),Uk=x((t,e)=>{let r=Wi({},t),n={};for(const i of e)Kle(i),n=Wi(n,i);if(r=Wi(r,n),n.theme&&n.theme in ch){const i=Wi({},eA),a=Wi(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in ch&&(r.themeVariables=ch[r.theme].getThemeVariables(a))}return Dw=r,CFe(Dw),Dw},"updateCurrentConfig"),vFe=x(t=>(ho=Wi({},Tb),ho=Wi(ho,t),t.theme&&ch[t.theme]&&(ho.themeVariables=ch[t.theme].getThemeVariables(t.themeVariables)),Uk(ho,E0),ho),"setSiteConfig"),bFe=x(t=>{eA=Wi({},t)},"saveConfigFromInitialize"),xFe=x(t=>(ho=Wi(ho,t),Uk(ho,E0),ho),"updateSiteConfig"),Xle=x(()=>Wi({},ho),"getSiteConfig"),jle=x(t=>(Uk(Dw,[t]),Xt()),"setConfig"),Xt=x(()=>Wi({},Dw),"getConfig"),Kle=x(t=>{t&&(["secure",...ho.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(le.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&Kle(t[e])}))},"sanitize"),TFe=x(t=>{var e;J5(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),E0.push(t),Uk(ho,E0)},"addDirective"),tA=x((t=ho)=>{E0=[],Uk(t,E0)},"reset"),wFe={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},Tj={},Zle=x(t=>{Tj[t]||(le.warn(wFe[t]),Tj[t]=!0)},"issueWarning"),CFe=x(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&Zle("LAZY_LOAD_DEPRECATED")},"checkConfig"),Qle=x(()=>{let t={};eA&&(t=Wi(t,eA));for(const e of E0)t=Wi(t,e);return t},"getUserDefinedConfig"),xn=x(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&Zle("FLOWCHART_HTML_LABELS_DEPRECATED"),su(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),Jle=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Ow=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,kFe=/\s*%%.*\n/gm,Gy,ece=(Gy=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},x(Gy,"UnknownDiagramError"),Gy),A0={},kz=x(function(t,e){t=t.replace(Jle,"").replace(Ow,"").replace(kFe,` +`);for(const[r,{detector:n}]of Object.entries(A0))if(n(t,e))return r;throw new ece(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),qD=x((...t)=>{for(const{id:e,detector:r,loader:n}of t)tce(e,r,n)},"registerLazyLoadedDiagrams"),tce=x((t,e,r)=>{A0[t]&&le.warn(`Detector with key ${t} already exists. Overwriting.`),A0[t]={detector:e,loader:r},le.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),SFe=x(t=>A0[t].loader,"getDiagramLoader"),gx=//gi,EFe=x(t=>t?ice(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),AFe=(()=>{let t=!1;return()=>{t||(rce(),t=!0)}})();function rce(){const t="data-temp-href-target";ph.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),ph.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}x(rce,"setupDompurifyHooks");var nce=x(t=>(AFe(),ph.sanitize(t)),"removeScript"),wj=x((t,e)=>{if(xn(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=nce(t):r!=="loose"&&(t=ice(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=MFe(t))}return t},"sanitizeMore"),Wr=x((t,e)=>t&&(e.dompurifyConfig?t=ph.sanitize(wj(t,e),e.dompurifyConfig).toString():t=ph.sanitize(wj(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),_Fe=x((t,e)=>typeof t=="string"?Wr(t,e):t.flat().map(r=>Wr(r,e)),"sanitizeTextOrArray"),RFe=x(t=>gx.test(t),"hasBreaks"),LFe=x(t=>t.split(gx),"splitBreaks"),MFe=x(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),ice=x(t=>t.replace(gx,"#br#"),"breakToPlaceholder"),J6=x(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),IFe=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),NFe=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),fd=x(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),DFe=x((t,e)=>{const r=UD(t,"~"),n=UD(e,"~");return r===1&&n===1},"shouldCombineSets"),OFe=x(t=>{const e=UD(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),Cj=x(()=>window.MathMLElement!==void 0,"isMathMLSupported"),YD=/\$\$(.*?)\$\$/g,$i=x(t=>{var e;return(((e=t.match(YD))==null?void 0:e.length)??0)>0},"hasKatex"),Yk=x(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await eR(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),$Fe=x(async(t,e)=>{if(!$i(t))return t;if(!(Cj()||e.legacyMathML||e.forceLegacyMathML))return t.replace(YD,"MathML is unsupported in this environment.");{const{default:r}=await tr(async()=>{const{default:i}=await Promise.resolve().then(()=>Srt);return{default:i}},void 0,import.meta.url),n=e.forceLegacyMathML||!Cj()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(gx).map(i=>$i(i)?`
${i}
`:`
${i}
`).join("").replace(YD,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),eR=x(async(t,e)=>Wr(await $Fe(t,e),e),"renderKatexSanitized"),At={getRows:EFe,sanitizeText:Wr,sanitizeTextOrArray:_Fe,hasBreaks:RFe,splitBreaks:LFe,lineBreakRegex:gx,removeScript:nce,getUrl:J6,evaluate:su,getMax:IFe,getMin:NFe},PFe=x(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),BFe=x(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),Ai=x(function(t,e,r,n){const i=BFe(e,r,n);PFe(t,i)},"configureSvgSize"),mx=x(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;le.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;le.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,le.info(`Calculated bounds: ${o}x${l}`),Ai(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),V4={};function XD(t){return[...t.cssRules].map(e=>e.cssText).join(` +`)}x(XD,"cssStyleSheetToString");var FFe=x((t,e,r,n)=>{let i="";return t in V4&&V4[t]?i=V4[t]({...r,svgId:n}):le.warn(`No theme found for ${t}`),`& { font-family: ${r.fontFamily}; font-size: ${r.fontSize}; fill: ${r.textColor} @@ -344,48 +344,48 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } ${e} -`},"getStyles"),FFe=x((t,e)=>{e!==void 0&&(V4[t]=e)},"addStylesForDiagram"),zFe=BFe,Sz={};Z6(Sz,{clear:()=>On,getAccDescription:()=>ai,getAccTitle:()=>ni,getDiagramTitle:()=>Yn,setAccDescription:()=>ii,setAccTitle:()=>Hn,setDiagramTitle:()=>ti});var Ez="",Az="",_z="",Rz=x(t=>Wr(t,Xt()),"sanitizeText"),On=x(()=>{Ez="",_z="",Az=""},"clear"),Hn=x(t=>{Ez=Rz(t).replace(/^\s+/g,"")},"setAccTitle"),ni=x(()=>Ez,"getAccTitle"),ii=x(t=>{_z=Rz(t).replace(/\n\s+/g,` -`)},"setAccDescription"),ai=x(()=>_z,"getAccDescription"),ti=x(t=>{Az=Rz(t)},"setDiagramTitle"),Yn=x(()=>Az,"getDiagramTitle"),kj=le,VFe=Tz,Fe=Xt,jD=Xle,ice=Tb,Lz=x(t=>Wr(t,Fe()),"sanitizeText"),Mz=mx,GFe=x(()=>Sz,"getCommonDb"),rA={},nA=x((t,e,r)=>{var n;rA[t]&&kj.warn(`Diagram with id ${t} already registered. Overwriting.`),rA[t]=e,r&&ece(t,r),FFe(t,e.styles),(n=e.injectUtils)==null||n.call(e,kj,VFe,Fe,Lz,Mz,GFe(),()=>{})},"registerDiagram"),KD=x(t=>{if(t in rA)return rA[t];throw new WFe(t)},"getDiagram"),Wy,WFe=(Wy=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},x(Wy,"DiagramNotFoundError"),Wy);function G4(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function HFe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function Iz(t){let e,r,n;t.length!==2?(e=G4,r=(o,l)=>G4(t(o),l),n=(o,l)=>t(o)-l):(e=t===G4||t===HFe?t:qFe,r=t,n=t);function i(o,l,u=0,h=o.length){if(u>>1;r(o[d],l)<0?u=d+1:h=d}while(u>>1;r(o[d],l)<=0?u=d+1:h=d}while(uu&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function qFe(){return 0}function UFe(t){return t===null?NaN:+t}const YFe=Iz(G4),XFe=YFe.right;Iz(UFe).center;class Sj extends Map{constructor(e,r=ZFe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(Ej(this,e))}has(e){return super.has(Ej(this,e))}set(e,r){return super.set(jFe(this,e),r)}delete(e){return super.delete(KFe(this,e))}}function Ej({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function jFe({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function KFe({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function ZFe(t){return t!==null&&typeof t=="object"?t.valueOf():t}const QFe=Math.sqrt(50),JFe=Math.sqrt(10),eze=Math.sqrt(2);function iA(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=QFe?10:a>=JFe?5:a>=eze?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(t*u),l=Math.round(e*u),o/ue&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(t/u),l=Math.round(e/u),o*ue&&--l),l0))return[];if(t===e)return[t];const n=e=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let u=0;u=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function nze(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function ize(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n+t(e)}function cze(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function uze(){return!this.__axis}function ace(t,e){var r=[],n=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===W4||t===yE?-1:1,h=t===yE||t===RM?"x":"y",d=t===W4||t===JD?sze:oze;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):aze),y=Math.max(a,0)+o,v=e.range(),T=+v[0]+l,b=+v[v.length-1]+l,w=(e.bandwidth?cze:lze)(e.copy(),l),C=p.selection?p.selection():p,S=C.selectAll(".domain").data([null]),k=C.selectAll(".tick").data(g,e).order(),E=k.exit(),_=k.enter().append("g").attr("class","tick"),M=k.select("line"),L=k.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(_),M=M.merge(_.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),L=L.merge(_.append("text").attr("fill","currentColor").attr(h,u*y).attr("dy",t===W4?"0em":t===JD?"0.71em":"0.32em")),p!==C&&(S=S.transition(p),k=k.transition(p),M=M.transition(p),L=L.transition(p),E=E.transition(p).attr("opacity",Aj).attr("transform",function(P){return isFinite(P=w(P))?d(P+l):this.getAttribute("transform")}),_.attr("opacity",Aj).attr("transform",function(P){var D=this.parentNode.__axis;return d((D&&isFinite(D=D(P))?D:w(P))+l)})),E.remove(),S.attr("d",t===yE||t===RM?s?"M"+u*s+","+T+"H"+l+"V"+b+"H"+u*s:"M"+l+","+T+"V"+b:s?"M"+T+","+u*s+"V"+l+"H"+b+"V"+u*s:"M"+T+","+l+"H"+b),k.attr("opacity",1).attr("transform",function(P){return d(w(P)+l)}),M.attr(h+"2",u*a),L.attr(h,u*y).text(m),C.filter(uze).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===RM?"start":t===yE?"end":"middle"),C.each(function(){this.__axis=w})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(a=s=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(s=+p,f):s},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function hze(t){return ace(W4,t)}function dze(t){return ace(JD,t)}var fze={value:()=>{}};function sce(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}H4.prototype=sce.prototype={constructor:H4,on:function(t,e){var r=this._,n=pze(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),Rj.hasOwnProperty(e)?{space:Rj[e],local:t}:t}function mze(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===eO&&e.documentElement.namespaceURI===eO?e.createElement(t):e.createElementNS(r,t)}}function yze(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function oce(t){var e=tR(t);return(e.local?yze:mze)(e)}function vze(){}function Nz(t){return t==null?vze:function(){return this.querySelector(t)}}function bze(t){typeof t!="function"&&(t=Nz(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=b&&(b=T+1);!(C=y[b])&&++b=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function Hze(t){t||(t=qze);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}function Uze(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Yze(){return Array.from(this)}function Xze(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?aVe:typeof e=="function"?oVe:sVe)(t,e,r??"")):wb(this.node(),t)}function wb(t,e){return t.style.getPropertyValue(e)||dce(t).getComputedStyle(t,null).getPropertyValue(e)}function cVe(t){return function(){delete this[t]}}function uVe(t,e){return function(){this[t]=e}}function hVe(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function dVe(t,e){return arguments.length>1?this.each((e==null?cVe:typeof e=="function"?hVe:uVe)(t,e)):this.node()[t]}function fce(t){return t.trim().split(/^|\s+/)}function Dz(t){return t.classList||new pce(t)}function pce(t){this._node=t,this._names=fce(t.getAttribute("class")||"")}pce.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function gce(t,e){for(var r=Dz(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function zVe(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?vE(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?vE(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=jVe.exec(t))?new hs(e[1],e[2],e[3],1):(e=KVe.exec(t))?new hs(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ZVe.exec(t))?vE(e[1],e[2],e[3],e[4]):(e=QVe.exec(t))?vE(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=JVe.exec(t))?$j(e[1],e[2]/100,e[3]/100,1):(e=eGe.exec(t))?$j(e[1],e[2]/100,e[3]/100,e[4]):Lj.hasOwnProperty(t)?Nj(Lj[t]):t==="transparent"?new hs(NaN,NaN,NaN,0):null}function Nj(t){return new hs(t>>16&255,t>>8&255,t&255,1)}function vE(t,e,r,n){return n<=0&&(t=e=r=NaN),new hs(t,e,r,n)}function bce(t){return t instanceof tg||(t=_0(t)),t?(t=t.rgb(),new hs(t.r,t.g,t.b,t.opacity)):new hs}function tO(t,e,r,n){return arguments.length===1?bce(t):new hs(t,e,r,n??1)}function hs(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}jk(hs,tO,rR(tg,{brighter(t){return t=t==null?sA:Math.pow(sA,t),new hs(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?SC:Math.pow(SC,t),new hs(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new hs(u0(this.r),u0(this.g),u0(this.b),oA(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Dj,formatHex:Dj,formatHex8:nGe,formatRgb:Oj,toString:Oj}));function Dj(){return`#${jp(this.r)}${jp(this.g)}${jp(this.b)}`}function nGe(){return`#${jp(this.r)}${jp(this.g)}${jp(this.b)}${jp((isNaN(this.opacity)?1:this.opacity)*255)}`}function Oj(){const t=oA(this.opacity);return`${t===1?"rgb(":"rgba("}${u0(this.r)}, ${u0(this.g)}, ${u0(this.b)}${t===1?")":`, ${t})`}`}function oA(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function u0(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function jp(t){return t=u0(t),(t<16?"0":"")+t.toString(16)}function $j(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Wl(t,e,r,n)}function xce(t){if(t instanceof Wl)return new Wl(t.h,t.s,t.l,t.opacity);if(t instanceof tg||(t=_0(t)),!t)return new Wl;if(t instanceof Wl)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(e===a?s=(r-n)/o+(r0&&l<1?0:s,new Wl(s,o,l,t.opacity)}function iGe(t,e,r,n){return arguments.length===1?xce(t):new Wl(t,e,r,n??1)}function Wl(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}jk(Wl,iGe,rR(tg,{brighter(t){return t=t==null?sA:Math.pow(sA,t),new Wl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?SC:Math.pow(SC,t),new Wl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new hs(LM(t>=240?t-240:t+120,i,n),LM(t,i,n),LM(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Wl(Pj(this.h),bE(this.s),bE(this.l),oA(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=oA(this.opacity);return`${t===1?"hsl(":"hsla("}${Pj(this.h)}, ${bE(this.s)*100}%, ${bE(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Pj(t){return t=(t||0)%360,t<0?t+360:t}function bE(t){return Math.max(0,Math.min(1,t||0))}function LM(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const aGe=Math.PI/180,sGe=180/Math.PI,lA=18,Tce=.96422,wce=1,Cce=.82521,kce=4/29,hy=6/29,Sce=3*hy*hy,oGe=hy*hy*hy;function Ece(t){if(t instanceof qc)return new qc(t.l,t.a,t.b,t.opacity);if(t instanceof Zu)return Ace(t);t instanceof hs||(t=bce(t));var e=DM(t.r),r=DM(t.g),n=DM(t.b),i=MM((.2225045*e+.7168786*r+.0606169*n)/wce),a,s;return e===r&&r===n?a=s=i:(a=MM((.4360747*e+.3850649*r+.1430804*n)/Tce),s=MM((.0139322*e+.0971045*r+.7141733*n)/Cce)),new qc(116*i-16,500*(a-i),200*(i-s),t.opacity)}function lGe(t,e,r,n){return arguments.length===1?Ece(t):new qc(t,e,r,n??1)}function qc(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}jk(qc,lGe,rR(tg,{brighter(t){return new qc(this.l+lA*(t??1),this.a,this.b,this.opacity)},darker(t){return new qc(this.l-lA*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=Tce*IM(e),t=wce*IM(t),r=Cce*IM(r),new hs(NM(3.1338561*e-1.6168667*t-.4906146*r),NM(-.9787684*e+1.9161415*t+.033454*r),NM(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function MM(t){return t>oGe?Math.pow(t,1/3):t/Sce+kce}function IM(t){return t>hy?t*t*t:Sce*(t-kce)}function NM(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function DM(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function cGe(t){if(t instanceof Zu)return new Zu(t.h,t.c,t.l,t.opacity);if(t instanceof qc||(t=Ece(t)),t.a===0&&t.b===0)return new Zu(NaN,0()=>t;function _ce(t,e){return function(r){return t+r*e}}function uGe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function hGe(t,e){var r=e-t;return r?_ce(t,r>180||r<-180?r-360*Math.round(r/360):r):nR(isNaN(t)?e:t)}function dGe(t){return(t=+t)==1?$w:function(e,r){return r-e?uGe(e,r,t):nR(isNaN(e)?r:e)}}function $w(t,e){var r=e-t;return r?_ce(t,r):nR(isNaN(t)?e:t)}const cA=(function t(e){var r=dGe(e);function n(i,a){var s=r((i=tO(i)).r,(a=tO(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=$w(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n})(1);function fGe(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;ir&&(a=e.slice(r,a),o[s]?o[s]+=a:o[++s]=a),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:Bl(n,i)})),r=OM.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:Bl(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:Bl(u,h)}):h&&d.push(i(d)+"skewX("+h+n)}function l(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:Bl(u,d)},{i:m-2,x:Bl(h,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=t(u),h=t(h),a(u.translateX,u.translateY,h.translateX,h.translateY,d,f),s(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var g=-1,m=f.length,y;++g=0&&t._call.call(void 0,e),t=t._next;--Cb}function Fj(){R0=(hA=AC.now())+iR,Cb=WT=0;try{_Ge()}finally{Cb=0,LGe(),R0=0}}function RGe(){var t=AC.now(),e=t-hA;e>Ice&&(iR-=e,hA=t)}function LGe(){for(var t,e=uA,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:uA=r);HT=t,aO(n)}function aO(t){if(!Cb){WT&&(WT=clearTimeout(WT));var e=t-R0;e>24?(t<1/0&&(WT=setTimeout(Fj,t-AC.now()-iR)),eT&&(eT=clearInterval(eT))):(eT||(hA=AC.now(),eT=setInterval(RGe,Ice)),Cb=1,Nce(Fj))}}function zj(t,e,r){var n=new dA;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var MGe=sce("start","end","cancel","interrupt"),IGe=[],Oce=0,Vj=1,sO=2,q4=3,Gj=4,oO=5,U4=6;function aR(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;NGe(t,r,{name:e,index:n,group:i,on:MGe,tween:IGe,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Oce})}function Pz(t,e){var r=dc(t,e);if(r.state>Oce)throw new Error("too late; already scheduled");return r}function ou(t,e){var r=dc(t,e);if(r.state>q4)throw new Error("too late; already running");return r}function dc(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function NGe(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=Dce(a,0,r.time);function a(u){r.state=Vj,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var h,d,f,p;if(r.state!==Vj)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===q4)return zj(s);p.state===Gj?(p.state=U4,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hsO&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function uWe(t,e,r){var n,i,a=cWe(e)?Pz:ou;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function hWe(t,e){var r=this._id;return arguments.length<2?dc(this.node(),r).on.on(t):this.each(uWe(r,t,e))}function dWe(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function fWe(){return this.on("end.remove",dWe(this._id))}function pWe(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Nz(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Fce;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;isp)if(!(Math.abs(d*l-u*h)>sp)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-s,g=i-o,m=l*l+u*u,y=p*p+g*g,v=Math.sqrt(m),T=Math.sqrt(f),b=a*Math.tan((lO-Math.acos((m+f-y)/(2*v*T)))/2),w=b/T,C=b/v;Math.abs(w-1)>sp&&this._append`L${e+w*h},${r+w*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+C*l},${this._y1=r+C*u}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=e+o,h=r+l,d=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>sp||Math.abs(this._y1-h)>sp)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%cO+cO),f>FWe?this._append`A${n},${n},0,1,${d},${e-o},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>sp&&this._append`A${n},${n},0,${+(f>=lO)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function GWe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function fA(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function kb(t){return t=fA(Math.abs(t)),t?t[1]:NaN}function WWe(t,e){return function(r,n){for(var i=r.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function HWe(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var qWe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function pA(t){if(!(e=qWe.exec(t)))throw new Error("invalid format: "+t);var e;return new Fz({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}pA.prototype=Fz.prototype;function Fz(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Fz.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function UWe(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var gA;function YWe(t,e){var r=fA(t,e);if(!r)return gA=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(gA=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+fA(t,Math.max(0,e+a-1))[0]}function Wj(t,e){var r=fA(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const Hj={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:GWe,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Wj(t*100,e),r:Wj,s:YWe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function qj(t){return t}var Uj=Array.prototype.map,Yj=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function XWe(t){var e=t.grouping===void 0||t.thousands===void 0?qj:WWe(Uj.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?qj:HWe(Uj.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=pA(d);var p=d.fill,g=d.align,m=d.sign,y=d.symbol,v=d.zero,T=d.width,b=d.comma,w=d.precision,C=d.trim,S=d.type;S==="n"?(b=!0,S="g"):Hj[S]||(w===void 0&&(w=12),C=!0,S="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var k=(f&&f.prefix!==void 0?f.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),E=(y==="$"?n:/[%p]/.test(S)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),_=Hj[S],M=/[defgprs%]/.test(S);w=w===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function L(P){var D=k,R=E,I,$,O;if(S==="c")R=_(P)+R,P="";else{P=+P;var N=P<0||1/P<0;if(P=isNaN(P)?l:_(Math.abs(P),w),C&&(P=UWe(P)),N&&+P==0&&m!=="+"&&(N=!1),D=(N?m==="("?m:o:m==="-"||m==="("?"":m)+D,R=(S==="s"&&!isNaN(P)&&gA!==void 0?Yj[8+gA/3]:"")+R+(N&&m==="("?")":""),M){for(I=-1,$=P.length;++I<$;)if(O=P.charCodeAt(I),48>O||O>57){R=(O===46?i+P.slice(I+1):P.slice(I))+R,P=P.slice(0,I);break}}}b&&!v&&(P=e(P,1/0));var F=D.length+P.length+R.length,z=F>1)+D+P+R+z.slice(F);break;default:P=z+D+P+R;break}return a(P)}return L.toString=function(){return d+""},L}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(kb(f)/3)))*3,g=Math.pow(10,-p),m=u((d=pA(d),d.type="f",d),{suffix:Yj[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var TE,Cp,zce;jWe({thousands:",",grouping:[3],currency:["$",""]});function jWe(t){return TE=XWe(t),Cp=TE.format,zce=TE.formatPrefix,TE}function KWe(t){return Math.max(0,-kb(Math.abs(t)))}function ZWe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(kb(e)/3)))*3-kb(Math.abs(t)))}function QWe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,kb(e)-kb(t))+1}function JWe(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function eHe(){return this.eachAfter(JWe)}function tHe(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function rHe(t,e){for(var r=this,n=[r],i,a,s=-1;r=n.pop();)if(t.call(e,r,++s,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function nHe(t,e){for(var r=this,n=[r],i=[],a,s,o,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(s=0,o=a.length;s=0;)r+=n[i].value;e.value=r})}function sHe(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function oHe(t){for(var e=this,r=lHe(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function lHe(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function cHe(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function uHe(){return Array.from(this)}function hHe(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function dHe(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*fHe(){var t=this,e,r=[t],n,i,a;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,a=n.length;i=0;--o)i.push(a=s[o]=new mA(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(vHe)}function pHe(){return zz(this).eachBefore(yHe)}function gHe(t){return t.children}function mHe(t){return Array.isArray(t)?t[1]:null}function yHe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function vHe(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function mA(t){this.data=t,this.depth=this.height=0,this.parent=null}mA.prototype=zz.prototype={constructor:mA,count:eHe,each:tHe,eachAfter:nHe,eachBefore:rHe,find:iHe,sum:aHe,sort:sHe,path:oHe,ancestors:cHe,descendants:uHe,leaves:hHe,links:dHe,copy:pHe,[Symbol.iterator]:fHe};function bHe(t){if(typeof t!="function")throw new Error;return t}function tT(){return 0}function rT(t){return function(){return t}}function xHe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function THe(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++oT&&(T=u),S=y*y*C,b=Math.max(T/S,S/v),b>w){y-=u;break}w=b}s.push(l={value:y,dice:p1?n:1)},r})(CHe);function EHe(){var t=SHe,e=!1,r=1,n=1,i=[0],a=tT,s=tT,o=tT,l=tT,u=tT;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(xHe),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,y=f.x1-p,v=f.y1-p;ye&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function LHe(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?MHe:LHe,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(l||(l=o(t.map(n),e,r)))(n(s(f)))}return d.invert=function(f){return s(i((u||(u=o(e,t.map(n),Bl)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,_He),h()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),r=xGe,h()},d.clamp=function(f){return arguments.length?(s=f?!0:Wm,h()):s!==Wm},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(a=f,d):a},function(f,p){return n=f,i=p,h()}}function Gce(){return IHe()(Wm,Wm)}function NHe(t,e,r,n){var i=QD(t,e,r),a;switch(n=pA(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=ZWe(i,s))&&(n.precision=a),zce(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=QWe(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=KWe(i))&&(n.precision=a-(n.type==="%")*2);break}}return Cp(n)}function DHe(t){var e=t.domain;return t.ticks=function(r){var n=e();return tze(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return NHe(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,s=n[i],o=n[a],l,u,h=10;for(o0;){if(u=ZD(s,o,r),u===l)return n[i]=s,n[a]=o,e(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function Sb(){var t=Gce();return t.copy=function(){return Vce(t,Sb())},sR.apply(t,arguments),DHe(t)}function OHe(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a0))return l;let u;do l.push(u=new Date(+a)),e(a,o),t(a);while(uua(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!a(s););else for(;--o>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>($M.setTime(+a),PM.setTime(+s),t($M),t(PM),Math.floor(r($M,PM))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Eb=ua(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Eb.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ua(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):Eb);Eb.range;const Qu=1e3,hl=Qu*60,Ju=hl*60,mh=Ju*24,Vz=mh*7,Kj=mh*30,BM=mh*365,_d=ua(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Qu)},(t,e)=>(e-t)/Qu,t=>t.getUTCSeconds());_d.range;const _C=ua(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Qu)},(t,e)=>{t.setTime(+t+e*hl)},(t,e)=>(e-t)/hl,t=>t.getMinutes());_C.range;const $He=ua(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*hl)},(t,e)=>(e-t)/hl,t=>t.getUTCMinutes());$He.range;const RC=ua(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Qu-t.getMinutes()*hl)},(t,e)=>{t.setTime(+t+e*Ju)},(t,e)=>(e-t)/Ju,t=>t.getHours());RC.range;const PHe=ua(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Ju)},(t,e)=>(e-t)/Ju,t=>t.getUTCHours());PHe.range;const L0=ua(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*hl)/mh,t=>t.getDate()-1);L0.range;const Gz=ua(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/mh,t=>t.getUTCDate()-1);Gz.range;const BHe=ua(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/mh,t=>Math.floor(t/mh));BHe.range;function rg(t){return ua(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*hl)/Vz)}const Kk=rg(0),LC=rg(1),Wce=rg(2),Hce=rg(3),M0=rg(4),qce=rg(5),Uce=rg(6);Kk.range;LC.range;Wce.range;Hce.range;M0.range;qce.range;Uce.range;function ng(t){return ua(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/Vz)}const Yce=ng(0),yA=ng(1),FHe=ng(2),zHe=ng(3),Ab=ng(4),VHe=ng(5),GHe=ng(6);Yce.range;yA.range;FHe.range;zHe.range;Ab.range;VHe.range;GHe.range;const MC=ua(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());MC.range;const WHe=ua(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());WHe.range;const yh=ua(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());yh.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ua(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});yh.range;const I0=ua(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());I0.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ua(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});I0.range;function HHe(t,e,r,n,i,a){const s=[[_d,1,Qu],[_d,5,5*Qu],[_d,15,15*Qu],[_d,30,30*Qu],[a,1,hl],[a,5,5*hl],[a,15,15*hl],[a,30,30*hl],[i,1,Ju],[i,3,3*Ju],[i,6,6*Ju],[i,12,12*Ju],[n,1,mh],[n,2,2*mh],[r,1,Vz],[e,1,Kj],[e,3,3*Kj],[t,1,BM]];function o(u,h,d){const f=hy).right(s,f);if(p===s.length)return t.every(QD(u/BM,h/BM,d));if(p===0)return Eb.every(Math.max(QD(u,h,d),1));const[g,m]=s[f/s[p-1][2]53)return null;"w"in J||(J.w=1),"Z"in J?(ee=zM(nT(J.y,0,1)),Re=ee.getUTCDay(),ee=Re>4||Re===0?yA.ceil(ee):yA(ee),ee=Gz.offset(ee,(J.V-1)*7),J.y=ee.getUTCFullYear(),J.m=ee.getUTCMonth(),J.d=ee.getUTCDate()+(J.w+6)%7):(ee=FM(nT(J.y,0,1)),Re=ee.getDay(),ee=Re>4||Re===0?LC.ceil(ee):LC(ee),ee=L0.offset(ee,(J.V-1)*7),J.y=ee.getFullYear(),J.m=ee.getMonth(),J.d=ee.getDate()+(J.w+6)%7)}else("W"in J||"U"in J)&&("w"in J||(J.w="u"in J?J.u%7:"W"in J?1:0),Re="Z"in J?zM(nT(J.y,0,1)).getUTCDay():FM(nT(J.y,0,1)).getDay(),J.m=0,J.d="W"in J?(J.w+6)%7+J.W*7-(Re+5)%7:J.w+J.U*7-(Re+6)%7);return"Z"in J?(J.H+=J.Z/100|0,J.M+=J.Z%100,zM(J)):FM(J)}}function E(K,Q,te,J){for(var ge=0,ee=Q.length,Re=te.length,Ie,Be;ge=Re)return-1;if(Ie=Q.charCodeAt(ge++),Ie===37){if(Ie=Q.charAt(ge++),Be=C[Ie in Zj?Q.charAt(ge++):Ie],!Be||(J=Be(K,te,J))<0)return-1}else if(Ie!=te.charCodeAt(J++))return-1}return J}function _(K,Q,te){var J=u.exec(Q.slice(te));return J?(K.p=h.get(J[0].toLowerCase()),te+J[0].length):-1}function M(K,Q,te){var J=p.exec(Q.slice(te));return J?(K.w=g.get(J[0].toLowerCase()),te+J[0].length):-1}function L(K,Q,te){var J=d.exec(Q.slice(te));return J?(K.w=f.get(J[0].toLowerCase()),te+J[0].length):-1}function P(K,Q,te){var J=v.exec(Q.slice(te));return J?(K.m=T.get(J[0].toLowerCase()),te+J[0].length):-1}function D(K,Q,te){var J=m.exec(Q.slice(te));return J?(K.m=y.get(J[0].toLowerCase()),te+J[0].length):-1}function R(K,Q,te){return E(K,e,Q,te)}function I(K,Q,te){return E(K,r,Q,te)}function $(K,Q,te){return E(K,n,Q,te)}function O(K){return s[K.getDay()]}function N(K){return a[K.getDay()]}function F(K){return l[K.getMonth()]}function z(K){return o[K.getMonth()]}function V(K){return i[+(K.getHours()>=12)]}function B(K){return 1+~~(K.getMonth()/3)}function G(K){return s[K.getUTCDay()]}function H(K){return a[K.getUTCDay()]}function q(K){return l[K.getUTCMonth()]}function Z(K){return o[K.getUTCMonth()]}function Y(K){return i[+(K.getUTCHours()>=12)]}function ie(K){return 1+~~(K.getUTCMonth()/3)}return{format:function(K){var Q=S(K+="",b);return Q.toString=function(){return K},Q},parse:function(K){var Q=k(K+="",!1);return Q.toString=function(){return K},Q},utcFormat:function(K){var Q=S(K+="",w);return Q.toString=function(){return K},Q},utcParse:function(K){var Q=k(K+="",!0);return Q.toString=function(){return K},Q}}}var Zj={"-":"",_:" ",0:"0"},_a=/^\s*\d+/,XHe=/^%/,jHe=/[\\^$*+?|[\]().{}]/g;function fn(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function ZHe(t,e,r){var n=_a.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function QHe(t,e,r){var n=_a.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function JHe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function eqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function tqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Qj(t,e,r){var n=_a.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Jj(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function rqe(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function nqe(t,e,r){var n=_a.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function iqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function eK(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function aqe(t,e,r){var n=_a.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function tK(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function sqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function oqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function lqe(t,e,r){var n=_a.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function cqe(t,e,r){var n=_a.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function uqe(t,e,r){var n=XHe.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function hqe(t,e,r){var n=_a.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function dqe(t,e,r){var n=_a.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function rK(t,e){return fn(t.getDate(),e,2)}function fqe(t,e){return fn(t.getHours(),e,2)}function pqe(t,e){return fn(t.getHours()%12||12,e,2)}function gqe(t,e){return fn(1+L0.count(yh(t),t),e,3)}function Xce(t,e){return fn(t.getMilliseconds(),e,3)}function mqe(t,e){return Xce(t,e)+"000"}function yqe(t,e){return fn(t.getMonth()+1,e,2)}function vqe(t,e){return fn(t.getMinutes(),e,2)}function bqe(t,e){return fn(t.getSeconds(),e,2)}function xqe(t){var e=t.getDay();return e===0?7:e}function Tqe(t,e){return fn(Kk.count(yh(t)-1,t),e,2)}function jce(t){var e=t.getDay();return e>=4||e===0?M0(t):M0.ceil(t)}function wqe(t,e){return t=jce(t),fn(M0.count(yh(t),t)+(yh(t).getDay()===4),e,2)}function Cqe(t){return t.getDay()}function kqe(t,e){return fn(LC.count(yh(t)-1,t),e,2)}function Sqe(t,e){return fn(t.getFullYear()%100,e,2)}function Eqe(t,e){return t=jce(t),fn(t.getFullYear()%100,e,2)}function Aqe(t,e){return fn(t.getFullYear()%1e4,e,4)}function _qe(t,e){var r=t.getDay();return t=r>=4||r===0?M0(t):M0.ceil(t),fn(t.getFullYear()%1e4,e,4)}function Rqe(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+fn(e/60|0,"0",2)+fn(e%60,"0",2)}function nK(t,e){return fn(t.getUTCDate(),e,2)}function Lqe(t,e){return fn(t.getUTCHours(),e,2)}function Mqe(t,e){return fn(t.getUTCHours()%12||12,e,2)}function Iqe(t,e){return fn(1+Gz.count(I0(t),t),e,3)}function Kce(t,e){return fn(t.getUTCMilliseconds(),e,3)}function Nqe(t,e){return Kce(t,e)+"000"}function Dqe(t,e){return fn(t.getUTCMonth()+1,e,2)}function Oqe(t,e){return fn(t.getUTCMinutes(),e,2)}function $qe(t,e){return fn(t.getUTCSeconds(),e,2)}function Pqe(t){var e=t.getUTCDay();return e===0?7:e}function Bqe(t,e){return fn(Yce.count(I0(t)-1,t),e,2)}function Zce(t){var e=t.getUTCDay();return e>=4||e===0?Ab(t):Ab.ceil(t)}function Fqe(t,e){return t=Zce(t),fn(Ab.count(I0(t),t)+(I0(t).getUTCDay()===4),e,2)}function zqe(t){return t.getUTCDay()}function Vqe(t,e){return fn(yA.count(I0(t)-1,t),e,2)}function Gqe(t,e){return fn(t.getUTCFullYear()%100,e,2)}function Wqe(t,e){return t=Zce(t),fn(t.getUTCFullYear()%100,e,2)}function Hqe(t,e){return fn(t.getUTCFullYear()%1e4,e,4)}function qqe(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Ab(t):Ab.ceil(t),fn(t.getUTCFullYear()%1e4,e,4)}function Uqe(){return"+0000"}function iK(){return"%"}function aK(t){return+t}function sK(t){return Math.floor(+t/1e3)}var Hg,vA;Yqe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Yqe(t){return Hg=YHe(t),vA=Hg.format,Hg.parse,Hg.utcFormat,Hg.utcParse,Hg}function Xqe(t){return new Date(t)}function jqe(t){return t instanceof Date?+t:+new Date(+t)}function Qce(t,e,r,n,i,a,s,o,l,u){var h=Gce(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),T=u("%b %d"),b=u("%B"),w=u("%Y");function C(S){return(l(S)1?0:t<-1?IC:Math.acos(t)}function lK(t){return t>=1?bA:t<=-1?-bA:Math.asin(t)}function Jce(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new VWe(e)}function tUe(t){return t.innerRadius}function rUe(t){return t.outerRadius}function nUe(t){return t.startAngle}function iUe(t){return t.endAngle}function aUe(t){return t&&t.padAngle}function sUe(t,e,r,n,i,a,s,o){var l=r-t,u=n-e,h=s-i,d=o-a,f=d*l-h*u;if(!(f*fR*R+I*I&&(E=M,_=L),{cx:E,cy:_,x01:-h,y01:-d,x11:E*(i/C-1),y11:_*(i/C-1)}}function _b(){var t=tUe,e=rUe,r=Mi(0),n=null,i=nUe,a=iUe,s=aUe,o=null,l=Jce(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-bA,m=a.apply(this,arguments)-bA,y=oK(m-g),v=m>g;if(o||(o=h=l()),pls))o.moveTo(0,0);else if(y>Y4-ls)o.moveTo(p*Wf(g),p*mc(g)),o.arc(0,0,p,g,m,!v),f>ls&&(o.moveTo(f*Wf(m),f*mc(m)),o.arc(0,0,f,m,g,v));else{var T=g,b=m,w=g,C=m,S=y,k=y,E=s.apply(this,arguments)/2,_=E>ls&&(n?+n.apply(this,arguments):Hm(f*f+p*p)),M=VM(oK(p-f)/2,+r.apply(this,arguments)),L=M,P=M,D,R;if(_>ls){var I=lK(_/f*mc(E)),$=lK(_/p*mc(E));(S-=I*2)>ls?(I*=v?1:-1,w+=I,C-=I):(S=0,w=C=(g+m)/2),(k-=$*2)>ls?($*=v?1:-1,T+=$,b-=$):(k=0,T=b=(g+m)/2)}var O=p*Wf(T),N=p*mc(T),F=f*Wf(C),z=f*mc(C);if(M>ls){var V=p*Wf(b),B=p*mc(b),G=f*Wf(w),H=f*mc(w),q;if(yls?P>ls?(D=wE(G,H,O,N,p,P,v),R=wE(V,B,F,z,p,P,v),o.moveTo(D.cx+D.x01,D.cy+D.y01),Pls)||!(S>ls)?o.lineTo(F,z):L>ls?(D=wE(F,z,V,B,f,-L,v),R=wE(O,N,G,H,f,-L,v),o.lineTo(D.cx+D.x01,D.cy+D.y01),Lt?1:e>=t?0:NaN}function uUe(t){return t}function hUe(){var t=uUe,e=cUe,r=null,n=Mi(0),i=Mi(Y4),a=Mi(0);function s(o){var l,u=(o=eue(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(Y4,Math.max(-Y4,i.apply(this,arguments)-m)),v,T=Math.min(Math.abs(y)/u,a.apply(this,arguments)),b=T*(y<0?-1:1),w;for(l=0;l0&&(f+=w);for(e!=null?p.sort(function(C,S){return e(g[C],g[S])}):r!=null&&p.sort(function(C,S){return r(o[C],o[S])}),l=0,d=f?(y-u*b)/f:0;l0?w*d:0)+b,g[h]={data:o[h],index:l,value:w,startAngle:m,endAngle:v,padAngle:T};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:Mi(+o),s):t},s.sortValues=function(o){return arguments.length?(e=o,r=null,s):e},s.sort=function(o){return arguments.length?(r=o,e=null,s):r},s.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:Mi(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Mi(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:Mi(+o),s):a},s}class rue{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function nue(t){return new rue(t,!0)}function iue(t){return new rue(t,!1)}function Jd(){}function xA(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function oR(t){this._context=t}oR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:xA(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:xA(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function DC(t){return new oR(t)}function aue(t){this._context=t}aue.prototype={areaStart:Jd,areaEnd:Jd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:xA(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function dUe(t){return new aue(t)}function sue(t){this._context=t}sue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:xA(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function fUe(t){return new sue(t)}function oue(t,e){this._basis=new oR(t),this._beta=e}oue.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],a=t[r]-n,s=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*a),this._beta*e[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const pUe=(function t(e){function r(n){return e===1?new oR(n):new oue(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function TA(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function Wz(t,e){this._context=t,this._k=(1-e)/6}Wz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:TA(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:TA(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const lue=(function t(e){function r(n){return new Wz(n,e)}return r.tension=function(n){return t(+n)},r})(0);function Hz(t,e){this._context=t,this._k=(1-e)/6}Hz.prototype={areaStart:Jd,areaEnd:Jd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:TA(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const gUe=(function t(e){function r(n){return new Hz(n,e)}return r.tension=function(n){return t(+n)},r})(0);function qz(t,e){this._context=t,this._k=(1-e)/6}qz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:TA(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const mUe=(function t(e){function r(n){return new qz(n,e)}return r.tension=function(n){return t(+n)},r})(0);function Uz(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>ls){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>ls){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function cue(t,e){this._context=t,this._alpha=e}cue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Uz(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const uue=(function t(e){function r(n){return e?new cue(n,e):new Wz(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function hue(t,e){this._context=t,this._alpha=e}hue.prototype={areaStart:Jd,areaEnd:Jd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Uz(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const yUe=(function t(e){function r(n){return e?new hue(n,e):new Hz(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function due(t,e){this._context=t,this._alpha=e}due.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Uz(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const vUe=(function t(e){function r(n){return e?new due(n,e):new qz(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function fue(t){this._context=t}fue.prototype={areaStart:Jd,areaEnd:Jd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function bUe(t){return new fue(t)}function cK(t){return t<0?-1:1}function uK(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return(cK(a)+cK(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function hK(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function GM(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-n)/3;t._context.bezierCurveTo(n+o,i+o*e,a-o,s-o*r,a,s)}function wA(t){this._context=t}wA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:GM(this,this._t0,hK(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,GM(this,hK(this,r=uK(this,t,e)),r);break;default:GM(this,this._t0,r=uK(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function pue(t){this._context=new gue(t)}(pue.prototype=Object.create(wA.prototype)).point=function(t,e){wA.prototype.point.call(this,e,t)};function gue(t){this._context=t}gue.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function mue(t){return new wA(t)}function yue(t){return new pue(t)}function vue(t){this._context=t}vue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=dK(t),i=dK(e),a=0,s=1;s=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function xue(t){return new lR(t,.5)}function Tue(t){return new lR(t,0)}function wue(t){return new lR(t,1)}function qT(t,e,r){this.k=t,this.x=e,this.y=r}qT.prototype={constructor:qT,scale:function(t){return t===1?this:new qT(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new qT(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};qT.prototype;var xs=x(t=>{var i;const{securityLevel:e}=Fe();let r=ut("body");if(e==="sandbox"){const s=((i=ut(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=ut(s.body)}return r.select(`#${t}`)},"selectSvgElement");function Yz(t){return typeof t>"u"||t===null}x(Yz,"isNothing");function Cue(t){return typeof t=="object"&&t!==null}x(Cue,"isObject");function kue(t){return Array.isArray(t)?t:Yz(t)?[]:[t]}x(kue,"toArray");function Sue(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;r{e!==void 0&&(V4[t]=e)},"addStylesForDiagram"),VFe=FFe,Sz={};Z6(Sz,{clear:()=>$n,getAccDescription:()=>ai,getAccTitle:()=>ni,getDiagramTitle:()=>Yn,setAccDescription:()=>ii,setAccTitle:()=>Hn,setDiagramTitle:()=>ti});var Ez="",Az="",_z="",Rz=x(t=>Wr(t,Xt()),"sanitizeText"),$n=x(()=>{Ez="",_z="",Az=""},"clear"),Hn=x(t=>{Ez=Rz(t).replace(/^\s+/g,"")},"setAccTitle"),ni=x(()=>Ez,"getAccTitle"),ii=x(t=>{_z=Rz(t).replace(/\n\s+/g,` +`)},"setAccDescription"),ai=x(()=>_z,"getAccDescription"),ti=x(t=>{Az=Rz(t)},"setDiagramTitle"),Yn=x(()=>Az,"getDiagramTitle"),kj=le,GFe=Tz,Fe=Xt,jD=jle,ace=Tb,Lz=x(t=>Wr(t,Fe()),"sanitizeText"),Mz=mx,WFe=x(()=>Sz,"getCommonDb"),rA={},nA=x((t,e,r)=>{var n;rA[t]&&kj.warn(`Diagram with id ${t} already registered. Overwriting.`),rA[t]=e,r&&tce(t,r),zFe(t,e.styles),(n=e.injectUtils)==null||n.call(e,kj,GFe,Fe,Lz,Mz,WFe(),()=>{})},"registerDiagram"),KD=x(t=>{if(t in rA)return rA[t];throw new HFe(t)},"getDiagram"),Wy,HFe=(Wy=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},x(Wy,"DiagramNotFoundError"),Wy);function G4(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function qFe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function Iz(t){let e,r,n;t.length!==2?(e=G4,r=(o,l)=>G4(t(o),l),n=(o,l)=>t(o)-l):(e=t===G4||t===qFe?t:UFe,r=t,n=t);function i(o,l,u=0,h=o.length){if(u>>1;r(o[d],l)<0?u=d+1:h=d}while(u>>1;r(o[d],l)<=0?u=d+1:h=d}while(uu&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function UFe(){return 0}function YFe(t){return t===null?NaN:+t}const XFe=Iz(G4),jFe=XFe.right;Iz(YFe).center;class Sj extends Map{constructor(e,r=QFe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(Ej(this,e))}has(e){return super.has(Ej(this,e))}set(e,r){return super.set(KFe(this,e),r)}delete(e){return super.delete(ZFe(this,e))}}function Ej({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function KFe({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function ZFe({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function QFe(t){return t!==null&&typeof t=="object"?t.valueOf():t}const JFe=Math.sqrt(50),eze=Math.sqrt(10),tze=Math.sqrt(2);function iA(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=JFe?10:a>=eze?5:a>=tze?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(t*u),l=Math.round(e*u),o/ue&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(t/u),l=Math.round(e/u),o*ue&&--l),l0))return[];if(t===e)return[t];const n=e=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let u=0;u=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function ize(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function aze(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n+t(e)}function uze(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function hze(){return!this.__axis}function sce(t,e){var r=[],n=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===W4||t===yE?-1:1,h=t===yE||t===RM?"x":"y",d=t===W4||t===JD?oze:lze;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):sze),y=Math.max(a,0)+o,v=e.range(),T=+v[0]+l,b=+v[v.length-1]+l,w=(e.bandwidth?uze:cze)(e.copy(),l),C=p.selection?p.selection():p,S=C.selectAll(".domain").data([null]),k=C.selectAll(".tick").data(g,e).order(),E=k.exit(),_=k.enter().append("g").attr("class","tick"),M=k.select("line"),L=k.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(_),M=M.merge(_.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),L=L.merge(_.append("text").attr("fill","currentColor").attr(h,u*y).attr("dy",t===W4?"0em":t===JD?"0.71em":"0.32em")),p!==C&&(S=S.transition(p),k=k.transition(p),M=M.transition(p),L=L.transition(p),E=E.transition(p).attr("opacity",Aj).attr("transform",function(P){return isFinite(P=w(P))?d(P+l):this.getAttribute("transform")}),_.attr("opacity",Aj).attr("transform",function(P){var D=this.parentNode.__axis;return d((D&&isFinite(D=D(P))?D:w(P))+l)})),E.remove(),S.attr("d",t===yE||t===RM?s?"M"+u*s+","+T+"H"+l+"V"+b+"H"+u*s:"M"+l+","+T+"V"+b:s?"M"+T+","+u*s+"V"+l+"H"+b+"V"+u*s:"M"+T+","+l+"H"+b),k.attr("opacity",1).attr("transform",function(P){return d(w(P)+l)}),M.attr(h+"2",u*a),L.attr(h,u*y).text(m),C.filter(hze).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===RM?"start":t===yE?"end":"middle"),C.each(function(){this.__axis=w})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(a=s=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(s=+p,f):s},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function dze(t){return sce(W4,t)}function fze(t){return sce(JD,t)}var pze={value:()=>{}};function oce(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}H4.prototype=oce.prototype={constructor:H4,on:function(t,e){var r=this._,n=gze(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),Rj.hasOwnProperty(e)?{space:Rj[e],local:t}:t}function yze(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===eO&&e.documentElement.namespaceURI===eO?e.createElement(t):e.createElementNS(r,t)}}function vze(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function lce(t){var e=tR(t);return(e.local?vze:yze)(e)}function bze(){}function Nz(t){return t==null?bze:function(){return this.querySelector(t)}}function xze(t){typeof t!="function"&&(t=Nz(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=b&&(b=T+1);!(C=y[b])&&++b=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function qze(t){t||(t=Uze);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}function Yze(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Xze(){return Array.from(this)}function jze(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?sVe:typeof e=="function"?lVe:oVe)(t,e,r??"")):wb(this.node(),t)}function wb(t,e){return t.style.getPropertyValue(e)||fce(t).getComputedStyle(t,null).getPropertyValue(e)}function uVe(t){return function(){delete this[t]}}function hVe(t,e){return function(){this[t]=e}}function dVe(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function fVe(t,e){return arguments.length>1?this.each((e==null?uVe:typeof e=="function"?dVe:hVe)(t,e)):this.node()[t]}function pce(t){return t.trim().split(/^|\s+/)}function Dz(t){return t.classList||new gce(t)}function gce(t){this._node=t,this._names=pce(t.getAttribute("class")||"")}gce.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function mce(t,e){for(var r=Dz(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function VVe(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?vE(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?vE(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=KVe.exec(t))?new hs(e[1],e[2],e[3],1):(e=ZVe.exec(t))?new hs(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=QVe.exec(t))?vE(e[1],e[2],e[3],e[4]):(e=JVe.exec(t))?vE(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=eGe.exec(t))?$j(e[1],e[2]/100,e[3]/100,1):(e=tGe.exec(t))?$j(e[1],e[2]/100,e[3]/100,e[4]):Lj.hasOwnProperty(t)?Nj(Lj[t]):t==="transparent"?new hs(NaN,NaN,NaN,0):null}function Nj(t){return new hs(t>>16&255,t>>8&255,t&255,1)}function vE(t,e,r,n){return n<=0&&(t=e=r=NaN),new hs(t,e,r,n)}function xce(t){return t instanceof tg||(t=_0(t)),t?(t=t.rgb(),new hs(t.r,t.g,t.b,t.opacity)):new hs}function tO(t,e,r,n){return arguments.length===1?xce(t):new hs(t,e,r,n??1)}function hs(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}jk(hs,tO,rR(tg,{brighter(t){return t=t==null?sA:Math.pow(sA,t),new hs(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?SC:Math.pow(SC,t),new hs(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new hs(u0(this.r),u0(this.g),u0(this.b),oA(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Dj,formatHex:Dj,formatHex8:iGe,formatRgb:Oj,toString:Oj}));function Dj(){return`#${jp(this.r)}${jp(this.g)}${jp(this.b)}`}function iGe(){return`#${jp(this.r)}${jp(this.g)}${jp(this.b)}${jp((isNaN(this.opacity)?1:this.opacity)*255)}`}function Oj(){const t=oA(this.opacity);return`${t===1?"rgb(":"rgba("}${u0(this.r)}, ${u0(this.g)}, ${u0(this.b)}${t===1?")":`, ${t})`}`}function oA(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function u0(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function jp(t){return t=u0(t),(t<16?"0":"")+t.toString(16)}function $j(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Wl(t,e,r,n)}function Tce(t){if(t instanceof Wl)return new Wl(t.h,t.s,t.l,t.opacity);if(t instanceof tg||(t=_0(t)),!t)return new Wl;if(t instanceof Wl)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(e===a?s=(r-n)/o+(r0&&l<1?0:s,new Wl(s,o,l,t.opacity)}function aGe(t,e,r,n){return arguments.length===1?Tce(t):new Wl(t,e,r,n??1)}function Wl(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}jk(Wl,aGe,rR(tg,{brighter(t){return t=t==null?sA:Math.pow(sA,t),new Wl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?SC:Math.pow(SC,t),new Wl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new hs(LM(t>=240?t-240:t+120,i,n),LM(t,i,n),LM(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Wl(Pj(this.h),bE(this.s),bE(this.l),oA(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=oA(this.opacity);return`${t===1?"hsl(":"hsla("}${Pj(this.h)}, ${bE(this.s)*100}%, ${bE(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Pj(t){return t=(t||0)%360,t<0?t+360:t}function bE(t){return Math.max(0,Math.min(1,t||0))}function LM(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const sGe=Math.PI/180,oGe=180/Math.PI,lA=18,wce=.96422,Cce=1,kce=.82521,Sce=4/29,hy=6/29,Ece=3*hy*hy,lGe=hy*hy*hy;function Ace(t){if(t instanceof qc)return new qc(t.l,t.a,t.b,t.opacity);if(t instanceof Zu)return _ce(t);t instanceof hs||(t=xce(t));var e=DM(t.r),r=DM(t.g),n=DM(t.b),i=MM((.2225045*e+.7168786*r+.0606169*n)/Cce),a,s;return e===r&&r===n?a=s=i:(a=MM((.4360747*e+.3850649*r+.1430804*n)/wce),s=MM((.0139322*e+.0971045*r+.7141733*n)/kce)),new qc(116*i-16,500*(a-i),200*(i-s),t.opacity)}function cGe(t,e,r,n){return arguments.length===1?Ace(t):new qc(t,e,r,n??1)}function qc(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}jk(qc,cGe,rR(tg,{brighter(t){return new qc(this.l+lA*(t??1),this.a,this.b,this.opacity)},darker(t){return new qc(this.l-lA*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=wce*IM(e),t=Cce*IM(t),r=kce*IM(r),new hs(NM(3.1338561*e-1.6168667*t-.4906146*r),NM(-.9787684*e+1.9161415*t+.033454*r),NM(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function MM(t){return t>lGe?Math.pow(t,1/3):t/Ece+Sce}function IM(t){return t>hy?t*t*t:Ece*(t-Sce)}function NM(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function DM(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function uGe(t){if(t instanceof Zu)return new Zu(t.h,t.c,t.l,t.opacity);if(t instanceof qc||(t=Ace(t)),t.a===0&&t.b===0)return new Zu(NaN,0()=>t;function Rce(t,e){return function(r){return t+r*e}}function hGe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function dGe(t,e){var r=e-t;return r?Rce(t,r>180||r<-180?r-360*Math.round(r/360):r):nR(isNaN(t)?e:t)}function fGe(t){return(t=+t)==1?$w:function(e,r){return r-e?hGe(e,r,t):nR(isNaN(e)?r:e)}}function $w(t,e){var r=e-t;return r?Rce(t,r):nR(isNaN(t)?e:t)}const cA=(function t(e){var r=fGe(e);function n(i,a){var s=r((i=tO(i)).r,(a=tO(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=$w(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n})(1);function pGe(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;ir&&(a=e.slice(r,a),o[s]?o[s]+=a:o[++s]=a),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:Bl(n,i)})),r=OM.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:Bl(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:Bl(u,h)}):h&&d.push(i(d)+"skewX("+h+n)}function l(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:Bl(u,d)},{i:m-2,x:Bl(h,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=t(u),h=t(h),a(u.translateX,u.translateY,h.translateX,h.translateY,d,f),s(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var g=-1,m=f.length,y;++g=0&&t._call.call(void 0,e),t=t._next;--Cb}function Fj(){R0=(hA=AC.now())+iR,Cb=WT=0;try{RGe()}finally{Cb=0,MGe(),R0=0}}function LGe(){var t=AC.now(),e=t-hA;e>Nce&&(iR-=e,hA=t)}function MGe(){for(var t,e=uA,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:uA=r);HT=t,aO(n)}function aO(t){if(!Cb){WT&&(WT=clearTimeout(WT));var e=t-R0;e>24?(t<1/0&&(WT=setTimeout(Fj,t-AC.now()-iR)),eT&&(eT=clearInterval(eT))):(eT||(hA=AC.now(),eT=setInterval(LGe,Nce)),Cb=1,Dce(Fj))}}function zj(t,e,r){var n=new dA;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var IGe=oce("start","end","cancel","interrupt"),NGe=[],$ce=0,Vj=1,sO=2,q4=3,Gj=4,oO=5,U4=6;function aR(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;DGe(t,r,{name:e,index:n,group:i,on:IGe,tween:NGe,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:$ce})}function Pz(t,e){var r=dc(t,e);if(r.state>$ce)throw new Error("too late; already scheduled");return r}function ou(t,e){var r=dc(t,e);if(r.state>q4)throw new Error("too late; already running");return r}function dc(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function DGe(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=Oce(a,0,r.time);function a(u){r.state=Vj,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var h,d,f,p;if(r.state!==Vj)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===q4)return zj(s);p.state===Gj?(p.state=U4,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hsO&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function hWe(t,e,r){var n,i,a=uWe(e)?Pz:ou;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function dWe(t,e){var r=this._id;return arguments.length<2?dc(this.node(),r).on.on(t):this.each(hWe(r,t,e))}function fWe(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function pWe(){return this.on("end.remove",fWe(this._id))}function gWe(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Nz(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s=0))throw new Error(`invalid digits: ${t}`);if(e>15)return zce;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;isp)if(!(Math.abs(d*l-u*h)>sp)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-s,g=i-o,m=l*l+u*u,y=p*p+g*g,v=Math.sqrt(m),T=Math.sqrt(f),b=a*Math.tan((lO-Math.acos((m+f-y)/(2*v*T)))/2),w=b/T,C=b/v;Math.abs(w-1)>sp&&this._append`L${e+w*h},${r+w*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+C*l},${this._y1=r+C*u}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=e+o,h=r+l,d=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>sp||Math.abs(this._y1-h)>sp)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%cO+cO),f>zWe?this._append`A${n},${n},0,1,${d},${e-o},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>sp&&this._append`A${n},${n},0,${+(f>=lO)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function WWe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function fA(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function kb(t){return t=fA(Math.abs(t)),t?t[1]:NaN}function HWe(t,e){return function(r,n){for(var i=r.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function qWe(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var UWe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function pA(t){if(!(e=UWe.exec(t)))throw new Error("invalid format: "+t);var e;return new Fz({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}pA.prototype=Fz.prototype;function Fz(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Fz.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function YWe(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var gA;function XWe(t,e){var r=fA(t,e);if(!r)return gA=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(gA=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+fA(t,Math.max(0,e+a-1))[0]}function Wj(t,e){var r=fA(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const Hj={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:WWe,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Wj(t*100,e),r:Wj,s:XWe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function qj(t){return t}var Uj=Array.prototype.map,Yj=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function jWe(t){var e=t.grouping===void 0||t.thousands===void 0?qj:HWe(Uj.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?qj:qWe(Uj.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=pA(d);var p=d.fill,g=d.align,m=d.sign,y=d.symbol,v=d.zero,T=d.width,b=d.comma,w=d.precision,C=d.trim,S=d.type;S==="n"?(b=!0,S="g"):Hj[S]||(w===void 0&&(w=12),C=!0,S="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var k=(f&&f.prefix!==void 0?f.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),E=(y==="$"?n:/[%p]/.test(S)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),_=Hj[S],M=/[defgprs%]/.test(S);w=w===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function L(P){var D=k,R=E,I,$,O;if(S==="c")R=_(P)+R,P="";else{P=+P;var N=P<0||1/P<0;if(P=isNaN(P)?l:_(Math.abs(P),w),C&&(P=YWe(P)),N&&+P==0&&m!=="+"&&(N=!1),D=(N?m==="("?m:o:m==="-"||m==="("?"":m)+D,R=(S==="s"&&!isNaN(P)&&gA!==void 0?Yj[8+gA/3]:"")+R+(N&&m==="("?")":""),M){for(I=-1,$=P.length;++I<$;)if(O=P.charCodeAt(I),48>O||O>57){R=(O===46?i+P.slice(I+1):P.slice(I))+R,P=P.slice(0,I);break}}}b&&!v&&(P=e(P,1/0));var F=D.length+P.length+R.length,z=F>1)+D+P+R+z.slice(F);break;default:P=z+D+P+R;break}return a(P)}return L.toString=function(){return d+""},L}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(kb(f)/3)))*3,g=Math.pow(10,-p),m=u((d=pA(d),d.type="f",d),{suffix:Yj[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var TE,Cp,Vce;KWe({thousands:",",grouping:[3],currency:["$",""]});function KWe(t){return TE=jWe(t),Cp=TE.format,Vce=TE.formatPrefix,TE}function ZWe(t){return Math.max(0,-kb(Math.abs(t)))}function QWe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(kb(e)/3)))*3-kb(Math.abs(t)))}function JWe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,kb(e)-kb(t))+1}function eHe(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function tHe(){return this.eachAfter(eHe)}function rHe(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function nHe(t,e){for(var r=this,n=[r],i,a,s=-1;r=n.pop();)if(t.call(e,r,++s,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function iHe(t,e){for(var r=this,n=[r],i=[],a,s,o,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(s=0,o=a.length;s=0;)r+=n[i].value;e.value=r})}function oHe(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function lHe(t){for(var e=this,r=cHe(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function cHe(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function uHe(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function hHe(){return Array.from(this)}function dHe(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function fHe(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*pHe(){var t=this,e,r=[t],n,i,a;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,a=n.length;i=0;--o)i.push(a=s[o]=new mA(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(bHe)}function gHe(){return zz(this).eachBefore(vHe)}function mHe(t){return t.children}function yHe(t){return Array.isArray(t)?t[1]:null}function vHe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function bHe(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function mA(t){this.data=t,this.depth=this.height=0,this.parent=null}mA.prototype=zz.prototype={constructor:mA,count:tHe,each:rHe,eachAfter:iHe,eachBefore:nHe,find:aHe,sum:sHe,sort:oHe,path:lHe,ancestors:uHe,descendants:hHe,leaves:dHe,links:fHe,copy:gHe,[Symbol.iterator]:pHe};function xHe(t){if(typeof t!="function")throw new Error;return t}function tT(){return 0}function rT(t){return function(){return t}}function THe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function wHe(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++oT&&(T=u),S=y*y*C,b=Math.max(T/S,S/v),b>w){y-=u;break}w=b}s.push(l={value:y,dice:p1?n:1)},r})(kHe);function AHe(){var t=EHe,e=!1,r=1,n=1,i=[0],a=tT,s=tT,o=tT,l=tT,u=tT;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(THe),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,y=f.x1-p,v=f.y1-p;ye&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function MHe(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?IHe:MHe,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(l||(l=o(t.map(n),e,r)))(n(s(f)))}return d.invert=function(f){return s(i((u||(u=o(e,t.map(n),Bl)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,RHe),h()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),r=TGe,h()},d.clamp=function(f){return arguments.length?(s=f?!0:Wm,h()):s!==Wm},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(a=f,d):a},function(f,p){return n=f,i=p,h()}}function Wce(){return NHe()(Wm,Wm)}function DHe(t,e,r,n){var i=QD(t,e,r),a;switch(n=pA(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=QWe(i,s))&&(n.precision=a),Vce(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=JWe(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=ZWe(i))&&(n.precision=a-(n.type==="%")*2);break}}return Cp(n)}function OHe(t){var e=t.domain;return t.ticks=function(r){var n=e();return rze(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return DHe(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,s=n[i],o=n[a],l,u,h=10;for(o0;){if(u=ZD(s,o,r),u===l)return n[i]=s,n[a]=o,e(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function Sb(){var t=Wce();return t.copy=function(){return Gce(t,Sb())},sR.apply(t,arguments),OHe(t)}function $He(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a0))return l;let u;do l.push(u=new Date(+a)),e(a,o),t(a);while(uha(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!a(s););else for(;--o>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>($M.setTime(+a),PM.setTime(+s),t($M),t(PM),Math.floor(r($M,PM))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Eb=ha(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Eb.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ha(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):Eb);Eb.range;const Qu=1e3,hl=Qu*60,Ju=hl*60,mh=Ju*24,Vz=mh*7,Kj=mh*30,BM=mh*365,_d=ha(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Qu)},(t,e)=>(e-t)/Qu,t=>t.getUTCSeconds());_d.range;const _C=ha(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Qu)},(t,e)=>{t.setTime(+t+e*hl)},(t,e)=>(e-t)/hl,t=>t.getMinutes());_C.range;const PHe=ha(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*hl)},(t,e)=>(e-t)/hl,t=>t.getUTCMinutes());PHe.range;const RC=ha(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Qu-t.getMinutes()*hl)},(t,e)=>{t.setTime(+t+e*Ju)},(t,e)=>(e-t)/Ju,t=>t.getHours());RC.range;const BHe=ha(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Ju)},(t,e)=>(e-t)/Ju,t=>t.getUTCHours());BHe.range;const L0=ha(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*hl)/mh,t=>t.getDate()-1);L0.range;const Gz=ha(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/mh,t=>t.getUTCDate()-1);Gz.range;const FHe=ha(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/mh,t=>Math.floor(t/mh));FHe.range;function rg(t){return ha(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*hl)/Vz)}const Kk=rg(0),LC=rg(1),Hce=rg(2),qce=rg(3),M0=rg(4),Uce=rg(5),Yce=rg(6);Kk.range;LC.range;Hce.range;qce.range;M0.range;Uce.range;Yce.range;function ng(t){return ha(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/Vz)}const Xce=ng(0),yA=ng(1),zHe=ng(2),VHe=ng(3),Ab=ng(4),GHe=ng(5),WHe=ng(6);Xce.range;yA.range;zHe.range;VHe.range;Ab.range;GHe.range;WHe.range;const MC=ha(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());MC.range;const HHe=ha(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());HHe.range;const yh=ha(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());yh.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ha(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});yh.range;const I0=ha(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());I0.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ha(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});I0.range;function qHe(t,e,r,n,i,a){const s=[[_d,1,Qu],[_d,5,5*Qu],[_d,15,15*Qu],[_d,30,30*Qu],[a,1,hl],[a,5,5*hl],[a,15,15*hl],[a,30,30*hl],[i,1,Ju],[i,3,3*Ju],[i,6,6*Ju],[i,12,12*Ju],[n,1,mh],[n,2,2*mh],[r,1,Vz],[e,1,Kj],[e,3,3*Kj],[t,1,BM]];function o(u,h,d){const f=hy).right(s,f);if(p===s.length)return t.every(QD(u/BM,h/BM,d));if(p===0)return Eb.every(Math.max(QD(u,h,d),1));const[g,m]=s[f/s[p-1][2]53)return null;"w"in J||(J.w=1),"Z"in J?(ee=zM(nT(J.y,0,1)),Re=ee.getUTCDay(),ee=Re>4||Re===0?yA.ceil(ee):yA(ee),ee=Gz.offset(ee,(J.V-1)*7),J.y=ee.getUTCFullYear(),J.m=ee.getUTCMonth(),J.d=ee.getUTCDate()+(J.w+6)%7):(ee=FM(nT(J.y,0,1)),Re=ee.getDay(),ee=Re>4||Re===0?LC.ceil(ee):LC(ee),ee=L0.offset(ee,(J.V-1)*7),J.y=ee.getFullYear(),J.m=ee.getMonth(),J.d=ee.getDate()+(J.w+6)%7)}else("W"in J||"U"in J)&&("w"in J||(J.w="u"in J?J.u%7:"W"in J?1:0),Re="Z"in J?zM(nT(J.y,0,1)).getUTCDay():FM(nT(J.y,0,1)).getDay(),J.m=0,J.d="W"in J?(J.w+6)%7+J.W*7-(Re+5)%7:J.w+J.U*7-(Re+6)%7);return"Z"in J?(J.H+=J.Z/100|0,J.M+=J.Z%100,zM(J)):FM(J)}}function E(K,Q,te,J){for(var ge=0,ee=Q.length,Re=te.length,Ie,Be;ge=Re)return-1;if(Ie=Q.charCodeAt(ge++),Ie===37){if(Ie=Q.charAt(ge++),Be=C[Ie in Zj?Q.charAt(ge++):Ie],!Be||(J=Be(K,te,J))<0)return-1}else if(Ie!=te.charCodeAt(J++))return-1}return J}function _(K,Q,te){var J=u.exec(Q.slice(te));return J?(K.p=h.get(J[0].toLowerCase()),te+J[0].length):-1}function M(K,Q,te){var J=p.exec(Q.slice(te));return J?(K.w=g.get(J[0].toLowerCase()),te+J[0].length):-1}function L(K,Q,te){var J=d.exec(Q.slice(te));return J?(K.w=f.get(J[0].toLowerCase()),te+J[0].length):-1}function P(K,Q,te){var J=v.exec(Q.slice(te));return J?(K.m=T.get(J[0].toLowerCase()),te+J[0].length):-1}function D(K,Q,te){var J=m.exec(Q.slice(te));return J?(K.m=y.get(J[0].toLowerCase()),te+J[0].length):-1}function R(K,Q,te){return E(K,e,Q,te)}function I(K,Q,te){return E(K,r,Q,te)}function $(K,Q,te){return E(K,n,Q,te)}function O(K){return s[K.getDay()]}function N(K){return a[K.getDay()]}function F(K){return l[K.getMonth()]}function z(K){return o[K.getMonth()]}function V(K){return i[+(K.getHours()>=12)]}function B(K){return 1+~~(K.getMonth()/3)}function G(K){return s[K.getUTCDay()]}function H(K){return a[K.getUTCDay()]}function q(K){return l[K.getUTCMonth()]}function Z(K){return o[K.getUTCMonth()]}function Y(K){return i[+(K.getUTCHours()>=12)]}function ie(K){return 1+~~(K.getUTCMonth()/3)}return{format:function(K){var Q=S(K+="",b);return Q.toString=function(){return K},Q},parse:function(K){var Q=k(K+="",!1);return Q.toString=function(){return K},Q},utcFormat:function(K){var Q=S(K+="",w);return Q.toString=function(){return K},Q},utcParse:function(K){var Q=k(K+="",!0);return Q.toString=function(){return K},Q}}}var Zj={"-":"",_:" ",0:"0"},_a=/^\s*\d+/,jHe=/^%/,KHe=/[\\^$*+?|[\]().{}]/g;function fn(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function QHe(t,e,r){var n=_a.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function JHe(t,e,r){var n=_a.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function eqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function tqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function rqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Qj(t,e,r){var n=_a.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Jj(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function nqe(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function iqe(t,e,r){var n=_a.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function aqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function eK(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function sqe(t,e,r){var n=_a.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function tK(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function oqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function lqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function cqe(t,e,r){var n=_a.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function uqe(t,e,r){var n=_a.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function hqe(t,e,r){var n=jHe.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function dqe(t,e,r){var n=_a.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function fqe(t,e,r){var n=_a.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function rK(t,e){return fn(t.getDate(),e,2)}function pqe(t,e){return fn(t.getHours(),e,2)}function gqe(t,e){return fn(t.getHours()%12||12,e,2)}function mqe(t,e){return fn(1+L0.count(yh(t),t),e,3)}function jce(t,e){return fn(t.getMilliseconds(),e,3)}function yqe(t,e){return jce(t,e)+"000"}function vqe(t,e){return fn(t.getMonth()+1,e,2)}function bqe(t,e){return fn(t.getMinutes(),e,2)}function xqe(t,e){return fn(t.getSeconds(),e,2)}function Tqe(t){var e=t.getDay();return e===0?7:e}function wqe(t,e){return fn(Kk.count(yh(t)-1,t),e,2)}function Kce(t){var e=t.getDay();return e>=4||e===0?M0(t):M0.ceil(t)}function Cqe(t,e){return t=Kce(t),fn(M0.count(yh(t),t)+(yh(t).getDay()===4),e,2)}function kqe(t){return t.getDay()}function Sqe(t,e){return fn(LC.count(yh(t)-1,t),e,2)}function Eqe(t,e){return fn(t.getFullYear()%100,e,2)}function Aqe(t,e){return t=Kce(t),fn(t.getFullYear()%100,e,2)}function _qe(t,e){return fn(t.getFullYear()%1e4,e,4)}function Rqe(t,e){var r=t.getDay();return t=r>=4||r===0?M0(t):M0.ceil(t),fn(t.getFullYear()%1e4,e,4)}function Lqe(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+fn(e/60|0,"0",2)+fn(e%60,"0",2)}function nK(t,e){return fn(t.getUTCDate(),e,2)}function Mqe(t,e){return fn(t.getUTCHours(),e,2)}function Iqe(t,e){return fn(t.getUTCHours()%12||12,e,2)}function Nqe(t,e){return fn(1+Gz.count(I0(t),t),e,3)}function Zce(t,e){return fn(t.getUTCMilliseconds(),e,3)}function Dqe(t,e){return Zce(t,e)+"000"}function Oqe(t,e){return fn(t.getUTCMonth()+1,e,2)}function $qe(t,e){return fn(t.getUTCMinutes(),e,2)}function Pqe(t,e){return fn(t.getUTCSeconds(),e,2)}function Bqe(t){var e=t.getUTCDay();return e===0?7:e}function Fqe(t,e){return fn(Xce.count(I0(t)-1,t),e,2)}function Qce(t){var e=t.getUTCDay();return e>=4||e===0?Ab(t):Ab.ceil(t)}function zqe(t,e){return t=Qce(t),fn(Ab.count(I0(t),t)+(I0(t).getUTCDay()===4),e,2)}function Vqe(t){return t.getUTCDay()}function Gqe(t,e){return fn(yA.count(I0(t)-1,t),e,2)}function Wqe(t,e){return fn(t.getUTCFullYear()%100,e,2)}function Hqe(t,e){return t=Qce(t),fn(t.getUTCFullYear()%100,e,2)}function qqe(t,e){return fn(t.getUTCFullYear()%1e4,e,4)}function Uqe(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Ab(t):Ab.ceil(t),fn(t.getUTCFullYear()%1e4,e,4)}function Yqe(){return"+0000"}function iK(){return"%"}function aK(t){return+t}function sK(t){return Math.floor(+t/1e3)}var Hg,vA;Xqe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Xqe(t){return Hg=XHe(t),vA=Hg.format,Hg.parse,Hg.utcFormat,Hg.utcParse,Hg}function jqe(t){return new Date(t)}function Kqe(t){return t instanceof Date?+t:+new Date(+t)}function Jce(t,e,r,n,i,a,s,o,l,u){var h=Wce(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),T=u("%b %d"),b=u("%B"),w=u("%Y");function C(S){return(l(S)1?0:t<-1?IC:Math.acos(t)}function lK(t){return t>=1?bA:t<=-1?-bA:Math.asin(t)}function eue(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new GWe(e)}function rUe(t){return t.innerRadius}function nUe(t){return t.outerRadius}function iUe(t){return t.startAngle}function aUe(t){return t.endAngle}function sUe(t){return t&&t.padAngle}function oUe(t,e,r,n,i,a,s,o){var l=r-t,u=n-e,h=s-i,d=o-a,f=d*l-h*u;if(!(f*fR*R+I*I&&(E=M,_=L),{cx:E,cy:_,x01:-h,y01:-d,x11:E*(i/C-1),y11:_*(i/C-1)}}function _b(){var t=rUe,e=nUe,r=Mi(0),n=null,i=iUe,a=aUe,s=sUe,o=null,l=eue(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-bA,m=a.apply(this,arguments)-bA,y=oK(m-g),v=m>g;if(o||(o=h=l()),pls))o.moveTo(0,0);else if(y>Y4-ls)o.moveTo(p*Wf(g),p*mc(g)),o.arc(0,0,p,g,m,!v),f>ls&&(o.moveTo(f*Wf(m),f*mc(m)),o.arc(0,0,f,m,g,v));else{var T=g,b=m,w=g,C=m,S=y,k=y,E=s.apply(this,arguments)/2,_=E>ls&&(n?+n.apply(this,arguments):Hm(f*f+p*p)),M=VM(oK(p-f)/2,+r.apply(this,arguments)),L=M,P=M,D,R;if(_>ls){var I=lK(_/f*mc(E)),$=lK(_/p*mc(E));(S-=I*2)>ls?(I*=v?1:-1,w+=I,C-=I):(S=0,w=C=(g+m)/2),(k-=$*2)>ls?($*=v?1:-1,T+=$,b-=$):(k=0,T=b=(g+m)/2)}var O=p*Wf(T),N=p*mc(T),F=f*Wf(C),z=f*mc(C);if(M>ls){var V=p*Wf(b),B=p*mc(b),G=f*Wf(w),H=f*mc(w),q;if(yls?P>ls?(D=wE(G,H,O,N,p,P,v),R=wE(V,B,F,z,p,P,v),o.moveTo(D.cx+D.x01,D.cy+D.y01),Pls)||!(S>ls)?o.lineTo(F,z):L>ls?(D=wE(F,z,V,B,f,-L,v),R=wE(O,N,G,H,f,-L,v),o.lineTo(D.cx+D.x01,D.cy+D.y01),Lt?1:e>=t?0:NaN}function hUe(t){return t}function dUe(){var t=hUe,e=uUe,r=null,n=Mi(0),i=Mi(Y4),a=Mi(0);function s(o){var l,u=(o=tue(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(Y4,Math.max(-Y4,i.apply(this,arguments)-m)),v,T=Math.min(Math.abs(y)/u,a.apply(this,arguments)),b=T*(y<0?-1:1),w;for(l=0;l0&&(f+=w);for(e!=null?p.sort(function(C,S){return e(g[C],g[S])}):r!=null&&p.sort(function(C,S){return r(o[C],o[S])}),l=0,d=f?(y-u*b)/f:0;l0?w*d:0)+b,g[h]={data:o[h],index:l,value:w,startAngle:m,endAngle:v,padAngle:T};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:Mi(+o),s):t},s.sortValues=function(o){return arguments.length?(e=o,r=null,s):e},s.sort=function(o){return arguments.length?(r=o,e=null,s):r},s.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:Mi(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Mi(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:Mi(+o),s):a},s}class nue{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function iue(t){return new nue(t,!0)}function aue(t){return new nue(t,!1)}function Jd(){}function xA(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function oR(t){this._context=t}oR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:xA(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:xA(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function DC(t){return new oR(t)}function sue(t){this._context=t}sue.prototype={areaStart:Jd,areaEnd:Jd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:xA(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function fUe(t){return new sue(t)}function oue(t){this._context=t}oue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:xA(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function pUe(t){return new oue(t)}function lue(t,e){this._basis=new oR(t),this._beta=e}lue.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],a=t[r]-n,s=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*a),this._beta*e[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const gUe=(function t(e){function r(n){return e===1?new oR(n):new lue(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function TA(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function Wz(t,e){this._context=t,this._k=(1-e)/6}Wz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:TA(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:TA(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const cue=(function t(e){function r(n){return new Wz(n,e)}return r.tension=function(n){return t(+n)},r})(0);function Hz(t,e){this._context=t,this._k=(1-e)/6}Hz.prototype={areaStart:Jd,areaEnd:Jd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:TA(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const mUe=(function t(e){function r(n){return new Hz(n,e)}return r.tension=function(n){return t(+n)},r})(0);function qz(t,e){this._context=t,this._k=(1-e)/6}qz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:TA(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const yUe=(function t(e){function r(n){return new qz(n,e)}return r.tension=function(n){return t(+n)},r})(0);function Uz(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>ls){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>ls){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function uue(t,e){this._context=t,this._alpha=e}uue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Uz(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const hue=(function t(e){function r(n){return e?new uue(n,e):new Wz(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function due(t,e){this._context=t,this._alpha=e}due.prototype={areaStart:Jd,areaEnd:Jd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Uz(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const vUe=(function t(e){function r(n){return e?new due(n,e):new Hz(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function fue(t,e){this._context=t,this._alpha=e}fue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Uz(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const bUe=(function t(e){function r(n){return e?new fue(n,e):new qz(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function pue(t){this._context=t}pue.prototype={areaStart:Jd,areaEnd:Jd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function xUe(t){return new pue(t)}function cK(t){return t<0?-1:1}function uK(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return(cK(a)+cK(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function hK(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function GM(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-n)/3;t._context.bezierCurveTo(n+o,i+o*e,a-o,s-o*r,a,s)}function wA(t){this._context=t}wA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:GM(this,this._t0,hK(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,GM(this,hK(this,r=uK(this,t,e)),r);break;default:GM(this,this._t0,r=uK(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function gue(t){this._context=new mue(t)}(gue.prototype=Object.create(wA.prototype)).point=function(t,e){wA.prototype.point.call(this,e,t)};function mue(t){this._context=t}mue.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function yue(t){return new wA(t)}function vue(t){return new gue(t)}function bue(t){this._context=t}bue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=dK(t),i=dK(e),a=0,s=1;s=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function Tue(t){return new lR(t,.5)}function wue(t){return new lR(t,0)}function Cue(t){return new lR(t,1)}function qT(t,e,r){this.k=t,this.x=e,this.y=r}qT.prototype={constructor:qT,scale:function(t){return t===1?this:new qT(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new qT(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};qT.prototype;var xs=x(t=>{var i;const{securityLevel:e}=Fe();let r=ut("body");if(e==="sandbox"){const s=((i=ut(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=ut(s.body)}return r.select(`#${t}`)},"selectSvgElement");function Yz(t){return typeof t>"u"||t===null}x(Yz,"isNothing");function kue(t){return typeof t=="object"&&t!==null}x(kue,"isObject");function Sue(t){return Array.isArray(t)?t:Yz(t)?[]:[t]}x(Sue,"toArray");function Eue(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;ro&&(a=" ... ",e=n-o+a.length),r-n>o&&(s=" ...",r=n+o-s.length),{str:a+t.slice(e,r).replace(/\t/g,"→")+s,pos:n-e+a.length}}x(X4,"getLine");function j4(t,e){return aa.repeat(" ",e-t.length)+t}x(j4,"padStart");function _ue(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],a,s=-1;a=r.exec(t.buffer);)i.push(a.index),n.push(a.index+a[0].length),t.position<=a.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var o="",l,u,h=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+h+3);for(l=1;l<=e.linesBefore&&!(s-l<0);l++)u=X4(t.buffer,n[s-l],i[s-l],t.position-(n[s]-n[s-l]),d),o=aa.repeat(" ",e.indent)+j4((t.line-l+1).toString(),h)+" | "+u.str+` +`+t.mark.snippet),n+" "+r):n}x(Xz,"formatError");function Rb(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=Xz(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}x(Rb,"YAMLException$1");Rb.prototype=Object.create(Error.prototype);Rb.prototype.constructor=Rb;Rb.prototype.toString=x(function(e){return this.name+": "+Xz(this,e)},"toString");var po=Rb;function X4(t,e,r,n,i){var a="",s="",o=Math.floor(i/2)-1;return n-e>o&&(a=" ... ",e=n-o+a.length),r-n>o&&(s=" ...",r=n+o-s.length),{str:a+t.slice(e,r).replace(/\t/g,"→")+s,pos:n-e+a.length}}x(X4,"getLine");function j4(t,e){return aa.repeat(" ",e-t.length)+t}x(j4,"padStart");function Rue(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],a,s=-1;a=r.exec(t.buffer);)i.push(a.index),n.push(a.index+a[0].length),t.position<=a.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var o="",l,u,h=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+h+3);for(l=1;l<=e.linesBefore&&!(s-l<0);l++)u=X4(t.buffer,n[s-l],i[s-l],t.position-(n[s]-n[s-l]),d),o=aa.repeat(" ",e.indent)+j4((t.line-l+1).toString(),h)+" | "+u.str+` `+o;for(u=X4(t.buffer,n[s],i[s],t.position,d),o+=aa.repeat(" ",e.indent)+j4((t.line+1).toString(),h)+" | "+u.str+` `,o+=aa.repeat("-",e.indent+h+3+u.pos)+`^ `,l=1;l<=e.linesAfter&&!(s+l>=i.length);l++)u=X4(t.buffer,n[s+l],i[s+l],t.position-(n[s]-n[s+l]),d),o+=aa.repeat(" ",e.indent)+j4((t.line+l+1).toString(),h)+" | "+u.str+` -`;return o.replace(/\n$/,"")}x(_ue,"makeSnippet");var EUe=_ue,AUe=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],_Ue=["scalar","sequence","mapping"];function Rue(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}x(Rue,"compileStyleAliases");function Lue(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(AUe.indexOf(r)===-1)throw new po('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=Rue(e.styleAliases||null),_Ue.indexOf(this.kind)===-1)throw new po('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}x(Lue,"Type$1");var ds=Lue;function dO(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(a,s){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=s)}),r[i]=n}),r}x(dO,"compileList");function Mue(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(x(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:x(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:x(function(t){return t.toString(10)},"decimal"),hexadecimal:x(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),PUe=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Hue(t){return!(t===null||!PUe.test(t)||t[t.length-1]==="_")}x(Hue,"resolveYamlFloat");function que(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}x(que,"constructYamlFloat");var BUe=/^[-+]?[0-9]+e/;function Uue(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(aa.isNegativeZero(t))return"-0.0";return r=t.toString(10),BUe.test(r)?r.replace("e",".e"):r}x(Uue,"representYamlFloat");function Yue(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||aa.isNegativeZero(t))}x(Yue,"isFloat");var FUe=new ds("tag:yaml.org,2002:float",{kind:"scalar",resolve:Hue,construct:que,predicate:Yue,represent:Uue,defaultStyle:"lowercase"}),Xue=NUe.extend({implicit:[DUe,OUe,$Ue,FUe]}),zUe=Xue,jue=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Kue=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Zue(t){return t===null?!1:jue.exec(t)!==null||Kue.exec(t)!==null}x(Zue,"resolveYamlTimestamp");function Que(t){var e,r,n,i,a,s,o,l=0,u=null,h,d,f;if(e=jue.exec(t),e===null&&(e=Kue.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],d=+(e[11]||0),u=(h*60+d)*6e4,e[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,i,a,s,o,l)),u&&f.setTime(f.getTime()-u),f}x(Que,"constructYamlTimestamp");function Jue(t){return t.toISOString()}x(Jue,"representYamlTimestamp");var VUe=new ds("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Zue,construct:Que,instanceOf:Date,represent:Jue});function ehe(t){return t==="<<"||t===null}x(ehe,"resolveYamlMerge");var GUe=new ds("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ehe}),jz=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function the(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=jz;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}x(the,"resolveYamlBinary");function rhe(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=jz,s=0,o=[];for(e=0;e>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}x(rhe,"constructYamlBinary");function nhe(t){var e="",r=0,n,i,a=t.length,s=jz;for(n=0;n>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]):i===2?(e+=s[r>>10&63],e+=s[r>>4&63],e+=s[r<<2&63],e+=s[64]):i===1&&(e+=s[r>>2&63],e+=s[r<<4&63],e+=s[64],e+=s[64]),e}x(nhe,"representYamlBinary");function ihe(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}x(ihe,"isBinary");var WUe=new ds("tag:yaml.org,2002:binary",{kind:"scalar",resolve:the,construct:rhe,predicate:ihe,represent:nhe}),HUe=Object.prototype.hasOwnProperty,qUe=Object.prototype.toString;function ahe(t){if(t===null)return!0;var e=[],r,n,i,a,s,o=t;for(r=0,n=o.length;r>10)+55296,(t-65536&1023)+56320)}x(bhe,"charFromCodepoint");function Kz(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}x(Kz,"setProperty");var xhe=new Array(256),The=new Array(256);for(Hf=0;Hf<256;Hf++)xhe[Hf]=pO(Hf)?1:0,The[Hf]=pO(Hf);var Hf;function whe(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||hhe,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}x(whe,"State$1");function Zz(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=EUe(r),new po(e,r)}x(Zz,"generateError");function ar(t,e){throw Zz(t,e)}x(ar,"throwError");function OC(t,e){t.onWarning&&t.onWarning.call(null,Zz(t,e))}x(OC,"throwWarning");var pK={YAML:x(function(e,r,n){var i,a,s;e.version!==null&&ar(e,"duplication of %YAML directive"),n.length!==1&&ar(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&ar(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&ar(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&OC(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:x(function(e,r,n){var i,a;n.length!==2&&ar(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],phe.test(i)||ar(e,"ill-formed tag handle (first argument) of the TAG directive"),ef.call(e.tagMap,i)&&ar(e,'there is a previously declared suffix for "'+i+'" tag handle'),ghe.test(a)||ar(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{ar(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function uh(t,e,r,n){var i,a,s,o;if(e1&&(t.result+=aa.repeat(` -`,e-1))}x(uR,"writeFoldedLines");function Che(t,e,r){var n,i,a,s,o,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),Os(p)||Kp(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=t.input.charCodeAt(t.position+1),Os(i)||r&&Kp(i)))return!1;for(t.kind="scalar",t.result="",a=s=t.position,o=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),Os(i)||r&&Kp(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),Os(n))break}else{if(t.position===t.lineStart&&Zk(t)||r&&Kp(p))break;if(Kl(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,Ni(t,!1,-1),t.lineIndent>=e){o=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=s,t.line=l,t.lineStart=u,t.lineIndent=h;break}}o&&(uh(t,a,s,!1),uR(t,t.line-l),a=s=t.position,o=!1),Wd(p)||(s=t.position+1),p=t.input.charCodeAt(++t.position)}return uh(t,a,s,!1),t.result?!0:(t.kind=d,t.result=f,!1)}x(Che,"readPlainScalar");function khe(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(uh(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else Kl(r)?(uh(t,n,i,!0),uR(t,Ni(t,!1,e)),n=i=t.position):t.position===t.lineStart&&Zk(t)?ar(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);ar(t,"unexpected end of the stream within a single quoted scalar")}x(khe,"readSingleQuotedScalar");function She(t,e){var r,n,i,a,s,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return uh(t,r,t.position,!0),t.position++,!0;if(o===92){if(uh(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),Kl(o))Ni(t,!1,e);else if(o<256&&xhe[o])t.result+=The[o],t.position++;else if((s=yhe(o))>0){for(i=s,a=0;i>0;i--)o=t.input.charCodeAt(++t.position),(s=mhe(o))>=0?a=(a<<4)+s:ar(t,"expected hexadecimal character");t.result+=bhe(a),t.position++}else ar(t,"unknown escape sequence");r=n=t.position}else Kl(o)?(uh(t,r,n,!0),uR(t,Ni(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Zk(t)?ar(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}ar(t,"unexpected end of the stream within a double quoted scalar")}x(She,"readDoubleQuotedScalar");function Ehe(t,e){var r=!0,n,i,a,s=t.tag,o,l=t.anchor,u,h,d,f,p,g=Object.create(null),m,y,v,T;if(T=t.input.charCodeAt(t.position),T===91)h=93,p=!1,o=[];else if(T===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),T=t.input.charCodeAt(++t.position);T!==0;){if(Ni(t,!0,e),T=t.input.charCodeAt(t.position),T===h)return t.position++,t.tag=s,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?T===44&&ar(t,"expected the node content, but found ','"):ar(t,"missed comma between flow collection entries"),y=m=v=null,d=f=!1,T===63&&(u=t.input.charCodeAt(t.position+1),Os(u)&&(d=f=!0,t.position++,Ni(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,N0(t,e,kA,!1,!0),y=t.tag,m=t.result,Ni(t,!0,e),T=t.input.charCodeAt(t.position),(f||t.line===n)&&T===58&&(d=!0,T=t.input.charCodeAt(++t.position),Ni(t,!0,e),N0(t,e,kA,!1,!0),v=t.result),p?Zp(t,o,g,y,m,v,n,i,a):d?o.push(Zp(t,null,g,y,m,v,n,i,a)):o.push(m),Ni(t,!0,e),T=t.input.charCodeAt(t.position),T===44?(r=!0,T=t.input.charCodeAt(++t.position)):r=!1}ar(t,"unexpected end of the stream within a flow collection")}x(Ehe,"readFlowCollection");function Ahe(t,e){var r,n,i=WM,a=!1,s=!1,o=e,l=0,u=!1,h,d;if(d=t.input.charCodeAt(t.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)WM===i?i=d===43?fK:ZUe:ar(t,"repeat of a chomping mode identifier");else if((h=vhe(d))>=0)h===0?ar(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?ar(t,"repeat of an indentation width identifier"):(o=e+h-1,s=!0);else break;if(Wd(d)){do d=t.input.charCodeAt(++t.position);while(Wd(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!Kl(d)&&d!==0)}for(;d!==0;){for(cR(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndento&&(o=t.lineIndent),Kl(d)){l++;continue}if(t.lineIndent=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:x(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:x(function(t){return t.toString(10)},"decimal"),hexadecimal:x(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),BUe=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function que(t){return!(t===null||!BUe.test(t)||t[t.length-1]==="_")}x(que,"resolveYamlFloat");function Uue(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}x(Uue,"constructYamlFloat");var FUe=/^[-+]?[0-9]+e/;function Yue(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(aa.isNegativeZero(t))return"-0.0";return r=t.toString(10),FUe.test(r)?r.replace("e",".e"):r}x(Yue,"representYamlFloat");function Xue(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||aa.isNegativeZero(t))}x(Xue,"isFloat");var zUe=new ds("tag:yaml.org,2002:float",{kind:"scalar",resolve:que,construct:Uue,predicate:Xue,represent:Yue,defaultStyle:"lowercase"}),jue=DUe.extend({implicit:[OUe,$Ue,PUe,zUe]}),VUe=jue,Kue=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Zue=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Que(t){return t===null?!1:Kue.exec(t)!==null||Zue.exec(t)!==null}x(Que,"resolveYamlTimestamp");function Jue(t){var e,r,n,i,a,s,o,l=0,u=null,h,d,f;if(e=Kue.exec(t),e===null&&(e=Zue.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],d=+(e[11]||0),u=(h*60+d)*6e4,e[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,i,a,s,o,l)),u&&f.setTime(f.getTime()-u),f}x(Jue,"constructYamlTimestamp");function ehe(t){return t.toISOString()}x(ehe,"representYamlTimestamp");var GUe=new ds("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Que,construct:Jue,instanceOf:Date,represent:ehe});function the(t){return t==="<<"||t===null}x(the,"resolveYamlMerge");var WUe=new ds("tag:yaml.org,2002:merge",{kind:"scalar",resolve:the}),jz=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function rhe(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=jz;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}x(rhe,"resolveYamlBinary");function nhe(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=jz,s=0,o=[];for(e=0;e>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}x(nhe,"constructYamlBinary");function ihe(t){var e="",r=0,n,i,a=t.length,s=jz;for(n=0;n>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]):i===2?(e+=s[r>>10&63],e+=s[r>>4&63],e+=s[r<<2&63],e+=s[64]):i===1&&(e+=s[r>>2&63],e+=s[r<<4&63],e+=s[64],e+=s[64]),e}x(ihe,"representYamlBinary");function ahe(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}x(ahe,"isBinary");var HUe=new ds("tag:yaml.org,2002:binary",{kind:"scalar",resolve:rhe,construct:nhe,predicate:ahe,represent:ihe}),qUe=Object.prototype.hasOwnProperty,UUe=Object.prototype.toString;function she(t){if(t===null)return!0;var e=[],r,n,i,a,s,o=t;for(r=0,n=o.length;r>10)+55296,(t-65536&1023)+56320)}x(xhe,"charFromCodepoint");function Kz(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}x(Kz,"setProperty");var The=new Array(256),whe=new Array(256);for(Hf=0;Hf<256;Hf++)The[Hf]=pO(Hf)?1:0,whe[Hf]=pO(Hf);var Hf;function Che(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||dhe,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}x(Che,"State$1");function Zz(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=AUe(r),new po(e,r)}x(Zz,"generateError");function ar(t,e){throw Zz(t,e)}x(ar,"throwError");function OC(t,e){t.onWarning&&t.onWarning.call(null,Zz(t,e))}x(OC,"throwWarning");var pK={YAML:x(function(e,r,n){var i,a,s;e.version!==null&&ar(e,"duplication of %YAML directive"),n.length!==1&&ar(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&ar(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&ar(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&OC(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:x(function(e,r,n){var i,a;n.length!==2&&ar(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],ghe.test(i)||ar(e,"ill-formed tag handle (first argument) of the TAG directive"),ef.call(e.tagMap,i)&&ar(e,'there is a previously declared suffix for "'+i+'" tag handle'),mhe.test(a)||ar(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{ar(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function uh(t,e,r,n){var i,a,s,o;if(e1&&(t.result+=aa.repeat(` +`,e-1))}x(uR,"writeFoldedLines");function khe(t,e,r){var n,i,a,s,o,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),Os(p)||Kp(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=t.input.charCodeAt(t.position+1),Os(i)||r&&Kp(i)))return!1;for(t.kind="scalar",t.result="",a=s=t.position,o=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),Os(i)||r&&Kp(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),Os(n))break}else{if(t.position===t.lineStart&&Zk(t)||r&&Kp(p))break;if(Kl(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,Ni(t,!1,-1),t.lineIndent>=e){o=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=s,t.line=l,t.lineStart=u,t.lineIndent=h;break}}o&&(uh(t,a,s,!1),uR(t,t.line-l),a=s=t.position,o=!1),Wd(p)||(s=t.position+1),p=t.input.charCodeAt(++t.position)}return uh(t,a,s,!1),t.result?!0:(t.kind=d,t.result=f,!1)}x(khe,"readPlainScalar");function She(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(uh(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else Kl(r)?(uh(t,n,i,!0),uR(t,Ni(t,!1,e)),n=i=t.position):t.position===t.lineStart&&Zk(t)?ar(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);ar(t,"unexpected end of the stream within a single quoted scalar")}x(She,"readSingleQuotedScalar");function Ehe(t,e){var r,n,i,a,s,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return uh(t,r,t.position,!0),t.position++,!0;if(o===92){if(uh(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),Kl(o))Ni(t,!1,e);else if(o<256&&The[o])t.result+=whe[o],t.position++;else if((s=vhe(o))>0){for(i=s,a=0;i>0;i--)o=t.input.charCodeAt(++t.position),(s=yhe(o))>=0?a=(a<<4)+s:ar(t,"expected hexadecimal character");t.result+=xhe(a),t.position++}else ar(t,"unknown escape sequence");r=n=t.position}else Kl(o)?(uh(t,r,n,!0),uR(t,Ni(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Zk(t)?ar(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}ar(t,"unexpected end of the stream within a double quoted scalar")}x(Ehe,"readDoubleQuotedScalar");function Ahe(t,e){var r=!0,n,i,a,s=t.tag,o,l=t.anchor,u,h,d,f,p,g=Object.create(null),m,y,v,T;if(T=t.input.charCodeAt(t.position),T===91)h=93,p=!1,o=[];else if(T===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),T=t.input.charCodeAt(++t.position);T!==0;){if(Ni(t,!0,e),T=t.input.charCodeAt(t.position),T===h)return t.position++,t.tag=s,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?T===44&&ar(t,"expected the node content, but found ','"):ar(t,"missed comma between flow collection entries"),y=m=v=null,d=f=!1,T===63&&(u=t.input.charCodeAt(t.position+1),Os(u)&&(d=f=!0,t.position++,Ni(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,N0(t,e,kA,!1,!0),y=t.tag,m=t.result,Ni(t,!0,e),T=t.input.charCodeAt(t.position),(f||t.line===n)&&T===58&&(d=!0,T=t.input.charCodeAt(++t.position),Ni(t,!0,e),N0(t,e,kA,!1,!0),v=t.result),p?Zp(t,o,g,y,m,v,n,i,a):d?o.push(Zp(t,null,g,y,m,v,n,i,a)):o.push(m),Ni(t,!0,e),T=t.input.charCodeAt(t.position),T===44?(r=!0,T=t.input.charCodeAt(++t.position)):r=!1}ar(t,"unexpected end of the stream within a flow collection")}x(Ahe,"readFlowCollection");function _he(t,e){var r,n,i=WM,a=!1,s=!1,o=e,l=0,u=!1,h,d;if(d=t.input.charCodeAt(t.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)WM===i?i=d===43?fK:QUe:ar(t,"repeat of a chomping mode identifier");else if((h=bhe(d))>=0)h===0?ar(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?ar(t,"repeat of an indentation width identifier"):(o=e+h-1,s=!0);else break;if(Wd(d)){do d=t.input.charCodeAt(++t.position);while(Wd(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!Kl(d)&&d!==0)}for(;d!==0;){for(cR(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndento&&(o=t.lineIndent),Kl(d)){l++;continue}if(t.lineIndente)&&l!==0)ar(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(s=t.line,o=t.lineStart,l=t.position),N0(t,e,SA,!0,i)&&(y?g=t.result:m=t.result),y||(Zp(t,d,f,p,g,m,s,o,l),p=g=m=null),Ni(t,!0,-1),T=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&T!==0)ar(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),d=0,f=t.implicitTypes.length;d"),t.result!==null&&g.kind!==t.kind&&ar(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):ar(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}x(N0,"composeNode");function Ihe(t){var e=t.position,r,n,i,a=!1,s;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(s=t.input.charCodeAt(t.position))!==0&&(Ni(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){for(a=!0,s=t.input.charCodeAt(++t.position),r=t.position;s!==0&&!Os(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&ar(t,"directive name must not be less than one character in length");s!==0;){for(;Wd(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!Kl(s));break}if(Kl(s))break;for(r=t.position;s!==0&&!Os(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&cR(t),ef.call(pK,n)?pK[n](t,n,i):OC(t,'unknown document directive "'+n+'"')}if(Ni(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Ni(t,!0,-1)):a&&ar(t,"directives end mark is expected"),N0(t,t.lineIndent-1,SA,!1,!0),Ni(t,!0,-1),t.checkLineBreaks&&JUe.test(t.input.slice(e,t.position))&&OC(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Zk(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Ni(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=Qz(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;ie)&&l!==0)ar(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(s=t.line,o=t.lineStart,l=t.position),N0(t,e,SA,!0,i)&&(y?g=t.result:m=t.result),y||(Zp(t,d,f,p,g,m,s,o,l),p=g=m=null),Ni(t,!0,-1),T=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&T!==0)ar(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),d=0,f=t.implicitTypes.length;d"),t.result!==null&&g.kind!==t.kind&&ar(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):ar(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}x(N0,"composeNode");function Nhe(t){var e=t.position,r,n,i,a=!1,s;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(s=t.input.charCodeAt(t.position))!==0&&(Ni(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){for(a=!0,s=t.input.charCodeAt(++t.position),r=t.position;s!==0&&!Os(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&ar(t,"directive name must not be less than one character in length");s!==0;){for(;Wd(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!Kl(s));break}if(Kl(s))break;for(r=t.position;s!==0&&!Os(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&cR(t),ef.call(pK,n)?pK[n](t,n,i):OC(t,'unknown document directive "'+n+'"')}if(Ni(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Ni(t,!0,-1)):a&&ar(t,"directives end mark is expected"),N0(t,t.lineIndent-1,SA,!1,!0),Ni(t,!0,-1),t.checkLineBreaks&&eYe.test(t.input.slice(e,t.position))&&OC(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Zk(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Ni(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=Qz(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;i=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}x(qm,"codePointAt");function eV(t){var e=/^\n* /;return e.test(t)}x(eV,"needIndentIndicator");var Yhe=1,TO=2,Xhe=3,jhe=4,vm=5;function Khe(t,e,r,n,i,a,s,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=qhe(qm(t,0))&&Uhe(qm(t,t.length-1));if(e||s)for(l=0;l=65536?l+=2:l++){if(u=qm(t,l),!Lb(u))return vm;m=m&&xO(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=qm(t,l),u===$C)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!Lb(u))return vm;m=m&&xO(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!s&&!i(t)?Yhe:a===PC?vm:TO:r>9&&eV(t)?vm:s?a===PC?vm:TO:f?jhe:Xhe}x(Khe,"chooseScalarStyle");function Zhe(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===PC?'""':"''";if(!t.noCompatMode&&(xYe.indexOf(e)!==-1||TYe.test(e)))return t.quotingType===PC?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),o=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return Hhe(t,u)}switch(x(l,"testAmbiguity"),Khe(e,o,t.indent,s,l,t.quotingType,t.forceQuotes&&!n,i)){case Yhe:return e;case TO:return"'"+e.replace(/'/g,"''")+"'";case Xhe:return"|"+wO(e,t.indent)+CO(vO(e,a));case jhe:return">"+wO(e,t.indent)+CO(vO(Qhe(e,s),a));case vm:return'"'+Jhe(e)+'"';default:throw new po("impossible error: invalid scalar style")}})()}x(Zhe,"writeScalar");function wO(t,e){var r=eV(t)?String(e):"",n=t[t.length-1]===` +`+aa.repeat(" ",t.indent*e)}x(AA,"generateNextLine");function qhe(t,e){var r,n,i;for(r=0,n=t.implicitTypes.length;r=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}x(qm,"codePointAt");function eV(t){var e=/^\n* /;return e.test(t)}x(eV,"needIndentIndicator");var Xhe=1,TO=2,jhe=3,Khe=4,vm=5;function Zhe(t,e,r,n,i,a,s,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=Uhe(qm(t,0))&&Yhe(qm(t,t.length-1));if(e||s)for(l=0;l=65536?l+=2:l++){if(u=qm(t,l),!Lb(u))return vm;m=m&&xO(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=qm(t,l),u===$C)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!Lb(u))return vm;m=m&&xO(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!s&&!i(t)?Xhe:a===PC?vm:TO:r>9&&eV(t)?vm:s?a===PC?vm:TO:f?Khe:jhe}x(Zhe,"chooseScalarStyle");function Qhe(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===PC?'""':"''";if(!t.noCompatMode&&(TYe.indexOf(e)!==-1||wYe.test(e)))return t.quotingType===PC?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),o=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return qhe(t,u)}switch(x(l,"testAmbiguity"),Zhe(e,o,t.indent,s,l,t.quotingType,t.forceQuotes&&!n,i)){case Xhe:return e;case TO:return"'"+e.replace(/'/g,"''")+"'";case jhe:return"|"+wO(e,t.indent)+CO(vO(e,a));case Khe:return">"+wO(e,t.indent)+CO(vO(Jhe(e,s),a));case vm:return'"'+ede(e)+'"';default:throw new po("impossible error: invalid scalar style")}})()}x(Qhe,"writeScalar");function wO(t,e){var r=eV(t)?String(e):"",n=t[t.length-1]===` `,i=n&&(t[t.length-2]===` `||t===` `),a=i?"+":n?"":"-";return r+a+` `}x(wO,"blockHeader");function CO(t){return t[t.length-1]===` -`?t.slice(0,-1):t}x(CO,"dropEndingNewline");function Qhe(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(` +`?t.slice(0,-1):t}x(CO,"dropEndingNewline");function Jhe(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(` `);return u=u!==-1?u:t.length,r.lastIndex=u,kO(t.slice(0,u),e)})(),i=t[0]===` `||t[0]===" ",a,s;s=r.exec(t);){var o=s[1],l=s[2];a=l[0]===" ",n+=o+(!i&&!a&&l!==""?` -`:"")+kO(l,e),i=a}return n}x(Qhe,"foldString");function kO(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,a,s=0,o=0,l="";n=r.exec(t);)o=n.index,o-i>e&&(a=s>i?s:o,l+=` +`:"")+kO(l,e),i=a}return n}x(Jhe,"foldString");function kO(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,a,s=0,o=0,l="";n=r.exec(t);)o=n.index,o-i>e&&(a=s>i?s:o,l+=` `+t.slice(i,a),i=a+1),s=o;return l+=` `,t.length-i>e&&s>i?l+=t.slice(i,s)+` -`+t.slice(s+1):l+=t.slice(i),l.slice(1)}x(kO,"foldLine");function Jhe(t){for(var e="",r=0,n,i=0;i=65536?i+=2:i++)r=qm(t,i),n=Ts[r],!n&&Lb(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||Ghe(r);return e}x(Jhe,"escapeString");function ede(t,e,r){var n="",i=t.tag,a,s,o;for(a=0,s=r.length;a"u"&&Kc(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}x(ede,"writeFlowSequence");function SO(t,e,r,n){var i="",a=t.tag,s,o,l;for(s=0,o=r.length;s"u"&&Kc(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=AA(t,e)),t.dump&&$C===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}x(SO,"writeBlockSequence");function tde(t,e,r){var n="",i=t.tag,a=Object.keys(r),s,o,l,u,h;for(s=0,o=a.length;s1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Kc(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}x(tde,"writeFlowMapping");function rde(t,e,r,n){var i="",a=t.tag,s=Object.keys(r),o,l,u,h,d,f;if(t.sortKeys===!0)s.sort();else if(typeof t.sortKeys=="function")s.sort(t.sortKeys);else if(t.sortKeys)throw new po("sortKeys must be a boolean or a function");for(o=0,l=s.length;o1024,d&&(t.dump&&$C===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=AA(t,e)),Kc(t,e+1,h,!0,d)&&(t.dump&&$C===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}x(rde,"writeBlockMapping");function EO(t,e,r){var n,i,a,s,o,l;for(i=r?t.explicitTypes:t.implicitTypes,a=0,s=i.length;a tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}x(EO,"detectType");function Kc(t,e,r,n,i,a,s){t.tag=null,t.dump=r,EO(t,r,!1)||EO(t,r,!0);var o=Dhe.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var h=o==="[object Object]"||o==="[object Array]",d,f;if(h&&(d=t.duplicates.indexOf(r),f=d!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(h&&f&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),o==="[object Object]")n&&Object.keys(t.dump).length!==0?(rde(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(tde(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!s&&e>0?SO(t,e-1,t.dump,i):SO(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(ede(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&Zhe(t,t.dump,e,a,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new po("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}x(Kc,"writeNode");function nde(t,e){var r=[],n=[],i,a;for(_A(t,r,n),i=0,a=n.length;i=65536?i+=2:i++)r=qm(t,i),n=Ts[r],!n&&Lb(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||Whe(r);return e}x(ede,"escapeString");function tde(t,e,r){var n="",i=t.tag,a,s,o;for(a=0,s=r.length;a"u"&&Kc(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}x(tde,"writeFlowSequence");function SO(t,e,r,n){var i="",a=t.tag,s,o,l;for(s=0,o=r.length;s"u"&&Kc(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=AA(t,e)),t.dump&&$C===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}x(SO,"writeBlockSequence");function rde(t,e,r){var n="",i=t.tag,a=Object.keys(r),s,o,l,u,h;for(s=0,o=a.length;s1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Kc(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}x(rde,"writeFlowMapping");function nde(t,e,r,n){var i="",a=t.tag,s=Object.keys(r),o,l,u,h,d,f;if(t.sortKeys===!0)s.sort();else if(typeof t.sortKeys=="function")s.sort(t.sortKeys);else if(t.sortKeys)throw new po("sortKeys must be a boolean or a function");for(o=0,l=s.length;o1024,d&&(t.dump&&$C===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=AA(t,e)),Kc(t,e+1,h,!0,d)&&(t.dump&&$C===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}x(nde,"writeBlockMapping");function EO(t,e,r){var n,i,a,s,o,l;for(i=r?t.explicitTypes:t.implicitTypes,a=0,s=i.length;a tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}x(EO,"detectType");function Kc(t,e,r,n,i,a,s){t.tag=null,t.dump=r,EO(t,r,!1)||EO(t,r,!0);var o=Ohe.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var h=o==="[object Object]"||o==="[object Array]",d,f;if(h&&(d=t.duplicates.indexOf(r),f=d!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(h&&f&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),o==="[object Object]")n&&Object.keys(t.dump).length!==0?(nde(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(rde(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!s&&e>0?SO(t,e-1,t.dump,i):SO(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(tde(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&Qhe(t,t.dump,e,a,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new po("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}x(Kc,"writeNode");function ide(t,e){var r=[],n=[],i,a;for(_A(t,r,n),i=0,a=n.length;i{const{handDrawnSeed:e}=Fe();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),yx=x(t=>{const e=EYe([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),EYe=x(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),tV=x(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),zt=x(t=>{const{stylesArray:e}=yx(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];tV(o)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),o.includes("stroke")&&i.push(s.join(":")+" !important"),o==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),Wt=x((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Fe(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=yx(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:((l=s.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:AYe(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),AYe=x(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray"),CE={},Ji={},gK;function _Ye(){return gK||(gK=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.BLANK_URL=Ji.relativeFirstCharacters=Ji.whitespaceEscapeCharsRegex=Ji.urlSchemeRegex=Ji.ctrlCharactersRegex=Ji.htmlCtrlEntityRegex=Ji.htmlEntitiesRegex=Ji.invalidProtocolRegex=void 0,Ji.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Ji.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Ji.htmlCtrlEntityRegex=/&(newline|tab);/gi,Ji.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Ji.urlSchemeRegex=/^.+(:|:)/gim,Ji.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Ji.relativeFirstCharacters=[".","/"],Ji.BLANK_URL="about:blank"),Ji}var mK;function RYe(){if(mK)return CE;mK=1,Object.defineProperty(CE,"__esModule",{value:!0}),CE.sanitizeUrl=a;var t=_Ye();function e(s){return t.relativeFirstCharacters.indexOf(s[0])>-1}function r(s){var o=s.replace(t.ctrlCharactersRegex,"");return o.replace(t.htmlEntitiesRegex,function(l,u){return String.fromCharCode(u)})}function n(s){return URL.canParse(s)}function i(s){try{return decodeURIComponent(s)}catch{return s}}function a(s){if(!s)return t.BLANK_URL;var o,l=i(s.trim());do l=r(l).replace(t.htmlCtrlEntityRegex,"").replace(t.ctrlCharactersRegex,"").replace(t.whitespaceEscapeCharsRegex,"").trim(),l=i(l),o=l.match(t.ctrlCharactersRegex)||l.match(t.htmlEntitiesRegex)||l.match(t.htmlCtrlEntityRegex)||l.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var u=l;if(!u)return t.BLANK_URL;if(e(u))return u;var h=u.trimStart(),d=h.match(t.urlSchemeRegex);if(!d)return u;var f=d[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(f))return t.BLANK_URL;var p=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return p;if(f==="http:"||f==="https:"){if(!n(p))return t.BLANK_URL;var g=new URL(p);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return p}return CE}var ig=RYe();function LYe(t){return Array.isArray(t)}function HM(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function MYe(){}function ide(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Qk(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const ade="[object RegExp]",rV="[object String]",nV="[object Number]",iV="[object Boolean]",aV="[object Arguments]",sde="[object Symbol]",ode="[object Date]",lde="[object Map]",cde="[object Set]",ude="[object Array]",hde="[object ArrayBuffer]",dde="[object Object]",fde="[object DataView]",pde="[object Uint8Array]",gde="[object Uint8ClampedArray]",mde="[object Uint16Array]",yde="[object Uint32Array]",vde="[object Int8Array]",bde="[object Int16Array]",xde="[object Int32Array]",Tde="[object Float32Array]",wde="[object Float64Array]",yK=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function sV(t){return typeof yK.Buffer<"u"&&yK.Buffer.isBuffer(t)}function IYe(t){return Number.isSafeInteger(t)&&t>=0}function Cde(t){return t!=null&&typeof t!="function"&&IYe(t.length)}function NYe(t){return t==="__proto__"}function fR(t){return t==null||typeof t!="object"&&typeof t!="function"}function oV(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function DYe(t,e){return Um(t,void 0,t,new Map,e)}function Um(t,e,r,n=new Map,i=void 0){const a=i==null?void 0:i(t,e,r,n);if(a!==void 0)return a;if(fR(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const s=new Array(t.length);n.set(t,s);for(let o=0;o{if(typeof t=="object"){if(Qk(t)==="[object Object]"&&typeof t.constructor!="function"){const s={};return a.set(t,s),Nl(s,t,i,a),s}switch(Object.prototype.toString.call(t)){case nV:case rV:case iV:{const s=new t.constructor(t==null?void 0:t.valueOf());return Nl(s,t),s}case aV:{const s={};return Nl(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}}})}function vK(t){return $Ye(t)}function AO(t){return t!==null&&typeof t=="object"&&Qk(t)==="[object Arguments]"}function _O(t){return typeof t=="object"&&t!==null}function PYe(t){return _O(t)&&Cde(t)}function Bw(t){return oV(t)}function BYe(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function Jk(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");const r=function(...n){const i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);const s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(Jk.Cache||Map),r}Jk.Cache=Map;function FYe(t){if(fR(t))return t;const e=Qk(t);if(!zYe(t))return{};if(LYe(t)){const n=Array.from(t);return t.length>0&&typeof t[0]=="string"&&Object.hasOwn(t,"index")&&(n.index=t.index,n.input=t.input),n}if(Bw(t)){const n=t,i=n.constructor;return new i(n.buffer,n.byteOffset,n.length)}if(e==="[object ArrayBuffer]")return new ArrayBuffer(t.byteLength);if(e==="[object DataView]"){const n=t,i=n.buffer,a=n.byteOffset,s=n.byteLength,o=new ArrayBuffer(s),l=new Uint8Array(i,a,s);return new Uint8Array(o).set(l),new DataView(o)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?GYe(i,t):qM(i,t),i}if(e==="[object Date]")return new Date(Number(t));if(e==="[object RegExp]"){const n=t,i=new RegExp(n.source,n.flags);return i.lastIndex=n.lastIndex,i}if(e==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(t));if(e==="[object Map]"){const n=t,i=new Map;return n.forEach((a,s)=>{i.set(s,a)}),i}if(e==="[object Set]"){const n=t,i=new Set;return n.forEach(a=>{i.add(a)}),i}if(e==="[object Arguments]"){const n=t,i={};return qM(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return WYe(r,t),qM(r,t),VYe(r,t),r}function zYe(t){switch(Qk(t)){case aV:case ude:case hde:case fde:case iV:case ode:case Tde:case wde:case vde:case bde:case xde:case lde:case nV:case dde:case ade:case cde:case rV:case sde:case pde:case gde:case mde:case yde:return!0;default:return!1}}function qM(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function VYe(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function WYe(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function HYe(t){if(fR(t))return t;if(Array.isArray(t)||oV(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t);if(e==null)return Object.assign(Object.create(e),t);const r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let n;return t instanceof AggregateError?n=new r(t.errors,t.message,{cause:t.cause}):n=new r(t.message,{cause:t.cause}),n.stack=t.stack,Object.assign(n,t),n}return typeof File<"u"&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):typeof t=="object"?Object.assign(Object.create(e),t):t}function qYe(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let a=0;ar!=="constructor").length===0:e.length===0}return!0}var kde="​",YYe={curveBasis:DC,curveBasisClosed:dUe,curveBasisOpen:fUe,curveBumpX:nue,curveBumpY:iue,curveBundle:pUe,curveCardinalClosed:gUe,curveCardinalOpen:mUe,curveCardinal:lue,curveCatmullRomClosed:yUe,curveCatmullRomOpen:vUe,curveCatmullRom:uue,curveLinear:Pw,curveLinearClosed:bUe,curveMonotoneX:mue,curveMonotoneY:yue,curveNatural:bue,curveStep:xue,curveStepAfter:wue,curveStepBefore:Tue},XYe=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,jYe=x(function(t,e){const r=Sde(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);J5(s),n=Wi(n,[...s])}else n=r.args;if(!n)return;let i=kz(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),Sde=x(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${XYe.source})(?=[}][%]{2}).* -`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),le.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=Ow.exec(t))!==null;)if(a.index===Ow.lastIndex&&Ow.lastIndex++,a&&!e||e&&((r=a[1])!=null&&r.match(e))||e&&((n=a[2])!=null&&n.match(e))){const o=a[1]?a[1]:a[2],l=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;s.push({type:o,args:l})}return s.length===0?{type:t,args:null}:s.length===1?s[0]:s}catch(i){return le.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),KYe=x(function(t){return t.replace(Ow,"")},"removeDirectives"),ZYe=x(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function lV(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return YYe[r]??e}x(lV,"interpolateToCurve");function Ede(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?ig.sanitizeUrl(r):r}x(Ede,"formatUrl");var QYe=x((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s{r+=cV(i,e),e=i});const n=r/2;return uV(t,n)}x(Ade,"traverseEdge");function _de(t){return t.length===1?t[0]:Ade(t)}x(_de,"calcLabelPosition");var xK=x((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),uV=x((t,e)=>{let r,n=e;for(const i of t){if(r){const a=cV(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:xK((1-s)*r.x+s*i.x,5),y:xK((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),JYe=x((t,e,r)=>{le.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=uV(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(e[0].x+i.x)/2,o.y=-Math.cos(s)*a+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function Rde(t,e,r){const n=structuredClone(r);le.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=uV(n,i),s=10+t*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(l.x=Math.sin(o)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2),l}x(Rde,"calcTerminalLabelPosition");function hV(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}x(hV,"getStylesFromArray");var TK=0,Lde=x(()=>(TK++,"id-"+Math.random().toString(36).substr(2,12)+"-"+TK),"generateId");function Mde(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;iMde(t.length),"random"),eXe=x(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),tXe=x(function(t,e){const r=e.text.replace(At.lineBreakRegex," "),[,n]=Oh(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),Fw=Jk((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),At.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=zs(`${s} `,r),u=zs(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=rXe(s,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),rXe=Jk((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach((o,l)=>{const u=`${s}${o}`;if(zs(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),s=""}else s=u}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function RA(t,e){return pR(t,e).height}x(RA,"calculateTextHeight");function zs(t,e){return pR(t,e).width}x(zs,"calculateTextWidth");var pR=Jk((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=Oh(r),s=["sans-serif",n],o=t.split(At.lineBreakRegex),l=[],u=ut("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of s){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const y=eXe();y.text=m||kde;const v=tXe(h,y).style("font-size",a).style("font-weight",i).style("font-family",f),T=(v._groups||v)[0][0].getBBox();if(T.width===0&&T.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,T.width)),p=Math.round(T.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),Hy,nXe=(Hy=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},x(Hy,"InitIDGenerator"),Hy),kE,iXe=x(function(t){return kE=kE||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),kE.innerHTML=t,unescape(kE.textContent)},"entityDecode");function dV(t){return"str"in t}x(dV,"isDetailedError");var aXe=x((t,e,r,n)=>{var a;if(!n)return;const i=(a=t.node())==null?void 0:a.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),Oh=x(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function ri(t,e){return UYe({},t,e)}x(ri,"cleanAndMerge");var yr={assignWithDepth:Wi,wrapLabel:Fw,calculateTextHeight:RA,calculateTextWidth:zs,calculateTextDimensions:pR,cleanAndMerge:ri,detectInit:jYe,detectDirective:Sde,isSubstringInArray:ZYe,interpolateToCurve:lV,calcLabelPosition:_de,calcCardinalityPosition:JYe,calcTerminalLabelPosition:Rde,formatUrl:Ede,getStylesFromArray:hV,generateId:Lde,random:Ide,runFunc:QYe,entityDecode:iXe,insertTitle:aXe,isLabelCoordinateInPath:Nde,parseFontSize:Oh,InitIDGenerator:nXe},sXe=x(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),vh=x(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),dy=x((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function Ca(t){return t??null}x(Ca,"handleUndefinedAttr");function Nde(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}x(Nde,"isLabelCoordinateInPath");var vx=x(({flowchart:t})=>{var i,a;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((a=t==null?void 0:t.subGraphTitleMargin)==null?void 0:a.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins");async function fV(t,e){const r=t.getElementsByTagName("img");if(!r||r.length===0)return;const n=e.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(i=>new Promise(a=>{function s(){if(i.style.display="flex",i.style.flexDirection="column",n){const o=Fe().fontSize?Fe().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=Vr.fontSize]=Oh(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}x(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}x(fV,"configureLabelImages");const oXe=Object.freeze({left:0,top:0,width:16,height:16}),LA=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Dde=Object.freeze({...oXe,...LA}),lXe=Object.freeze({...Dde,body:"",hidden:!1}),cXe=Object.freeze({width:null,height:null}),uXe=Object.freeze({...cXe,...LA}),hXe=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:o};return UM(u)?u:null}const a=i[0],s=a.split("-");if(s.length>1){const o={provider:n,prefix:s.shift(),name:s.join("-")};return UM(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return UM(o,r)?o:null}return null},UM=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function dXe(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function wK(t,e){const r=dXe(t,e);for(const n in lXe)n in LA?n in t&&!(n in r)&&(r[n]=LA[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function fXe(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;const o=n[s]&&n[s].parent,l=o&&a(o);l&&(i[s]=[o].concat(l))}return i[s]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function CK(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=wK(n[o]||i[o],a)}return s(e),r.forEach(s),wK(t,a)}function pXe(t,e){if(t.icons[e])return CK(t,e,[]);const r=fXe(t,[e])[e];return r?CK(t,e,r):null}const gXe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,mXe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function kK(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(gXe);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=mXe.test(a);for(;;){if(s){const o=parseFloat(a);isNaN(o)?i.push(a):i.push(Math.ceil(o*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}function yXe(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function vXe(t,e){return t?""+t+""+e:e}function bXe(t,e,r){const n=yXe(t);return vXe(n.defs,e+n.content+r)}const xXe=t=>t==="unset"||t==="undefined"||t==="none";function TXe(t,e){const r={...Dde,...t},n={...uXe,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(m=>{const y=[],v=m.hFlip,T=m.vFlip;let b=m.rotate;v?T?b+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):T&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let w;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:w=i.height/2+i.top,y.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:w=i.width/2+i.left,y.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}b%2===1&&(i.left!==i.top&&(w=i.left,i.left=i.top,i.top=w),i.width!==i.height&&(w=i.width,i.width=i.height,i.height=w)),y.length&&(a=bXe(a,'',""))});const s=n.width,o=n.height,l=i.width,u=i.height;let h,d;s===null?(d=o===null?"1em":o==="auto"?u:o,h=kK(d,l/u)):(h=s==="auto"?l:s,d=o===null?kK(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{xXe(y)||(f[m]=y.toString())};p("width",h),p("height",d);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:a}}const wXe=/\sid="(\S+)"/g,SK=new Map;function CXe(t){t=t.replace(/[0-9]+$/,"")||"a";const e=SK.get(t)||0;return SK.set(t,e+1),e?`${t}${e}`:t}function kXe(t){const e=[];let r;for(;r=wXe.exec(t);)e.push(r[1]);if(!e.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(i=>{const a=CXe(i),s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function SXe(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+""}var Ode={body:'?',height:80,width:80},RO=new Map,$de=new Map,pV=x(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(le.debug("Registering icon pack:",e.name),"loader"in e)$de.set(e.name,e.loader);else if("icons"in e)RO.set(e.name,e.icons);else throw le.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Pde=x(async(t,e)=>{const r=hXe(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=RO.get(n);if(!i){const s=$de.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},RO.set(n,i)}catch(o){throw le.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=pXe(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),EXe=x(async t=>{try{return await Pde(t),!0}catch{return!1}},"isIconAvailable"),bh=x(async(t,e,r)=>{let n;try{n=await Pde(t,e==null?void 0:e.fallbackPrefix)}catch(s){le.error(s),n=Ode}const i=TXe(n,e),a=SXe(kXe(i.body),{...i.attributes,...r});return Wr(a,Xt())},"getIconSVG");function gV(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ag=gV();function Bde(t){ag=t}var zw={exec:()=>null};function pn(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace($s.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var AXe=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^
/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},_Xe=/^(?:[ \t]*(?:\n|$))+/,RXe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,LXe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,eS=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,MXe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,mV=/(?:[*+-]|\d{1,9}[.)])/,Fde=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zde=pn(Fde).replace(/bull/g,mV).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),IXe=pn(Fde).replace(/bull/g,mV).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),yV=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,NXe=/^[^\n]+/,vV=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,DXe=pn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vV).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),OXe=pn(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,mV).getRegex(),gR="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",bV=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,$Xe=pn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",bV).replace("tag",gR).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Vde=pn(yV).replace("hr",eS).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",gR).getRegex(),PXe=pn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Vde).getRegex(),xV={blockquote:PXe,code:RXe,def:DXe,fences:LXe,heading:MXe,hr:eS,html:$Xe,lheading:zde,list:OXe,newline:_Xe,paragraph:Vde,table:zw,text:NXe},EK=pn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",eS).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",gR).getRegex(),BXe={...xV,lheading:IXe,table:EK,paragraph:pn(yV).replace("hr",eS).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",EK).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",gR).getRegex()},FXe={...xV,html:pn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",bV).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:zw,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:pn(yV).replace("hr",eS).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",zde).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zXe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,VXe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Gde=/^( {2,}|\\)\n(?!\s*$)/,GXe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",AXe?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),qde=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,YXe=pn(qde,"u").replace(/punct/g,mR).getRegex(),XXe=pn(qde,"u").replace(/punct/g,Hde).getRegex(),Ude="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",jXe=pn(Ude,"gu").replace(/notPunctSpace/g,Wde).replace(/punctSpace/g,TV).replace(/punct/g,mR).getRegex(),KXe=pn(Ude,"gu").replace(/notPunctSpace/g,qXe).replace(/punctSpace/g,HXe).replace(/punct/g,Hde).getRegex(),ZXe=pn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Wde).replace(/punctSpace/g,TV).replace(/punct/g,mR).getRegex(),QXe=pn(/\\(punct)/,"gu").replace(/punct/g,mR).getRegex(),JXe=pn(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),eje=pn(bV).replace("(?:-->|$)","-->").getRegex(),tje=pn("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",eje).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),MA=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,rje=pn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",MA).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Yde=pn(/^!?\[(label)\]\[(ref)\]/).replace("label",MA).replace("ref",vV).getRegex(),Xde=pn(/^!?\[(ref)\](?:\[\])?/).replace("ref",vV).getRegex(),nje=pn("reflink|nolink(?!\\()","g").replace("reflink",Yde).replace("nolink",Xde).getRegex(),AK=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,wV={_backpedal:zw,anyPunctuation:QXe,autolink:JXe,blockSkip:UXe,br:Gde,code:VXe,del:zw,emStrongLDelim:YXe,emStrongRDelimAst:jXe,emStrongRDelimUnd:ZXe,escape:zXe,link:rje,nolink:Xde,punctuation:WXe,reflink:Yde,reflinkSearch:nje,tag:tje,text:GXe,url:zw},ije={...wV,link:pn(/^!?\[(label)\]\((.*?)\)/).replace("label",MA).getRegex(),reflink:pn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",MA).getRegex()},LO={...wV,emStrongRDelimAst:KXe,emStrongLDelim:XXe,url:pn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",AK).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:pn(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},_K=t=>sje[t];function Tc(t,e){if(e){if($s.escapeTest.test(t))return t.replace($s.escapeReplace,_K)}else if($s.escapeTestNoEncode.test(t))return t.replace($s.escapeReplaceNoEncode,_K);return t}function RK(t){try{t=encodeURI(t).replace($s.percentDecode,"%")}catch{return null}return t}function LK(t,e){var a;let r=t.replace($s.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split($s.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function MK(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function lje(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` +*/var EYe=x(t=>{const{handDrawnSeed:e}=Fe();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),yx=x(t=>{const e=AYe([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),AYe=x(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),tV=x(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),zt=x(t=>{const{stylesArray:e}=yx(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];tV(o)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),o.includes("stroke")&&i.push(s.join(":")+" !important"),o==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),Wt=x((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Fe(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=yx(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:((l=s.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:_Ye(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),_Ye=x(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray"),CE={},Ji={},gK;function RYe(){return gK||(gK=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.BLANK_URL=Ji.relativeFirstCharacters=Ji.whitespaceEscapeCharsRegex=Ji.urlSchemeRegex=Ji.ctrlCharactersRegex=Ji.htmlCtrlEntityRegex=Ji.htmlEntitiesRegex=Ji.invalidProtocolRegex=void 0,Ji.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Ji.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Ji.htmlCtrlEntityRegex=/&(newline|tab);/gi,Ji.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Ji.urlSchemeRegex=/^.+(:|:)/gim,Ji.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Ji.relativeFirstCharacters=[".","/"],Ji.BLANK_URL="about:blank"),Ji}var mK;function LYe(){if(mK)return CE;mK=1,Object.defineProperty(CE,"__esModule",{value:!0}),CE.sanitizeUrl=a;var t=RYe();function e(s){return t.relativeFirstCharacters.indexOf(s[0])>-1}function r(s){var o=s.replace(t.ctrlCharactersRegex,"");return o.replace(t.htmlEntitiesRegex,function(l,u){return String.fromCharCode(u)})}function n(s){return URL.canParse(s)}function i(s){try{return decodeURIComponent(s)}catch{return s}}function a(s){if(!s)return t.BLANK_URL;var o,l=i(s.trim());do l=r(l).replace(t.htmlCtrlEntityRegex,"").replace(t.ctrlCharactersRegex,"").replace(t.whitespaceEscapeCharsRegex,"").trim(),l=i(l),o=l.match(t.ctrlCharactersRegex)||l.match(t.htmlEntitiesRegex)||l.match(t.htmlCtrlEntityRegex)||l.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var u=l;if(!u)return t.BLANK_URL;if(e(u))return u;var h=u.trimStart(),d=h.match(t.urlSchemeRegex);if(!d)return u;var f=d[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(f))return t.BLANK_URL;var p=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return p;if(f==="http:"||f==="https:"){if(!n(p))return t.BLANK_URL;var g=new URL(p);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return p}return CE}var ig=LYe();function MYe(t){return Array.isArray(t)}function HM(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function IYe(){}function ade(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Qk(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const sde="[object RegExp]",rV="[object String]",nV="[object Number]",iV="[object Boolean]",aV="[object Arguments]",ode="[object Symbol]",lde="[object Date]",cde="[object Map]",ude="[object Set]",hde="[object Array]",dde="[object ArrayBuffer]",fde="[object Object]",pde="[object DataView]",gde="[object Uint8Array]",mde="[object Uint8ClampedArray]",yde="[object Uint16Array]",vde="[object Uint32Array]",bde="[object Int8Array]",xde="[object Int16Array]",Tde="[object Int32Array]",wde="[object Float32Array]",Cde="[object Float64Array]",yK=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function sV(t){return typeof yK.Buffer<"u"&&yK.Buffer.isBuffer(t)}function NYe(t){return Number.isSafeInteger(t)&&t>=0}function kde(t){return t!=null&&typeof t!="function"&&NYe(t.length)}function DYe(t){return t==="__proto__"}function fR(t){return t==null||typeof t!="object"&&typeof t!="function"}function oV(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function OYe(t,e){return Um(t,void 0,t,new Map,e)}function Um(t,e,r,n=new Map,i=void 0){const a=i==null?void 0:i(t,e,r,n);if(a!==void 0)return a;if(fR(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const s=new Array(t.length);n.set(t,s);for(let o=0;o{if(typeof t=="object"){if(Qk(t)==="[object Object]"&&typeof t.constructor!="function"){const s={};return a.set(t,s),Nl(s,t,i,a),s}switch(Object.prototype.toString.call(t)){case nV:case rV:case iV:{const s=new t.constructor(t==null?void 0:t.valueOf());return Nl(s,t),s}case aV:{const s={};return Nl(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}}})}function vK(t){return PYe(t)}function AO(t){return t!==null&&typeof t=="object"&&Qk(t)==="[object Arguments]"}function _O(t){return typeof t=="object"&&t!==null}function BYe(t){return _O(t)&&kde(t)}function Bw(t){return oV(t)}function FYe(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function Jk(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");const r=function(...n){const i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);const s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(Jk.Cache||Map),r}Jk.Cache=Map;function zYe(t){if(fR(t))return t;const e=Qk(t);if(!VYe(t))return{};if(MYe(t)){const n=Array.from(t);return t.length>0&&typeof t[0]=="string"&&Object.hasOwn(t,"index")&&(n.index=t.index,n.input=t.input),n}if(Bw(t)){const n=t,i=n.constructor;return new i(n.buffer,n.byteOffset,n.length)}if(e==="[object ArrayBuffer]")return new ArrayBuffer(t.byteLength);if(e==="[object DataView]"){const n=t,i=n.buffer,a=n.byteOffset,s=n.byteLength,o=new ArrayBuffer(s),l=new Uint8Array(i,a,s);return new Uint8Array(o).set(l),new DataView(o)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?WYe(i,t):qM(i,t),i}if(e==="[object Date]")return new Date(Number(t));if(e==="[object RegExp]"){const n=t,i=new RegExp(n.source,n.flags);return i.lastIndex=n.lastIndex,i}if(e==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(t));if(e==="[object Map]"){const n=t,i=new Map;return n.forEach((a,s)=>{i.set(s,a)}),i}if(e==="[object Set]"){const n=t,i=new Set;return n.forEach(a=>{i.add(a)}),i}if(e==="[object Arguments]"){const n=t,i={};return qM(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return HYe(r,t),qM(r,t),GYe(r,t),r}function VYe(t){switch(Qk(t)){case aV:case hde:case dde:case pde:case iV:case lde:case wde:case Cde:case bde:case xde:case Tde:case cde:case nV:case fde:case sde:case ude:case rV:case ode:case gde:case mde:case yde:case vde:return!0;default:return!1}}function qM(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function GYe(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function HYe(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function qYe(t){if(fR(t))return t;if(Array.isArray(t)||oV(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t);if(e==null)return Object.assign(Object.create(e),t);const r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let n;return t instanceof AggregateError?n=new r(t.errors,t.message,{cause:t.cause}):n=new r(t.message,{cause:t.cause}),n.stack=t.stack,Object.assign(n,t),n}return typeof File<"u"&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):typeof t=="object"?Object.assign(Object.create(e),t):t}function UYe(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let a=0;ar!=="constructor").length===0:e.length===0}return!0}var Sde="​",XYe={curveBasis:DC,curveBasisClosed:fUe,curveBasisOpen:pUe,curveBumpX:iue,curveBumpY:aue,curveBundle:gUe,curveCardinalClosed:mUe,curveCardinalOpen:yUe,curveCardinal:cue,curveCatmullRomClosed:vUe,curveCatmullRomOpen:bUe,curveCatmullRom:hue,curveLinear:Pw,curveLinearClosed:xUe,curveMonotoneX:yue,curveMonotoneY:vue,curveNatural:xue,curveStep:Tue,curveStepAfter:Cue,curveStepBefore:wue},jYe=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,KYe=x(function(t,e){const r=Ede(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);J5(s),n=Wi(n,[...s])}else n=r.args;if(!n)return;let i=kz(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),Ede=x(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${jYe.source})(?=[}][%]{2}).* +`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),le.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=Ow.exec(t))!==null;)if(a.index===Ow.lastIndex&&Ow.lastIndex++,a&&!e||e&&((r=a[1])!=null&&r.match(e))||e&&((n=a[2])!=null&&n.match(e))){const o=a[1]?a[1]:a[2],l=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;s.push({type:o,args:l})}return s.length===0?{type:t,args:null}:s.length===1?s[0]:s}catch(i){return le.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),ZYe=x(function(t){return t.replace(Ow,"")},"removeDirectives"),QYe=x(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function lV(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return XYe[r]??e}x(lV,"interpolateToCurve");function Ade(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?ig.sanitizeUrl(r):r}x(Ade,"formatUrl");var JYe=x((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s{r+=cV(i,e),e=i});const n=r/2;return uV(t,n)}x(_de,"traverseEdge");function Rde(t){return t.length===1?t[0]:_de(t)}x(Rde,"calcLabelPosition");var xK=x((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),uV=x((t,e)=>{let r,n=e;for(const i of t){if(r){const a=cV(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:xK((1-s)*r.x+s*i.x,5),y:xK((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),eXe=x((t,e,r)=>{le.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=uV(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(e[0].x+i.x)/2,o.y=-Math.cos(s)*a+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function Lde(t,e,r){const n=structuredClone(r);le.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=uV(n,i),s=10+t*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(l.x=Math.sin(o)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2),l}x(Lde,"calcTerminalLabelPosition");function hV(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}x(hV,"getStylesFromArray");var TK=0,Mde=x(()=>(TK++,"id-"+Math.random().toString(36).substr(2,12)+"-"+TK),"generateId");function Ide(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;iIde(t.length),"random"),tXe=x(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),rXe=x(function(t,e){const r=e.text.replace(At.lineBreakRegex," "),[,n]=Oh(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),Fw=Jk((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),At.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=zs(`${s} `,r),u=zs(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=nXe(s,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),nXe=Jk((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach((o,l)=>{const u=`${s}${o}`;if(zs(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),s=""}else s=u}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function RA(t,e){return pR(t,e).height}x(RA,"calculateTextHeight");function zs(t,e){return pR(t,e).width}x(zs,"calculateTextWidth");var pR=Jk((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=Oh(r),s=["sans-serif",n],o=t.split(At.lineBreakRegex),l=[],u=ut("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of s){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const y=tXe();y.text=m||Sde;const v=rXe(h,y).style("font-size",a).style("font-weight",i).style("font-family",f),T=(v._groups||v)[0][0].getBBox();if(T.width===0&&T.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,T.width)),p=Math.round(T.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),Hy,iXe=(Hy=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},x(Hy,"InitIDGenerator"),Hy),kE,aXe=x(function(t){return kE=kE||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),kE.innerHTML=t,unescape(kE.textContent)},"entityDecode");function dV(t){return"str"in t}x(dV,"isDetailedError");var sXe=x((t,e,r,n)=>{var a;if(!n)return;const i=(a=t.node())==null?void 0:a.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),Oh=x(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function ri(t,e){return YYe({},t,e)}x(ri,"cleanAndMerge");var yr={assignWithDepth:Wi,wrapLabel:Fw,calculateTextHeight:RA,calculateTextWidth:zs,calculateTextDimensions:pR,cleanAndMerge:ri,detectInit:KYe,detectDirective:Ede,isSubstringInArray:QYe,interpolateToCurve:lV,calcLabelPosition:Rde,calcCardinalityPosition:eXe,calcTerminalLabelPosition:Lde,formatUrl:Ade,getStylesFromArray:hV,generateId:Mde,random:Nde,runFunc:JYe,entityDecode:aXe,insertTitle:sXe,isLabelCoordinateInPath:Dde,parseFontSize:Oh,InitIDGenerator:iXe},oXe=x(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),vh=x(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),dy=x((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function ka(t){return t??null}x(ka,"handleUndefinedAttr");function Dde(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}x(Dde,"isLabelCoordinateInPath");var vx=x(({flowchart:t})=>{var i,a;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((a=t==null?void 0:t.subGraphTitleMargin)==null?void 0:a.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins");async function fV(t,e){const r=t.getElementsByTagName("img");if(!r||r.length===0)return;const n=e.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(i=>new Promise(a=>{function s(){if(i.style.display="flex",i.style.flexDirection="column",n){const o=Fe().fontSize?Fe().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=Vr.fontSize]=Oh(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}x(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}x(fV,"configureLabelImages");const lXe=Object.freeze({left:0,top:0,width:16,height:16}),LA=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ode=Object.freeze({...lXe,...LA}),cXe=Object.freeze({...Ode,body:"",hidden:!1}),uXe=Object.freeze({width:null,height:null}),hXe=Object.freeze({...uXe,...LA}),dXe=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:o};return UM(u)?u:null}const a=i[0],s=a.split("-");if(s.length>1){const o={provider:n,prefix:s.shift(),name:s.join("-")};return UM(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return UM(o,r)?o:null}return null},UM=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function fXe(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function wK(t,e){const r=fXe(t,e);for(const n in cXe)n in LA?n in t&&!(n in r)&&(r[n]=LA[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function pXe(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;const o=n[s]&&n[s].parent,l=o&&a(o);l&&(i[s]=[o].concat(l))}return i[s]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function CK(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=wK(n[o]||i[o],a)}return s(e),r.forEach(s),wK(t,a)}function gXe(t,e){if(t.icons[e])return CK(t,e,[]);const r=pXe(t,[e])[e];return r?CK(t,e,r):null}const mXe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,yXe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function kK(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(mXe);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=yXe.test(a);for(;;){if(s){const o=parseFloat(a);isNaN(o)?i.push(a):i.push(Math.ceil(o*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}function vXe(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function bXe(t,e){return t?""+t+""+e:e}function xXe(t,e,r){const n=vXe(t);return bXe(n.defs,e+n.content+r)}const TXe=t=>t==="unset"||t==="undefined"||t==="none";function wXe(t,e){const r={...Ode,...t},n={...hXe,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(m=>{const y=[],v=m.hFlip,T=m.vFlip;let b=m.rotate;v?T?b+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):T&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let w;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:w=i.height/2+i.top,y.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:w=i.width/2+i.left,y.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}b%2===1&&(i.left!==i.top&&(w=i.left,i.left=i.top,i.top=w),i.width!==i.height&&(w=i.width,i.width=i.height,i.height=w)),y.length&&(a=xXe(a,'',""))});const s=n.width,o=n.height,l=i.width,u=i.height;let h,d;s===null?(d=o===null?"1em":o==="auto"?u:o,h=kK(d,l/u)):(h=s==="auto"?l:s,d=o===null?kK(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{TXe(y)||(f[m]=y.toString())};p("width",h),p("height",d);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:a}}const CXe=/\sid="(\S+)"/g,SK=new Map;function kXe(t){t=t.replace(/[0-9]+$/,"")||"a";const e=SK.get(t)||0;return SK.set(t,e+1),e?`${t}${e}`:t}function SXe(t){const e=[];let r;for(;r=CXe.exec(t);)e.push(r[1]);if(!e.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(i=>{const a=kXe(i),s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function EXe(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+""}var $de={body:'?',height:80,width:80},RO=new Map,Pde=new Map,pV=x(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(le.debug("Registering icon pack:",e.name),"loader"in e)Pde.set(e.name,e.loader);else if("icons"in e)RO.set(e.name,e.icons);else throw le.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Bde=x(async(t,e)=>{const r=dXe(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=RO.get(n);if(!i){const s=Pde.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},RO.set(n,i)}catch(o){throw le.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=gXe(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),AXe=x(async t=>{try{return await Bde(t),!0}catch{return!1}},"isIconAvailable"),bh=x(async(t,e,r)=>{let n;try{n=await Bde(t,e==null?void 0:e.fallbackPrefix)}catch(s){le.error(s),n=$de}const i=wXe(n,e),a=EXe(SXe(i.body),{...i.attributes,...r});return Wr(a,Xt())},"getIconSVG");function gV(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ag=gV();function Fde(t){ag=t}var zw={exec:()=>null};function pn(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace($s.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var _Xe=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^
/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},RXe=/^(?:[ \t]*(?:\n|$))+/,LXe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,MXe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,eS=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,IXe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,mV=/(?:[*+-]|\d{1,9}[.)])/,zde=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Vde=pn(zde).replace(/bull/g,mV).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),NXe=pn(zde).replace(/bull/g,mV).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),yV=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,DXe=/^[^\n]+/,vV=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,OXe=pn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vV).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$Xe=pn(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,mV).getRegex(),gR="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",bV=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,PXe=pn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",bV).replace("tag",gR).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Gde=pn(yV).replace("hr",eS).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",gR).getRegex(),BXe=pn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Gde).getRegex(),xV={blockquote:BXe,code:LXe,def:OXe,fences:MXe,heading:IXe,hr:eS,html:PXe,lheading:Vde,list:$Xe,newline:RXe,paragraph:Gde,table:zw,text:DXe},EK=pn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",eS).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",gR).getRegex(),FXe={...xV,lheading:NXe,table:EK,paragraph:pn(yV).replace("hr",eS).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",EK).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",gR).getRegex()},zXe={...xV,html:pn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",bV).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:zw,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:pn(yV).replace("hr",eS).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Vde).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},VXe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,GXe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Wde=/^( {2,}|\\)\n(?!\s*$)/,WXe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",_Xe?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ude=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,XXe=pn(Ude,"u").replace(/punct/g,mR).getRegex(),jXe=pn(Ude,"u").replace(/punct/g,qde).getRegex(),Yde="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",KXe=pn(Yde,"gu").replace(/notPunctSpace/g,Hde).replace(/punctSpace/g,TV).replace(/punct/g,mR).getRegex(),ZXe=pn(Yde,"gu").replace(/notPunctSpace/g,UXe).replace(/punctSpace/g,qXe).replace(/punct/g,qde).getRegex(),QXe=pn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Hde).replace(/punctSpace/g,TV).replace(/punct/g,mR).getRegex(),JXe=pn(/\\(punct)/,"gu").replace(/punct/g,mR).getRegex(),eje=pn(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),tje=pn(bV).replace("(?:-->|$)","-->").getRegex(),rje=pn("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",tje).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),MA=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,nje=pn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",MA).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Xde=pn(/^!?\[(label)\]\[(ref)\]/).replace("label",MA).replace("ref",vV).getRegex(),jde=pn(/^!?\[(ref)\](?:\[\])?/).replace("ref",vV).getRegex(),ije=pn("reflink|nolink(?!\\()","g").replace("reflink",Xde).replace("nolink",jde).getRegex(),AK=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,wV={_backpedal:zw,anyPunctuation:JXe,autolink:eje,blockSkip:YXe,br:Wde,code:GXe,del:zw,emStrongLDelim:XXe,emStrongRDelimAst:KXe,emStrongRDelimUnd:QXe,escape:VXe,link:nje,nolink:jde,punctuation:HXe,reflink:Xde,reflinkSearch:ije,tag:rje,text:WXe,url:zw},aje={...wV,link:pn(/^!?\[(label)\]\((.*?)\)/).replace("label",MA).getRegex(),reflink:pn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",MA).getRegex()},LO={...wV,emStrongRDelimAst:ZXe,emStrongLDelim:jXe,url:pn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",AK).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:pn(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},_K=t=>oje[t];function Tc(t,e){if(e){if($s.escapeTest.test(t))return t.replace($s.escapeReplace,_K)}else if($s.escapeTestNoEncode.test(t))return t.replace($s.escapeReplaceNoEncode,_K);return t}function RK(t){try{t=encodeURI(t).replace($s.percentDecode,"%")}catch{return null}return t}function LK(t,e){var a;let r=t.replace($s.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split($s.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function MK(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function cje(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` `).map(a=>{let s=a.match(r.other.beginningSpace);if(s===null)return a;let[o]=s;return o.length>=i.length?a.slice(i.length):a}).join(` `)}var IA=class{constructor(e){jt(this,"options");jt(this,"rules");jt(this,"lexer");this.options=e||ag}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:oT(n,` -`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=lje(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=oT(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:oT(r[0],` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=cje(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=oT(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:oT(r[0],` `)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=oT(r[0],` `).split(` `),i="",a="",s=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;uf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=d}if(a.loose)for(let u=0;u({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[h]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` -`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=oT(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=oje(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),MK(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return MK(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},Fl=class MO{constructor(e){jt(this,"tokens");jt(this,"options");jt(this,"state");jt(this,"tokenizer");jt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ag,this.options.tokenizer=this.options.tokenizer||new IA,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:$s,block:SE.normal,inline:sT.normal};this.options.pedantic?(r.block=SE.pedantic,r.inline=sT.pedantic):this.options.gfm&&(r.block=SE.gfm,this.options.breaks?r.inline=sT.breaks:r.inline=sT.gfm),this.tokenizer.rules=r}static get rules(){return{block:SE,inline:sT}}static lex(e,r){return new MO(r).lex(e)}static lexInline(e,r){return new MO(r).inlineTokens(e)}lex(e){e=e.replace($s.carriageReturn,` +`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=oT(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=lje(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),MK(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return MK(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},Fl=class MO{constructor(e){jt(this,"tokens");jt(this,"options");jt(this,"state");jt(this,"tokenizer");jt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ag,this.options.tokenizer=this.options.tokenizer||new IA,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:$s,block:SE.normal,inline:sT.normal};this.options.pedantic?(r.block=SE.pedantic,r.inline=sT.pedantic):this.options.gfm&&(r.block=SE.gfm,this.options.breaks?r.inline=sT.breaks:r.inline=sT.gfm),this.tokenizer.rules=r}static get rules(){return{block:SE,inline:sT}}static lex(e,r){return new MO(r).lex(e)}static lexInline(e,r){return new MO(r).inlineTokens(e)}lex(e){e=e.replace($s.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let r=0;r(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=` `:r.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` @@ -439,27 +439,27 @@ ${this.parser.parse(e)} ${e} `}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+` `}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${Tc(e,!0)}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=RK(e);if(a===null)return i;e=a;let s='
",s}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=RK(e);if(a===null)return Tc(n);e=a;let s=`${n}{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new NA(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new IA(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new UT;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=a[o];UT.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&UT.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(a,h);return u.call(a,f)})();let d=l.call(a,h);return u.call(a,d)}:a[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(a,h);return f===!1&&(f=await u.apply(a,h)),f})();let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return Fl.lex(e,r??this.defaults)}parser(e,r){return zl.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer():e?Fl.lex:Fl.lexInline)(o,a),u=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(u,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser():e?zl.parse:zl.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let o=(a.hooks?a.hooks.provideLexer():e?Fl.lex:Fl.lexInline)(r,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let l=(a.hooks?a.hooks.provideParser():e?zl.parse:zl.parseInline)(o,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(e,r){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let i="

An error occurred:

"+Tc(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},D0=new cje;function wn(t,e){return D0.parse(t,e)}wn.options=wn.setOptions=function(t){return D0.setOptions(t),wn.defaults=D0.defaults,Bde(wn.defaults),wn};wn.getDefaults=gV;wn.defaults=ag;wn.use=function(...t){return D0.use(...t),wn.defaults=D0.defaults,Bde(wn.defaults),wn};wn.walkTokens=function(t,e){return D0.walkTokens(t,e)};wn.parseInline=D0.parseInline;wn.Parser=zl;wn.parser=zl.parse;wn.Renderer=NA;wn.TextRenderer=CV;wn.Lexer=Fl;wn.lexer=Fl.lex;wn.Tokenizer=IA;wn.Hooks=UT;wn.parse=wn;wn.options;wn.setOptions;wn.use;wn.walkTokens;wn.parseInline;zl.parse;Fl.lex;function jde(t){for(var e=[],r=1;r{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new NA(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new IA(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new UT;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=a[o];UT.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&UT.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(a,h);return u.call(a,f)})();let d=l.call(a,h);return u.call(a,d)}:a[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(a,h);return f===!1&&(f=await u.apply(a,h)),f})();let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return Fl.lex(e,r??this.defaults)}parser(e,r){return zl.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer():e?Fl.lex:Fl.lexInline)(o,a),u=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(u,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser():e?zl.parse:zl.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let o=(a.hooks?a.hooks.provideLexer():e?Fl.lex:Fl.lexInline)(r,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let l=(a.hooks?a.hooks.provideParser():e?zl.parse:zl.parseInline)(o,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(e,r){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let i="

An error occurred:

"+Tc(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},D0=new uje;function wn(t,e){return D0.parse(t,e)}wn.options=wn.setOptions=function(t){return D0.setOptions(t),wn.defaults=D0.defaults,Fde(wn.defaults),wn};wn.getDefaults=gV;wn.defaults=ag;wn.use=function(...t){return D0.use(...t),wn.defaults=D0.defaults,Fde(wn.defaults),wn};wn.walkTokens=function(t,e){return D0.walkTokens(t,e)};wn.parseInline=D0.parseInline;wn.Parser=zl;wn.parser=zl.parse;wn.Renderer=NA;wn.TextRenderer=CV;wn.Lexer=Fl;wn.lexer=Fl.lex;wn.Tokenizer=IA;wn.Hooks=UT;wn.parse=wn;wn.options;wn.setOptions;wn.use;wn.walkTokens;wn.parseInline;zl.parse;Fl.lex;function Kde(t){for(var e=[],r=1;r/g,` +`)),s+=d+n[l+1]}),s}function Zde(t,{markdownAutoWrap:e}){const n=t.replace(//g,` `).replace(/\n{2,}/g,` -`);return jde(n)}x(Kde,"preprocessMarkdown");function Zde(t){return t.split(/\\n|\n|/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}x(Zde,"nonMarkdownToLines");function Qde(t,e={}){const r=Kde(t,e),n=wn.lexer(r),i=[[]];let a=0;function s(o,l="normal"){o.type==="text"?o.text.split(` -`).forEach((h,d)=>{d!==0&&(a++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[a].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{s(u,o.type)}):o.type==="html"&&i[a].push({content:o.text,type:"normal"})}return x(s,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{s(u)}):o.type==="html"?i[a].push({content:o.text,type:"normal"}):i[a].push({content:o.raw,type:"normal"})}),i}x(Qde,"markdownToLines");function Jde(t){return t?`

${t.replace(/\\n|\n/g,"
")}

`:""}x(Jde,"nonMarkdownToHTML");function efe(t,{markdownAutoWrap:e}={}){const r=wn.lexer(t);function n(i){var a,s,o;return i.type==="text"?e===!1?i.text.replace(/\n */g,"
").replace(/ /g," "):i.text.replace(/\n */g,"
"):i.type==="strong"?`${(a=i.tokens)==null?void 0:a.map(n).join("")}`:i.type==="em"?`${(s=i.tokens)==null?void 0:s.map(n).join("")}`:i.type==="paragraph"?`

${(o=i.tokens)==null?void 0:o.map(n).join("")}

`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(le.warn(`Unsupported markdown: ${i.type}`),i.raw)}return x(n,"output"),r.map(n).join("")}x(efe,"markdownToHTML");function tfe(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}x(tfe,"splitTextToChars");function rfe(t,e){const r=tfe(e.content);return kV(t,[],r,e.type)}x(rfe,"splitWordToFitWidth");function kV(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?kV(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}x(kV,"splitWordToFitWidthRecursion");function nfe(t,e){if(t.some(({content:r})=>r.includes(` -`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return DA(t,e)}x(nfe,"splitLineToFitWidth");function DA(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),e(s))return DA(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[o,l]=rfe(e,a);r.push([o]),l.content&&t.unshift(l)}return DA(t,e,r)}x(DA,"splitLineToFitWidthRecursion");function NO(t,e){e&&t.attr("style",e)}x(NO,"applyStyle");var IK=16384;async function ife(t,e,r,n,i=!1,a=Xt()){const s=t.append("foreignObject");s.attr("width",`${Math.min(10*r,IK)}px`),s.attr("height",`${Math.min(10*r,IK)}px`);const o=s.append("xhtml:div"),l=$i(e.label)?await eR(e.label.replace(At.lineBreakRegex,` -`),a):Wr(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),NO(h,e.labelStyle),h.attr("class",`${u} ${n}`),NO(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),s.node()}x(ife,"addHtmlSpan");function yR(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}x(yR,"createTspan");function afe(t,e,r){const n=t.append("text"),i=yR(n,1,e);vR(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}x(afe,"computeWidthOfText");function sfe(t,e,r){var s;const n=t.append("text"),i=yR(n,1,e);vR(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}x(sfe,"computeDimensionOfText");function ofe(t,e,r,n=!1,i=!1){const s=e.append("g"),o=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=x(p=>afe(s,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:nfe(h,d);for(const p of f){const g=yR(l,u,1.1,i);vR(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}x(ofe,"createFormattedText");function DO(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}x(DO,"decodeHTMLEntities");function vR(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(DO(r.content)):i.text(" "+DO(r.content))})}x(vR,"updateTextContentAndStyles");async function lfe(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await EXe(o)?await bh(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}x(lfe,"replaceIconSubstring");var ws=x(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:s=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(le.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",u),a){const d=s?efe(e,h):Jde(e),f=await lfe(vh(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:$i(e)?p:f,labelStyle:r.replace("fill:","color:")};return await ife(t,g,l,i,u,h)}else{const d=vh(e.replace(//g,"
")),f=s?Qde(d.replace("
","
"),h):Zde(d),p=ofe(l,t,f,e?u:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ut(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");ut(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ut(p).select("text").attr("style",m)}return n?ut(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):ut(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function YM(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),o=Math.sin(a);for(const l of t){const[u,h]=l;l[0]=(u-n)*s-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*s+i}}}function uje(t,e){return t[0]===e[0]&&t[1]===e[1]}function hje(t,e,r,n=1){const i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of s)YM(u,o,i);const l=(function(u,h,d){const f=[];for(const T of u){const b=[...T];uje(b[0],b[b.length-1])||b.push([b[0][0],b[0][1]]),b.length>2&&f.push(b)}const p=[];h=Math.max(h,.1);const g=[];for(const T of f)for(let b=0;bT.yminb.ymin?1:T.xb.x?1:T.ymax===b.ymax?0:(T.ymax-b.ymax)/Math.abs(T.ymax-b.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let T=-1;for(let b=0;by);b++)T=b;g.splice(0,T+1).forEach((b=>{m.push({s:y,edge:b})}))}if(m=m.filter((T=>!(T.edge.ymax<=y))),m.sort(((T,b)=>T.edge.x===b.edge.x?0:(T.edge.x-b.edge.x)/Math.abs(T.edge.x-b.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let T=0;T=m.length)break;const w=m[T].edge,C=m[b].edge;p.push([[Math.round(w.x),y],[Math.round(C.x),y]])}y+=d,m.forEach((T=>{T.edge.x=T.edge.x+d*T.edge.islope})),v++}return p})(s,a,n);if(i){for(const u of s)YM(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),YM(f,h,d)})(l,o,-i)}return l}function tS(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),hje(t,i,n,a||1)}class SV{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=tS(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function bR(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class dje extends SV{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=tS(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],o=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(const[u,h]of i)bR([u,h])&&s.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class fje extends SV{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,i);return n.ops=n.ops.concat(a.ops),n}}let pje=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=tS(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=i/4;for(const o of e){const l=bR(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g{const o=bR(s),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const s=bR(a),o=Math.round(s/(2*r));let l=a[0],u=a[1];l[0]>u[0]&&(l=a[1],u=a[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;dh%2?u+r:u+e));a.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":a.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function ufe(t){const e=[];let r="",n=0,i=0,a=0,s=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,y=i+2*(g-i)/3,v=d+2*(p-d)/3,T=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,T,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,y=i+2*(f-i)/3,v=p+2*(d-p)/3,T=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,T,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],y=h[5],v=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,y,v,y,v]}),n=y,i=v):(n!==y||i!==v)&&(hfe(n,i,y,v,d,f,p,g,m).forEach((function(T){e.push({key:"C",data:T})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function lT(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function hfe(t,e,r,n,i,a,s,o,l,u){const h=(d=s,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,y=0;if(u)[p,g,m,y]=u;else{[t,e]=lT(t,e,-h),[r,n]=lT(r,n,-h);const D=(t-r)/2,R=(e-n)/2;let I=D*D/(i*i)+R*R/(a*a);I>1&&(I=Math.sqrt(I),i*=I,a*=I);const $=i*i,O=a*a,N=$*O-$*R*R-O*D*D,F=$*R*R+O*D*D,z=(o===l?-1:1)*Math.sqrt(Math.abs(N/F));m=z*i*R/a+(t+r)/2,y=z*-a*D/i+(e+n)/2,p=Math.asin(parseFloat(((e-y)/a).toFixed(9))),g=Math.asin(parseFloat(((n-y)/a).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let v=g-p;if(Math.abs(v)>120*Math.PI/180){const D=g,R=r,I=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=hfe(r=m+i*Math.cos(g),n=y+a*Math.sin(g),R,I,i,a,s,0,l,[g,D,m,y])}v=g-p;const T=Math.cos(p),b=Math.sin(p),w=Math.cos(g),C=Math.sin(g),S=Math.tan(v/4),k=4/3*i*S,E=4/3*a*S,_=[t,e],M=[t+k*b,e-E*T],L=[r+k*C,n-E*w],P=[r,n];if(M[0]=2*_[0]-M[0],M[1]=2*_[1]-M[1],u)return[M,L,P].concat(f);{f=[M,L,P].concat(f);const D=[];for(let R=0;R2){const i=[];for(let a=0;a2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-p)/2),v=FK(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const T=FK(y,u,h,d,f,p,g,1.5,l);v.push(...T)}return s&&(o?v.push(...tf(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...tf(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):v.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:v}}function $K(t,e){const r=ufe(cfe(EV(t))),n=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of r)switch(s){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...tf(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...Tje(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...tf(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function KM(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+wr(i,e),n[0][1]+wr(i,e)]});for(let s=1;s500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*pfe(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=wr(p,i,u),g=wr(g,i,u);const m=[],y=()=>wr(d,i,u),v=()=>wr(h,i,u),T=i.preserveVertices;return s?m.push({op:"move",data:[t+(T?0:y()),e+(T?0:y())]}):m.push({op:"move",data:[t+(T?0:wr(h,i,u)),e+(T?0:wr(h,i,u))]}),s?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(T?0:y()),n+(T?0:y())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(T?0:v()),n+(T?0:v())]}),m}function AE(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+wr(e,r),t[0][1]+wr(e,r)]),n.push([t[0][0]+wr(e,r),t[0][1]+wr(e,r)]);for(let i=1;i3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+21&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=op(l,u,.5),p=op(u,h,.5),g=op(h,d,.5),m=op(f,p,.5),y=op(p,g,.5),v=op(m,y,.5);PO([l,f,m,v],0,r,i),PO([v,y,g,d],0,r,i)}var a,s;return i}function Cje(t,e){return PA(t,0,t.length,e)}function PA(t,e,r,n,i){const a=i||[],s=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(PA(t,e,u+1,n,a),PA(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function ZM(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?PA(n,0,n.length,r):n}const Ao="none";class BA{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,a){const s=this._o(a);return this._d("line",[dfe(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=xje(e,r,n,i,s);if(s.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];s.fillStyle==="solid"?o.push(KM([u],s)):o.push(qg([u],s))}return s.stroke!==Ao&&o.push(l),this._d("rectangle",o,s)}ellipse(e,r,n,i,a){const s=this._o(a),o=[],l=ffe(n,i,s),u=OO(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=OO(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(qg([u.estimatedPoints],s));return s.stroke!==Ao&&o.push(u.opset),this._d("ellipse",o,s)}circle(e,r,n,i){const a=this.ellipse(e,r,n,n,i);return a.shape="circle",a}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[Z4(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=OK(e,r,n,i,a,s,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=OK(e,r,n,i,a,s,!0,!1,f);p.type="fillPath",h.push(p)}else h.push((function(f,p,g,m,y,v,T){const b=f,w=p;let C=Math.abs(g/2),S=Math.abs(m/2);C+=wr(.01*C,T),S+=wr(.01*S,T);let k=y,E=v;for(;k<0;)k+=2*Math.PI,E+=2*Math.PI;E-k>2*Math.PI&&(k=0,E=2*Math.PI);const _=(E-k)/T.curveStepCount,M=[];for(let L=k;L<=E;L+=_)M.push([b+C*Math.cos(L),w+S*Math.sin(L)]);return M.push([b+C*Math.cos(E),w+S*Math.sin(E)]),M.push([b,w]),qg([M],T)})(e,r,n,i,a,s,u));return u.stroke!==Ao&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=DK(e,n);if(n.fill&&n.fill!==Ao)if(n.fillStyle==="solid"){const s=DK(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?s.push(...u):u.length===3?s.push(...ZM(zK([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...ZM(zK(u),10,(1+n.roughness)/2))}s.length&&i.push(qg([s],n))}return n.stroke!==Ao&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=Z4(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(KM([e],n)):i.push(qg([e],n))),n.stroke!==Ao&&i.push(a),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=n.fill&&n.fill!=="transparent"&&n.fill!==Ao,s=n.stroke!==Ao,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=ufe(cfe(EV(h))),g=[];let m=[],y=[0,0],v=[];const T=()=>{v.length>=4&&m.push(...ZM(v,d)),v=[]},b=()=>{T(),m.length&&(g.push(m),m=[])};for(const{key:C,data:S}of p)switch(C){case"M":b(),y=[S[0],S[1]],m.push(y);break;case"L":T(),m.push([S[0],S[1]]);break;case"C":if(!v.length){const k=m.length?m[m.length-1]:y;v.push([k[0],k[1]])}v.push([S[0],S[1]]),v.push([S[2],S[3]]),v.push([S[4],S[5]]);break;case"Z":T(),m.push([y[0],y[1]])}if(b(),!f)return g;const w=[];for(const C of g){const S=Cje(C,f);S.length&&w.push(S)}return w})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=$K(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=$K(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(KM(l,n));else i.push(qg(l,n));return s&&(o?l.forEach((h=>{i.push(Z4(h,!1,n))})):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const a=typeof r=="number"&&r>=0?i.data.map((s=>+s.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Ao};break;case"fillPath":s={d:this.opsToPath(a),stroke:Ao,strokeWidth:0,fill:n.fill||Ao};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Ao,strokeWidth:n,fill:Ao}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}}class kje{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new BA(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const a of r.ops){const s=typeof n=="number"&&n>=0?a.data.map((o=>+o.toFixed(n))):a.data;switch(a.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s),s}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s),s}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s),s}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a),a}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const _E="http://www.w3.org/2000/svg";class Sje{constructor(e,r){this.svg=e,this.gen=new BA(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(_E,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(_E,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(_E,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&a.appendChild(l)}return a}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const a=e.createElementNS(_E,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s)}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s)}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s)}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var Gt={canvas:(t,e)=>new kje(t,e),svg:(t,e)=>new Sje(t,e),generator:t=>new BA(t),newSeed:()=>BA.newSeed()},xr=x(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||su((p=Fe())==null?void 0:p.htmlLabels);r?n=r:n="node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",Ca(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await ws(s,Wr(vh(o),Fe()),{useHtmlLabels:i,width:e.width||((g=Fe().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},Fe());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],y=ut(h);await fV(m,o),d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height)}return i?s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):s.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:d,halfPadding:f,label:s}},"labelHelper"),QM=x(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??xn(Fe()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await ws(i,Wr(vh(e),Fe()),{useHtmlLabels:n,width:r.width||((u=(l=Fe())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=a.getBBox();const o=r.padding/2;if(xn(Fe())){const h=a.children[0],d=ut(a);s=h.getBoundingClientRect(),d.attr("width",s.width),d.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:o,label:i}},"insertLabel"),Kt=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),fr=x((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Zr(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}x(Zr,"createPathFromPoints");function rf(t,e,r,n,i,a){const s=[],l=r-t,u=n-e,h=l/a,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,y=f+i*Math.sin(d*(m-t));s.push({x:m,y})}return s}x(rf,"generateFullSineWavePoints");function FC(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),a=e.find(l=>l.getAttribute("stroke")!=="none"),s=x((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:s(i,"fill"),"fill-opacity":s(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}x(BO,"mergePaths");var Eje=x((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),sg=Eje,Aje=x(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Fe(),o=xn(s);return await ws(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Rd=Aje,wf=x((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),_je=x(async(t,e)=>{const r=Fe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,o=s,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=zt(e),f=t.insert("g").attr("class","cluster swimlane "+(e.cssClasses||"")).attr("id",e.id).attr("data-id",e.id).attr("data-et","cluster").attr("data-look",e.look),p=su(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await ws(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width});let v=y.getBBox();if(p){const D=y.children[0],R=ut(y);v=D.getBoundingClientRect(),R.attr("width",v.width),R.attr("height",v.height)}const T=e.padding??0,b=e.width<=v.width+T?v.width+T:e.width;e.width<=v.width+T?e.diff=(b-e.width)/2-T:e.diff=-T;const w=e.height,C=e.y-w/2,S=e.y+w/2,k=e.x-b/2,E=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:C+w/3,_=g?4:0,M=v.height+2*_;let L,P;if(g){const D=Math.max(M,v.height+2*_),R=k+D,I=Math.max(0,b-D);if(e.look==="handDrawn"){const N=Gt.svg(f),F=Wt(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),z=Wt(e,{roughness:.7,fill:"none",stroke:o,seed:i}),V=N.rectangle(k,C,D,w,F);L=f.insert(()=>V,":first-child");const B=N.rectangle(R,C,I,w,z);P=f.insert(()=>B,":first-child"),L.select("path:nth-child(2)").attr("style",h.join(";")),L.select("path").attr("style",d.join(";").replace("fill","stroke"))}else L=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),L.attr("class","swimlane-title").attr("style",u).attr("x",k).attr("y",C).attr("width",D).attr("height",w).attr("fill",a).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",R).attr("y",C).attr("width",I).attr("height",w).attr("fill","none").attr("stroke",o);const $=k+D/2,O=e.y;m.attr("transform",`translate(${$}, ${O}) rotate(-90) translate(${-v.width/2}, ${-v.height/2})`)}else{const D=Math.max(0,E-C),R=Math.min(M,D),I=C+R,$=Math.max(0,S-I),O=e.x-b/2;if(e.look==="handDrawn"){const z=Gt.svg(f),V=Wt(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),B=Wt(e,{roughness:.7,fill:"none",stroke:o,seed:i}),G=z.rectangle(O,C,b,R,V);L=f.insert(()=>G,":first-child");const H=z.rectangle(O,I,b,$,B);P=f.insert(()=>H,":first-child"),L.select("path:nth-child(2)").attr("style",h.join(";")),L.select("path").attr("style",d.join(";").replace("fill","stroke"))}else L=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),L.attr("class","swimlane-title").attr("style",u).attr("x",O).attr("y",C).attr("width",b).attr("height",R).attr("fill",a).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",O).attr("y",I).attr("width",b).attr("height",$).attr("fill","none").attr("stroke",o);const N=e.x-v.width/2,F=C+(R-v.height)/2;m.attr("transform",`translate(${N}, ${F})`)}if(le.trace("Swimlane data ",e,JSON.stringify(e)),l){const D=m.select("span");D&&D.attr("style",l)}return e.offsetX=0,e.width=b,e.height=w,e.offsetY=v.height-T/2,e.intersect=function(D){return sg(e,D)},{cluster:f,labelBBox:v}},"swimlane"),gfe=x(async(t,e)=>{le.info("Creating subgraph rect for ",e.id,e);const r=Fe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=zt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=xn(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await ws(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await Rd(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(xn(r)){const k=g.children[0],E=ut(g);m=k.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,T=e.x-y/2,b=e.y-v/2;le.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const k=Gt.svg(d),E=Wt(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),_=k.path(wf(T,b,y,v,0),E);w=d.insert(()=>(le.debug("Rough node insert CXC",_),_),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",T).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=vx(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const S=w.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(k){return sg(e,k)},{cluster:d,labelBBox:m}},"rect"),Rje=x((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(o){return sg(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),Lje=x(async(t,e)=>{const r=Fe(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await Rd(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(xn(r)){const _=p.children[0],M=ut(p);g=_.getBoundingClientRect(),M.attr("width",g.width),M.attr("height",g.height)}const m=0*e.padding,y=m/2,v=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const T=e.height+m,b=e.height+m-g.height-6,w=e.x-v/2,C=e.y-T/2;e.width=v;const S=e.y-e.height/2-y+g.height+2;let k;if(e.look==="handDrawn"){const _=e.cssClasses.includes("statediagram-cluster-alt"),M=Gt.svg(u),L=e.rx||e.ry?M.path(wf(w,C,v,T,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):M.rectangle(w,C,v,T,{seed:i});k=u.insert(()=>L,":first-child");const P=M.rectangle(w,S,v,b,{fill:_?a:s,fillStyle:_?"hachure":"solid",stroke:l,seed:i});k=u.insert(()=>L,":first-child"),f=u.insert(()=>P)}else k=h.insert("rect",":first-child"),k.attr("class","outer").attr("x",w).attr("y",C).attr("width",v).attr("height",T).attr("data-look",e.look),f.attr("class","inner").attr("x",w).attr("y",S).attr("width",v).attr("height",b);d.attr("transform",`translate(${e.x-g.width/2}, ${C+1-(xn(r)?0:3)})`);const E=k.node().getBBox();return e.height=E.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(_){return sg(e,_)},{cluster:u,labelBBox:g}},"roundedWithTitle"),Mje=x(async(t,e)=>{le.info("Creating subgraph rect for ",e.id,e);const r=Fe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=zt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=xn(r),p=d.insert("g").attr("class","cluster-label "),g=await ws(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(xn(r)){const k=g.children[0],E=ut(g);m=k.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,T=e.x-y/2,b=e.y-v/2;le.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const k=Gt.svg(d),E=Wt(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),_=k.path(wf(T,b,y,v,e.rx),E);w=d.insert(()=>(le.debug("Rough node insert CXC",_),_),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",T).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=vx(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const S=w.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(k){return sg(e,k)},{cluster:d,labelBBox:m}},"kanbanSection"),Ije=x((t,e)=>{const r=Fe(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=s.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const y=Gt.svg(s).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert(()=>y,":first-child")}else{p=o.insert("rect",":first-child");let m="outer";e.look,m="divider",p.attr("class",m).attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return sg(e,m)},{cluster:s,labelBBox:{}}},"divider"),Nje=gfe,Dje={rect:gfe,squareRect:Nje,roundedWithTitle:Lje,noteGroup:Rje,divider:Ije,kanbanSection:Mje,swimlane:_je},mfe=new Map,xR=x(async(t,e)=>{const r=e.shape||"rect",n=await Dje[r](t,e);return mfe.set(e.id,n),n},"insertCluster"),yfe=x(()=>{mfe=new Map},"clear");function vfe(t,e){return t.intersect(e)}x(vfe,"intersectNode");var Oje=vfe;function bfe(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}x(FO,"sameSign");var Pje=wfe;function Cfe(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){s=Math.min(s,h.x),o=Math.min(o,h.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=n-t.width/2-s,u=i-t.height/2-o;for(let h=0;h1&&a.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,y=d.y-r.y,v=Math.sqrt(m*m+y*y);return gh,":first-child");return d.attr("class","anchor").attr("style",Ca(o)),Kt(e,d),e.intersect=function(f){return le.info("Circle intersect",e,s,f),Bt.circle(e,s,f)},a}x(kfe,"anchor");function zO(t,e,r,n,i,a,s){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/a,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),v=l+y*a*Math.sin(h)*(s?-1:1),T=u-y*i*Math.cos(h)*(s?-1:1),b=Math.atan2((e-T)/a,(t-v)/i);let C=Math.atan2((n-T)/a,(r-v)/i)-b;s&&C<0&&(C+=2*Math.PI),!s&&C>0&&(C-=2*Math.PI);const S=[];for(let k=0;k<20;k++){const E=k/19,_=b+E*C,M=v+i*Math.cos(_),L=T+a*Math.sin(_);S.push({x:M,y:L})}return S}x(zO,"generateArcPoints");function Sfe(t,e,r){const[n,i]=[e,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}x(Sfe,"calculateArcSagitta");async function Efe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=x(_=>_+s,"calcTotalHeight"),l=x(_=>{const M=_/2;return[M/(2.5+_/50),M]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await xr(t,e,fr(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=Sfe(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2+g-g,v=d,{cssStyles:T}=e,b=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...zO(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...zO(y/2,v/2,y/2,-v/2,f,p,!0)],w=Gt.svg(u),C=Wt(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=Zr(b),k=w.path(S,C),E=u.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),T&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",T),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${f/2}, 0)`),Kt(e,E),e.intersect=function(_){return Bt.polygon(e,b,_)},u}x(Efe,"bowTieRect");function $h(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x($h,"insertPolygonShape");var RE=12;async function Afe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?28:i,s=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+RE),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),d=0,f=u,p=-h,g=0,m=[{x:d+RE,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+RE},{x:d+RE,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const T=Gt.svg(o),b=Wt(e,{}),w=Zr(m),C=T.path(w,b);y=o.insert(()=>C,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=$h(o,u,h,m);return n&&y.attr("style",n),Kt(e,y),e.intersect=function(T){return Bt.polygon(e,m,T)},o}x(Afe,"card");function _fe(t,e){const{nodeStyles:r}=zt(e);e.label="";const n=t.insert("g").attr("class",fr(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],o=Gt.svg(n),l=Wt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Zr(s),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return Bt.polygon(e,s,f)},n}x(_fe,"choice");async function AV(t,e,r){const{labelStyles:n,nodeStyles:i}=zt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await xr(t,e,fr(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?s.width/2+l*2:s.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Gt.svg(a),g=Wt(e,{}),m=p.circle(0,0,h*2,g);d=a.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Ca(f))}else d=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return Kt(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return Bt.circle(p,m,g)},e.intersect=function(p){return le.info("Circle intersect",e,h,p),Bt.circle(e,h,p)},a}x(AV,"circle");function Rfe(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},a={x:-(n/2)*e,y:n/2*r},s={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${o.x},${o.y} - M ${i.x},${i.y} L ${s.x},${s.y}`}x(Rfe,"createLine");function Lfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",fr(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:s}=e,o=Gt.svg(i),l=Wt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=Rfe(a),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),s&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),Kt(e,f),e.intersect=function(p){return le.info("crossedCircle intersect",e,{radius:a,point:p}),Bt.circle(e,a,p)},i}x(Lfe,"crossedCircle");function Pu(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-u/2+d-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Kt(e,S),e.intersect=function(k){return Bt.polygon(e,g,k)},i}x(Mfe,"curlyBraceLeft");function Bu(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Kt(e,S),e.intersect=function(k){return Bt.polygon(e,g,k)},i}x(Ife,"curlyBraceRight");function Pa(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;d_,":first-child").attr("stroke-opacity",0),M.insert(()=>w,":first-child"),M.insert(()=>k,":first-child"),M.attr("class","text"),f&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",n),M.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Kt(e,M),e.intersect=function(L){return Bt.polygon(e,m,L)},i}x(Nfe,"curlyBraces");async function Dfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await xr(t,e,fr(e)),d=Math.max(o,(h.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+s*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=Gt.svg(u),y=Wt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,T=f,b=v-p,w=T/4,C=[{x:b,y:0},{x:w,y:0},{x:0,y:T/2},{x:w,y:T},{x:b,y:T},...FC(-b,-T/2,p,50,270,90)],S=Zr(C),k=m.path(S,y),E=u.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",n),E.attr("transform",`translate(${-d/2}, ${-f/2})`),Kt(e,E),e.intersect=function(_){return Bt.polygon(e,C,_)},u}x(Dfe,"curvedTrapezoid");var Fje=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),zje=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),Vje=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),VK=8,GK=8;async function Ofe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?24:i,s=e.look==="neo"?24:i;if(e.width||e.height){const y=e.width??0;e.width=(e.width??0)-s,e.widthC,":first-child"),g=o.insert(()=>w,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=Fje(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Ca(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Kt(e,g),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(e.padding??0)/1.5-(l.y-(l.top??0))})`),e.intersect=function(y){const v=Bt.rect(e,y),T=v.x-(e.x??0);if(d!=0&&(Math.abs(T)<(e.width??0)/2||Math.abs(T)==(e.width??0)/2&&Math.abs(v.y-(e.y??0))>(e.height??0)/2-f)){let b=f*f*(1-T*T/(d*d));b>0&&(b=Math.sqrt(b)),b=f-b,y.y-(e.y??0)>0&&(b=-b),v.y+=b}return v},o}x(Ofe,"cylinder");async function bx(t,e,r){const{labelStyles:n,nodeStyles:i}=zt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await xr(t,e,fr(e)),o=Math.max(s.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(s.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r!=null&&r.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=Gt.svg(a),y=Wt(e,{}),v=f||p?m.path(wf(u,h,o,l,f||0),y):m.rectangle(u,h,o,l,y);d=a.insert(()=>v,":first-child"),d.attr("class","basic label-container").attr("style",Ca(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",Ca(f)).attr("ry",Ca(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return Kt(e,d),e.calcIntersect=function(m,y){return Bt.rect(m,y)},e.intersect=function(m){return Bt.rect(e,m)},a}x(bx,"drawRect");async function $fe(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:s,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},u=await bx(t,e,l);if(e.look==="handDrawn"){const p=Gt.svg(u),g=Wt(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return u;let v=null;if(y instanceof SVGGraphicsElement)v=y.getBBox();else return u;return u.insert(()=>p.line(v.x,v.y,v.x+v.width,v.y,g),".basic.label-container g.label"),u.insert(()=>p.line(v.x,v.y+v.height,v.x+v.width,v.y+v.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}x($fe,"datastore");async function Pfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?16:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await xr(t,e,fr(e)),u=o.width+i,h=o.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=Gt.svg(s),y=Wt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],T=m.polygon(v.map(w=>[w.x,w.y]),y),b=s.insert(()=>T,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(e.padding??0)/2-(o.x-(o.left??0))}, ${p+d+(e.padding??0)/2-(o.y-(o.top??0))})`),Kt(e,b),e.intersect=function(w){return Bt.rect(e,w)},s}x(Pfe,"dividedRectangle");async function Bfe(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=zt(e),i=e.look==="neo"?12:5;e.labelStyle=r;const a=e.padding??0,s=e.look==="neo"?16:a,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(s??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=Gt.svg(o),y=Wt(e,{roughness:.2,strokeWidth:2.5}),v=Wt(e,{roughness:.2,strokeWidth:1.5}),T=m.circle(0,0,u*2,y),b=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",Ca(e.cssClasses)).attr("style",Ca(f)),(p=d.node())==null||p.appendChild(T),(g=d.node())==null||g.appendChild(b)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),y=d.insert("circle");d.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),y.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return Kt(e,d),e.intersect=function(m){return le.info("DoubleCircle intersect",e,u,m),Bt.circle(e,u,m)},o}x(Bfe,"doublecircle");function Ffe(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=zt(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",fr(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=Gt.svg(a),{nodeBorder:u}=r,h=Wt(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),f=a.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),Kt(e,f),e.intersect=function(p){return le.info("filledCircle intersect",e,{radius:s,point:p}),Bt.circle(e,s,p)},a}x(Ffe,"filledCircle");var WK=10,HK=10;async function zfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.height=(e==null?void 0:e.height)??0,e.heightv,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),e.width=u,e.height=h,Kt(e,T),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(e.padding??0)/2+(o.y-(o.top??0))})`),e.intersect=function(b){return le.info("Triangle intersect",e,f,b),Bt.polygon(e,f,b)},s}x(zfe,"flippedTriangle");function Vfe(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=zt(e);e.label="";const s=t.insert("g").attr("class",fr(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),u=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),u=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,d=-1*u/2,f=Gt.svg(s),p=Wt(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=s.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),Kt(e,m);const y=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=y/2||0,e.height+=y/2||0),e.intersect=function(v){return Bt.rect(e,v)},s}x(Vfe,"forkJoin");async function Gfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=15,a=10,s=e.look==="neo"?16:e.padding??0,o=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0:e.height)??0)-o*2,e.heightT,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Kt(e,b),e.intersect=function(w){return le.info("Pill intersect",e,{radius:f,point:w}),Bt.polygon(e,y,w)},l}x(Gfe,"halfRoundedRectangle");var Gje=x((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function Wfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const a=e.padding??0,s=70,o=32,l=e.look==="neo"?s:a,u=e.look==="neo"?o:a;if(e.width||e.height){const b=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*b-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await xr(t,e,fr(e)),f=(e!=null&&e.height?e==null?void 0:e.height:d.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:d.width)+2*p+u,m=[{x:p,y:0},{x:g-p,y:0},{x:g,y:-f/2},{x:g-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const T=Gt.svg(h),b=Wt(e,{}),w=Gje(0,0,g,f,p),C=T.path(w,b);y=h.insert(()=>C,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=$h(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,Kt(e,y),e.intersect=function(T){return Bt.polygon(e,m,T)},h}x(Wfe,"hexagon");async function Hfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await xr(t,e,fr(e)),a=Math.max(30,(e==null?void 0:e.width)??0),s=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=Gt.svg(i),u=Wt(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=Zr(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-s/2})`),Kt(e,p),e.intersect=function(g){return le.info("Pill intersect",e,{points:h}),Bt.polygon(e,h,g)},i}x(Hfe,"hourglass");async function qfe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await xr(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=yx(e),v=-g/2,T=-p/2,b=e.label?8:0,w=Gt.svg(u),C=Wt(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=w.rectangle(v,T,g,p,C),k=Math.max(g,h.width),E=p+h.height+b,_=w.rectangle(-k/2,-E/2,k,E,{...C,fill:"transparent",stroke:"none"}),M=u.insert(()=>S,":first-child"),L=u.insert(()=>_);if(e.icon){const P=u.append("g");P.html(`${await bh(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const D=P.node().getBBox(),R=D.width,I=D.height,$=D.x,O=D.y;P.attr("transform",`translate(${-R/2-$},${f?h.height/2+b/2-I/2-O:-h.height/2-b/2-I/2-O})`),P.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-E/2:E/2-h.height})`),M.attr("transform",`translate(0,${f?h.height/2+b/2:-h.height/2-b/2})`),Kt(e,L),e.intersect=function(P){if(le.info("iconSquare intersect",e,P),!e.label)return Bt.rect(e,P);const D=e.x??0,R=e.y??0,I=e.height??0;let $=[];return f?$=[{x:D-h.width/2,y:R-I/2},{x:D+h.width/2,y:R-I/2},{x:D+h.width/2,y:R-I/2+h.height+b},{x:D+g/2,y:R-I/2+h.height+b},{x:D+g/2,y:R+I/2},{x:D-g/2,y:R+I/2},{x:D-g/2,y:R-I/2+h.height+b},{x:D-h.width/2,y:R-I/2+h.height+b}]:$=[{x:D-g/2,y:R-I/2},{x:D+g/2,y:R-I/2},{x:D+g/2,y:R-I/2+p},{x:D+h.width/2,y:R-I/2+p},{x:D+h.width/2/2,y:R+I/2},{x:D-h.width/2,y:R+I/2},{x:D-h.width/2,y:R-I/2+p},{x:D-g/2,y:R-I/2+p}],Bt.polygon(e,$,P)},u}x(qfe,"icon");async function Ufe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await xr(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=yx(e),T=Gt.svg(u),b=Wt(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=v.get("fill");b.stroke=w??y;const C=u.append("g");e.icon&&C.html(`${await bh(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const S=C.node().getBBox(),k=S.width,E=S.height,_=S.x,M=S.y,L=Math.max(k,E)*Math.SQRT2+f*2,P=T.circle(0,0,L,b),D=Math.max(L,h.width),R=L+h.height+p,I=T.rectangle(-D/2,-R/2,D,R,{...b,fill:"transparent",stroke:"none"}),$=u.insert(()=>P,":first-child"),O=u.insert(()=>I);return C.attr("transform",`translate(${-k/2-_},${g?h.height/2+p/2-E/2-M:-h.height/2-p/2-E/2-M})`),C.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-R/2:R/2-h.height})`),$.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),Kt(e,O),e.intersect=function(N){return le.info("iconSquare intersect",e,N),Bt.rect(e,N)},u}x(Ufe,"iconCircle");async function Yfe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await xr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:T}=yx(e),b=-m/2,w=-g/2,C=e.label?8:0,S=Gt.svg(u),k=Wt(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const E=T.get("fill");k.stroke=E??v;const _=S.path(wf(b,w,m,g,5),k),M=Math.max(m,h.width),L=g+h.height+C,P=S.rectangle(-M/2,-L/2,M,L,{...k,fill:"transparent",stroke:"none"}),D=u.insert(()=>_,":first-child").attr("class","icon-shape2"),R=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await bh(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const $=I.node().getBBox(),O=$.width,N=$.height,F=$.x,z=$.y;I.attr("transform",`translate(${-O/2-F},${p?h.height/2+C/2-N/2-z:-h.height/2-C/2-N/2-z})`),I.attr("style",`color: ${T.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-L/2:L/2-h.height})`),D.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),Kt(e,R),e.intersect=function(I){if(le.info("iconSquare intersect",e,I),!e.label)return Bt.rect(e,I);const $=e.x??0,O=e.y??0,N=e.height??0;let F=[];return p?F=[{x:$-h.width/2,y:O-N/2},{x:$+h.width/2,y:O-N/2},{x:$+h.width/2,y:O-N/2+h.height+C},{x:$+m/2,y:O-N/2+h.height+C},{x:$+m/2,y:O+N/2},{x:$-m/2,y:O+N/2},{x:$-m/2,y:O-N/2+h.height+C},{x:$-h.width/2,y:O-N/2+h.height+C}]:F=[{x:$-m/2,y:O-N/2},{x:$+m/2,y:O-N/2},{x:$+m/2,y:O-N/2+g},{x:$+h.width/2,y:O-N/2+g},{x:$+h.width/2/2,y:O+N/2},{x:$-h.width/2,y:O+N/2},{x:$-h.width/2,y:O-N/2+g},{x:$-m/2,y:O-N/2+g}],Bt.polygon(e,F,I)},u}x(Yfe,"iconRounded");async function Xfe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await xr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:T}=yx(e),b=-m/2,w=-g/2,C=e.label?8:0,S=Gt.svg(u),k=Wt(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const E=T.get("fill");k.stroke=E??v;const _=S.path(wf(b,w,m,g,.1),k),M=Math.max(m,h.width),L=g+h.height+C,P=S.rectangle(-M/2,-L/2,M,L,{...k,fill:"transparent",stroke:"none"}),D=u.insert(()=>_,":first-child"),R=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await bh(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const $=I.node().getBBox(),O=$.width,N=$.height,F=$.x,z=$.y;I.attr("transform",`translate(${-O/2-F},${p?h.height/2+C/2-N/2-z:-h.height/2-C/2-N/2-z})`),I.attr("style",`color: ${T.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-L/2:L/2-h.height})`),D.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),Kt(e,R),e.intersect=function(I){if(le.info("iconSquare intersect",e,I),!e.label)return Bt.rect(e,I);const $=e.x??0,O=e.y??0,N=e.height??0;let F=[];return p?F=[{x:$-h.width/2,y:O-N/2},{x:$+h.width/2,y:O-N/2},{x:$+h.width/2,y:O-N/2+h.height+C},{x:$+m/2,y:O-N/2+h.height+C},{x:$+m/2,y:O+N/2},{x:$-m/2,y:O+N/2},{x:$-m/2,y:O-N/2+h.height+C},{x:$-h.width/2,y:O-N/2+h.height+C}]:F=[{x:$-m/2,y:O-N/2},{x:$+m/2,y:O-N/2},{x:$+m/2,y:O-N/2+g},{x:$+h.width/2,y:O-N/2+g},{x:$+h.width/2/2,y:O+N/2},{x:$-h.width/2,y:O+N/2},{x:$-h.width/2,y:O-N/2+g},{x:$-m/2,y:O-N/2+g}],Bt.polygon(e,F,I)},u}x(Xfe,"iconSquare");async function jfe(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=zt(e);e.labelStyle=s;const o=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?o??0:0,(e==null?void 0:e.assetWidth)??i),u=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??a;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await xr(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,T=Gt.svg(d),b=Wt(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=T.rectangle(m,y,u,h,b),C=Math.max(u,f.width),S=h+f.height+v,k=T.rectangle(-C/2,-S/2,C,S,{...b,fill:"none",stroke:"none"}),E=d.insert(()=>w,":first-child"),_=d.insert(()=>k);if(e.img){const M=d.append("image");M.attr("href",e.img),M.attr("width",u),M.attr("height",h),M.attr("preserveAspectRatio","none"),M.attr("transform",`translate(${-u/2},${g?S/2-h:-S/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-v/2:h/2-f.height/2+v/2})`),E.attr("transform",`translate(0,${g?f.height/2+v/2:-f.height/2-v/2})`),Kt(e,_),e.intersect=function(M){if(le.info("iconSquare intersect",e,M),!e.label)return Bt.rect(e,M);const L=e.x??0,P=e.y??0,D=e.height??0;let R=[];return g?R=[{x:L-f.width/2,y:P-D/2},{x:L+f.width/2,y:P-D/2},{x:L+f.width/2,y:P-D/2+f.height+v},{x:L+u/2,y:P-D/2+f.height+v},{x:L+u/2,y:P+D/2},{x:L-u/2,y:P+D/2},{x:L-u/2,y:P-D/2+f.height+v},{x:L-f.width/2,y:P-D/2+f.height+v}]:R=[{x:L-u/2,y:P-D/2},{x:L+u/2,y:P-D/2},{x:L+u/2,y:P-D/2+h},{x:L+f.width/2,y:P-D/2+h},{x:L+f.width/2/2,y:P+D/2},{x:L-f.width/2,y:P+D/2},{x:L-f.width/2,y:P-D/2+h},{x:L-u/2,y:P-D/2+h}],Bt.polygon(e,R,M)},d}x(jfe,"imageSquare");async function Kfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=Math.max(l.width+(s??0)*2,(e==null?void 0:e.width)??0),h=Math.max(l.height+(a??0)*2,(e==null?void 0:e.height)??0),d=[{x:0,y:0},{x:u,y:0},{x:u+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Gt.svg(o),m=Wt(e,{}),y=Zr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=$h(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,Kt(e,f),e.intersect=function(g){return Bt.polygon(e,d,g)},o}x(Kfe,"inv_trapezoid");async function Zfe(t,e){const{shapeSvg:r,bbox:n,label:i}=await xr(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Kt(e,a),e.intersect=function(l){return Bt.rect(e,l)},r}x(Zfe,"labelRect");async function Qfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:0,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:-(3*u)/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Gt.svg(o),m=Wt(e,{}),y=Zr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=$h(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Kt(e,f),e.intersect=function(g){return Bt.polygon(e,d,g)},o}x(Qfe,"lean_left");async function Jfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Gt.svg(o),m=Wt(e,{}),y=Zr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=$h(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Kt(e,f),e.intersect=function(g){return Bt.polygon(e,d,g)},o}x(Jfe,"lean_right");function epe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",fr(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,(e==null?void 0:e.width)??0),o=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:s,y:0},{x:0,y:o+l/2},{x:s-2*l,y:o+l/2},{x:0,y:2*o},{x:s,y:o-l/2},{x:2*l,y:o-l/2}],h=Gt.svg(i),d=Wt(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Zr(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),a&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${s/2},${-o})`),Kt(e,g),e.intersect=function(m){return le.info("lightningBolt intersect",e,m),Bt.polygon(e,u,m)},i}x(epe,"lightningBolt");var Wje=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),Hje=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),qje=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),qK=10,UK=10;async function tpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-a,e.widthS,":first-child").attr("class","line"),m=o.insert(()=>C,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=Wje(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",Ca(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Kt(e,m),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),e.intersect=function(v){const T=Bt.rect(e,v),b=T.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(T.y-(e.y??0))>(e.height??0)/2-f)){let w=f*f*(1-b*b/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,v.y-(e.y??0)>0&&(w=-w),T.y+=w}return T},o}x(tpe,"linedCylinder");async function rpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;if(e.width||e.height){const w=e.width;e.width=(w??0)*10/11-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,fr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(a??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(s??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=Gt.svg(o),y=Wt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...rf(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,f,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],T=m.polygon(v.map(w=>[w.x,w.y]),y),b=o.insert(()=>T,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(e.padding??0)-f/2-(l.y-(l.top??0))})`),Kt(e,b),e.intersect=function(w){return Bt.polygon(e,v,w)},o}x(rpe,"linedWaveEdgedRect");async function npe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await xr(t,e,fr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+a*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+s*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,y=-g/2,{cssStyles:v}=e,T=Gt.svg(l),b=Wt(e,{}),w=[{x:m-o,y:y+o},{x:m-o,y:y+g+o},{x:m+p-o,y:y+g+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y:y+g-o},{x:m+p+o,y:y+g-o},{x:m+p+o,y:y-o},{x:m+o,y:y-o},{x:m+o,y},{x:m,y},{x:m,y:y+o}],C=[{x:m,y:y+o},{x:m+p-o,y:y+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y},{x:m,y}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Zr(w);let k=T.path(S,b);const E=Zr(C);let _=T.path(E,b);e.look!=="handDrawn"&&(k=BO(k),_=BO(_));const M=l.insert("g",":first-child");return M.insert(()=>k),M.insert(()=>_),M.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(u.width/2)-o-(u.x-(u.left??0))}, ${-(u.height/2)+o-(u.y-(u.top??0))})`),Kt(e,M),e.intersect=function(L){return Bt.polygon(e,w,L)},l}x(npe,"multiRect");async function ipe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await xr(t,e,fr(e)),o=e.padding??0,l=e.look==="neo"?16:o,u=e.look==="neo"?12:o;let h=!0;(e.width||e.height)&&(h=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const d=Math.max(a.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(a.height,(e==null?void 0:e.height)??0)+u*3,p=e.look==="neo"?f/4:f/8,g=f+(h?p/2:-p/2),m=-d/2,y=-g/2,v=10,{cssStyles:T}=e,b=rf(m-v,y+g+v,m+d-v,y+g+v,p,.8),w=b==null?void 0:b[b.length-1],C=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...b,{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y:w.y-2*v},{x:m+d+v,y:w.y-2*v},{x:m+d+v,y:y-v},{x:m+v,y:y-v},{x:m+v,y},{x:m,y},{x:m,y:y+v}],S=[{x:m,y:y+v},{x:m+d-v,y:y+v},{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y},{x:m,y}],k=Gt.svg(i),E=Wt(e,{});e.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const _=Zr(C),M=k.path(_,E),L=Zr(S),P=k.path(L,E),D=i.insert(()=>M,":first-child");return D.insert(()=>P),D.attr("class","basic label-container outer-path"),T&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",T),n&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",n),D.attr("transform",`translate(0,${-p/2})`),s.attr("transform",`translate(${-(a.width/2)-v-(a.x-(a.left??0))}, ${-(a.height/2)+v-p/2-(a.y-(a.top??0))})`),Kt(e,D),e.intersect=function(R){return Bt.polygon(e,C,R)},i}x(ipe,"multiWaveEdgedRectangle");async function ape(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=zt(e);e.labelStyle=n,e.useHtmlLabels||xn(Xt())||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await xr(t,e,fr(e)),u=Math.max(o.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(o.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=Gt.svg(s),m=Wt(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,u,h,m),v=s.insert(()=>y,":first-child");return v.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Kt(e,v),e.intersect=function(T){return Bt.rect(e,T)},s}x(ape,"note");var Uje=x((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function spe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await xr(t,e,fr(e)),s=a.width+(e.padding??0),o=a.height+(e.padding??0),l=s+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Gt.svg(i),g=Wt(e,{}),m=Uje(0,0,l),y=p.path(m,g);d=i.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=$h(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),Kt(e,d),e.calcIntersect=function(p,g){const m=p.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],v=Bt.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}x(spe,"question");async function ope(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?21:i??0,s=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await xr(t,e,fr(e)),h=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),f=-h/2,p=-d/2,g=p/2,m=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:y}=e,v=Gt.svg(o),T=Wt(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const b=Zr(m),w=v.path(b,T),C=o.insert(()=>w,":first-child");return C.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${-g/2},0)`),u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),Kt(e,C),e.intersect=function(S){return Bt.polygon(e,m,S)},o}x(ope,"rect_left_inv_arrow");async function lpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),o=a.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await Rd(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(xn(Fe())){const E=h.children[0],_=ut(h);d=E.getBoundingClientRect(),_.attr("width",d.width),_.attr("height",d.height)}le.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await Rd(o,Array.isArray(f)?f.join("
"):f,e.labelStyle,!0,!0),m=g.children[0],y=ut(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;ut(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),ut(h).attr("transform","translate( "+(d.width(le.debug("Rough node insert CXC",M),L),":first-child"),S=a.insert(()=>(le.debug("Rough node insert CXC",M),M),":first-child")}else S=s.insert("rect",":first-child"),k=s.insert("line"),S.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-v).attr("y",-d.height/2-v).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),k.attr("class","divider").attr("x1",-d.width/2-v).attr("x2",d.width/2+v).attr("y1",-d.height/2-v+p.height+v).attr("y2",-d.height/2-v+p.height+v);return Kt(e,S),e.intersect=function(E){return Bt.rect(e,E)},a}x(lpe,"rectWithTitle");async function cpe(t,e,{config:{themeVariables:r}}){const n=(r==null?void 0:r.radius)??5,i={rx:n,ry:n,labelPaddingX:((e==null?void 0:e.padding)??0)*1,labelPaddingY:((e==null?void 0:e.padding)??0)*1};return bx(t,e,i)}x(cpe,"roundedRect");var qf=8;async function upe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?qf:qf*2),h=((e==null?void 0:e.height)??o.height)+a*2,d=u-qf,f=h,p=qf-u/2,g=-h/2,{cssStyles:m}=e,y=Gt.svg(s),v=Wt(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-qf,y:g+f},{x:p-qf,y:g},{x:p,y:g},{x:p,y:g+f}],b=y.polygon(T.map(C=>[C.x,C.y]),v),w=s.insert(()=>b,":first-child");return w.attr("class","basic label-container outer-path").attr("style",Ca(m)),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),l.attr("transform",`translate(${qf/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Kt(e,w),e.intersect=function(C){return Bt.rect(e,C)},s}x(upe,"shadedProcess");async function hpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-s*2,10));const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,fr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:y}=e,v=Gt.svg(o),T=Wt(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const b=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],w=Zr(b),C=v.path(w,T),S=o.insert(()=>C,":first-child");return S.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",y),n&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),Kt(e,S),e.intersect=function(k){return Bt.polygon(e,b,k)},o}x(hpe,"slopedRect");async function dpe(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,a={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return bx(t,e,a)}x(dpe,"squareRect");async function fpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?20:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=l.height+(e.look==="neo"?s*2:s),h=l.width+u/4+(e.look==="neo"?a*2:a),d=u/2,{cssStyles:f}=e,p=Gt.svg(o),g=Wt(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-u/2},{x:h/2-d,y:-u/2},...FC(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...FC(h/2-d,0,d,50,270,450)],y=Zr(m),v=p.path(y,g),T=o.insert(()=>v,":first-child");return T.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),Kt(e,T),e.intersect=function(b){return Bt.polygon(e,m,b)},o}x(fpe,"stadium");async function ppe(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return bx(t,e,r)}x(ppe,"state");function gpe(t,e,{config:{themeVariables:r}}){var T,b;const{labelStyles:n,nodeStyles:i}=zt(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l,nodeShadow:u}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const h=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=Gt.svg(h),f=Wt(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:s,strokeWidth:2}),g=o??l,m=(e.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),v=h.insert(()=>p,":first-child");if(v.insert(()=>y),e.look!=="handDrawn"&&v.attr("class","outer-path"),a&&v.selectAll("path").attr("style",a),i&&v.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const w=((b=(T=t.node())==null?void 0:T.ownerSVGElement)==null?void 0:b.id)??"",C=w?`${w}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${C})`)}return Kt(e,v),e.intersect=function(w){return Bt.circle(e,(e.width??0)/2,w)},h}x(gpe,"stateEnd");function mpe(t,e,{config:{themeVariables:r}}){var o,l;const{lineColor:n,nodeShadow:i}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s;if(e.look==="handDrawn"){const h=Gt.svg(a).circle(0,0,e.width,SYe(n));s=a.insert(()=>h),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&i&&e.look!=="handDrawn"){const u=((l=(o=t.node())==null?void 0:o.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${h})`)}return Kt(e,s),e.intersect=function(u){return Bt.circle(e,(e.width??7)/2,u)},a}x(mpe,"stateStart");var Ug=8;async function ype(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,a=e.look==="neo"?28:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.width)??l.width)+2*Ug+a,h=((e==null?void 0:e.height)??l.height)+s,d=u-2*Ug,f=h,p=-u/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(e.look==="handDrawn"){const y=Gt.svg(o),v=Wt(e,{}),T=y.rectangle(p,g,d+16,f,v),b=y.line(p+Ug,g,p+Ug,g+f,v),w=y.line(p+Ug+d,g,p+Ug+d,g+f,v);o.insert(()=>b,":first-child"),o.insert(()=>w,":first-child");const C=o.insert(()=>T,":first-child"),{cssStyles:S}=e;C.attr("class","basic label-container").attr("style",Ca(S)),Kt(e,C)}else{const y=$h(o,d,f,m);n&&y.attr("style",n),Kt(e,y)}return e.intersect=function(y){return Bt.polygon(e,m,y)},o}x(ype,"subroutine");var JM=.2;async function vpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-s*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-JM*(e.height+s*2),10));const{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2,h=JM*u,d=JM*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2+h-h,g=u,m=-p/2,y=-g/2,{cssStyles:v}=e,T=Gt.svg(o),b=Wt(e,{}),w=[{x:m-h/2,y},{x:m+p+h/2,y},{x:m+p+h/2,y:y+g},{x:m-h/2,y:y+g}],C=[{x:m+p-h/2,y:y+g},{x:m+p+h/2,y:y+g},{x:m+p+h/2,y:y+g-d}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Zr(w),k=T.path(S,b),E=Zr(C),_=T.path(E,{...b,fillStyle:"solid"}),M=o.insert(()=>_,":first-child");return M.insert(()=>k,":first-child"),M.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",n),Kt(e,M),e.intersect=function(L){return Bt.polygon(e,w,L)},o}x(vpe,"taggedRect");async function bpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await xr(t,e,fr(e)),o=Math.max(a.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(a.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=l/8,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=Gt.svg(i),m=Wt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...rf(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],v=-o/2+o/2*.1,T=-f/2-d*.4,b=[{x:v+o-h,y:(T+l)*1.3},{x:v+o,y:T+l-d},{x:v+o,y:(T+l)*.9},...rf(v+o,(T+l)*1.25,v+o-h,(T+l)*1.3,-l*.02,.5)],w=Zr(y),C=g.path(w,m),S=Zr(b),k=g.path(S,{...m,fillStyle:"solid"}),E=i.insert(()=>k,":first-child");return E.insert(()=>C,":first-child"),E.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),Kt(e,E),e.intersect=function(_){return Bt.polygon(e,y,_)},i}x(bpe,"taggedWaveEdgedRectangle");async function xpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await xr(t,e,fr(e)),s=Math.max(a.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(a.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-s/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",s).attr("height",o),Kt(e,h),e.intersect=function(d){return Bt.rect(e,d)},i}x(xpe,"text");var Yje=x((t,e,r,n,i,a)=>`M${t},${e} +`);return Kde(n)}x(Zde,"preprocessMarkdown");function Qde(t){return t.split(/\\n|\n|/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}x(Qde,"nonMarkdownToLines");function Jde(t,e={}){const r=Zde(t,e),n=wn.lexer(r),i=[[]];let a=0;function s(o,l="normal"){o.type==="text"?o.text.split(` +`).forEach((h,d)=>{d!==0&&(a++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[a].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{s(u,o.type)}):o.type==="html"&&i[a].push({content:o.text,type:"normal"})}return x(s,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{s(u)}):o.type==="html"?i[a].push({content:o.text,type:"normal"}):i[a].push({content:o.raw,type:"normal"})}),i}x(Jde,"markdownToLines");function efe(t){return t?`

${t.replace(/\\n|\n/g,"
")}

`:""}x(efe,"nonMarkdownToHTML");function tfe(t,{markdownAutoWrap:e}={}){const r=wn.lexer(t);function n(i){var a,s,o;return i.type==="text"?e===!1?i.text.replace(/\n */g,"
").replace(/ /g," "):i.text.replace(/\n */g,"
"):i.type==="strong"?`${(a=i.tokens)==null?void 0:a.map(n).join("")}`:i.type==="em"?`${(s=i.tokens)==null?void 0:s.map(n).join("")}`:i.type==="paragraph"?`

${(o=i.tokens)==null?void 0:o.map(n).join("")}

`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(le.warn(`Unsupported markdown: ${i.type}`),i.raw)}return x(n,"output"),r.map(n).join("")}x(tfe,"markdownToHTML");function rfe(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}x(rfe,"splitTextToChars");function nfe(t,e){const r=rfe(e.content);return kV(t,[],r,e.type)}x(nfe,"splitWordToFitWidth");function kV(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?kV(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}x(kV,"splitWordToFitWidthRecursion");function ife(t,e){if(t.some(({content:r})=>r.includes(` +`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return DA(t,e)}x(ife,"splitLineToFitWidth");function DA(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),e(s))return DA(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[o,l]=nfe(e,a);r.push([o]),l.content&&t.unshift(l)}return DA(t,e,r)}x(DA,"splitLineToFitWidthRecursion");function NO(t,e){e&&t.attr("style",e)}x(NO,"applyStyle");var IK=16384;async function afe(t,e,r,n,i=!1,a=Xt()){const s=t.append("foreignObject");s.attr("width",`${Math.min(10*r,IK)}px`),s.attr("height",`${Math.min(10*r,IK)}px`);const o=s.append("xhtml:div"),l=$i(e.label)?await eR(e.label.replace(At.lineBreakRegex,` +`),a):Wr(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),NO(h,e.labelStyle),h.attr("class",`${u} ${n}`),NO(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),s.node()}x(afe,"addHtmlSpan");function yR(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}x(yR,"createTspan");function sfe(t,e,r){const n=t.append("text"),i=yR(n,1,e);vR(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}x(sfe,"computeWidthOfText");function ofe(t,e,r){var s;const n=t.append("text"),i=yR(n,1,e);vR(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}x(ofe,"computeDimensionOfText");function lfe(t,e,r,n=!1,i=!1){const s=e.append("g"),o=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=x(p=>sfe(s,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:ife(h,d);for(const p of f){const g=yR(l,u,1.1,i);vR(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}x(lfe,"createFormattedText");function DO(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}x(DO,"decodeHTMLEntities");function vR(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(DO(r.content)):i.text(" "+DO(r.content))})}x(vR,"updateTextContentAndStyles");async function cfe(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await AXe(o)?await bh(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}x(cfe,"replaceIconSubstring");var ws=x(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:s=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(le.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",u),a){const d=s?tfe(e,h):efe(e),f=await cfe(vh(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:$i(e)?p:f,labelStyle:r.replace("fill:","color:")};return await afe(t,g,l,i,u,h)}else{const d=vh(e.replace(//g,"
")),f=s?Jde(d.replace("
","
"),h):Qde(d),p=lfe(l,t,f,e?u:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ut(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");ut(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ut(p).select("text").attr("style",m)}return n?ut(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):ut(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function YM(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),o=Math.sin(a);for(const l of t){const[u,h]=l;l[0]=(u-n)*s-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*s+i}}}function hje(t,e){return t[0]===e[0]&&t[1]===e[1]}function dje(t,e,r,n=1){const i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of s)YM(u,o,i);const l=(function(u,h,d){const f=[];for(const T of u){const b=[...T];hje(b[0],b[b.length-1])||b.push([b[0][0],b[0][1]]),b.length>2&&f.push(b)}const p=[];h=Math.max(h,.1);const g=[];for(const T of f)for(let b=0;bT.yminb.ymin?1:T.xb.x?1:T.ymax===b.ymax?0:(T.ymax-b.ymax)/Math.abs(T.ymax-b.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let T=-1;for(let b=0;by);b++)T=b;g.splice(0,T+1).forEach((b=>{m.push({s:y,edge:b})}))}if(m=m.filter((T=>!(T.edge.ymax<=y))),m.sort(((T,b)=>T.edge.x===b.edge.x?0:(T.edge.x-b.edge.x)/Math.abs(T.edge.x-b.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let T=0;T=m.length)break;const w=m[T].edge,C=m[b].edge;p.push([[Math.round(w.x),y],[Math.round(C.x),y]])}y+=d,m.forEach((T=>{T.edge.x=T.edge.x+d*T.edge.islope})),v++}return p})(s,a,n);if(i){for(const u of s)YM(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),YM(f,h,d)})(l,o,-i)}return l}function tS(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),dje(t,i,n,a||1)}class SV{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=tS(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function bR(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class fje extends SV{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=tS(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],o=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(const[u,h]of i)bR([u,h])&&s.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class pje extends SV{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,i);return n.ops=n.ops.concat(a.ops),n}}let gje=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=tS(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=i/4;for(const o of e){const l=bR(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g{const o=bR(s),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const s=bR(a),o=Math.round(s/(2*r));let l=a[0],u=a[1];l[0]>u[0]&&(l=a[1],u=a[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;dh%2?u+r:u+e));a.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":a.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function hfe(t){const e=[];let r="",n=0,i=0,a=0,s=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,y=i+2*(g-i)/3,v=d+2*(p-d)/3,T=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,T,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,y=i+2*(f-i)/3,v=p+2*(d-p)/3,T=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,T,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],y=h[5],v=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,y,v,y,v]}),n=y,i=v):(n!==y||i!==v)&&(dfe(n,i,y,v,d,f,p,g,m).forEach((function(T){e.push({key:"C",data:T})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function lT(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function dfe(t,e,r,n,i,a,s,o,l,u){const h=(d=s,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,y=0;if(u)[p,g,m,y]=u;else{[t,e]=lT(t,e,-h),[r,n]=lT(r,n,-h);const D=(t-r)/2,R=(e-n)/2;let I=D*D/(i*i)+R*R/(a*a);I>1&&(I=Math.sqrt(I),i*=I,a*=I);const $=i*i,O=a*a,N=$*O-$*R*R-O*D*D,F=$*R*R+O*D*D,z=(o===l?-1:1)*Math.sqrt(Math.abs(N/F));m=z*i*R/a+(t+r)/2,y=z*-a*D/i+(e+n)/2,p=Math.asin(parseFloat(((e-y)/a).toFixed(9))),g=Math.asin(parseFloat(((n-y)/a).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let v=g-p;if(Math.abs(v)>120*Math.PI/180){const D=g,R=r,I=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=dfe(r=m+i*Math.cos(g),n=y+a*Math.sin(g),R,I,i,a,s,0,l,[g,D,m,y])}v=g-p;const T=Math.cos(p),b=Math.sin(p),w=Math.cos(g),C=Math.sin(g),S=Math.tan(v/4),k=4/3*i*S,E=4/3*a*S,_=[t,e],M=[t+k*b,e-E*T],L=[r+k*C,n-E*w],P=[r,n];if(M[0]=2*_[0]-M[0],M[1]=2*_[1]-M[1],u)return[M,L,P].concat(f);{f=[M,L,P].concat(f);const D=[];for(let R=0;R2){const i=[];for(let a=0;a2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-p)/2),v=FK(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const T=FK(y,u,h,d,f,p,g,1.5,l);v.push(...T)}return s&&(o?v.push(...tf(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...tf(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):v.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:v}}function $K(t,e){const r=hfe(ufe(EV(t))),n=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of r)switch(s){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...tf(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...wje(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...tf(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function KM(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+wr(i,e),n[0][1]+wr(i,e)]});for(let s=1;s500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*gfe(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=wr(p,i,u),g=wr(g,i,u);const m=[],y=()=>wr(d,i,u),v=()=>wr(h,i,u),T=i.preserveVertices;return s?m.push({op:"move",data:[t+(T?0:y()),e+(T?0:y())]}):m.push({op:"move",data:[t+(T?0:wr(h,i,u)),e+(T?0:wr(h,i,u))]}),s?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(T?0:y()),n+(T?0:y())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(T?0:v()),n+(T?0:v())]}),m}function AE(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+wr(e,r),t[0][1]+wr(e,r)]),n.push([t[0][0]+wr(e,r),t[0][1]+wr(e,r)]);for(let i=1;i3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+21&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=op(l,u,.5),p=op(u,h,.5),g=op(h,d,.5),m=op(f,p,.5),y=op(p,g,.5),v=op(m,y,.5);PO([l,f,m,v],0,r,i),PO([v,y,g,d],0,r,i)}var a,s;return i}function kje(t,e){return PA(t,0,t.length,e)}function PA(t,e,r,n,i){const a=i||[],s=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(PA(t,e,u+1,n,a),PA(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function ZM(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?PA(n,0,n.length,r):n}const Ao="none";class BA{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,a){const s=this._o(a);return this._d("line",[ffe(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=Tje(e,r,n,i,s);if(s.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];s.fillStyle==="solid"?o.push(KM([u],s)):o.push(qg([u],s))}return s.stroke!==Ao&&o.push(l),this._d("rectangle",o,s)}ellipse(e,r,n,i,a){const s=this._o(a),o=[],l=pfe(n,i,s),u=OO(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=OO(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(qg([u.estimatedPoints],s));return s.stroke!==Ao&&o.push(u.opset),this._d("ellipse",o,s)}circle(e,r,n,i){const a=this.ellipse(e,r,n,n,i);return a.shape="circle",a}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[Z4(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=OK(e,r,n,i,a,s,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=OK(e,r,n,i,a,s,!0,!1,f);p.type="fillPath",h.push(p)}else h.push((function(f,p,g,m,y,v,T){const b=f,w=p;let C=Math.abs(g/2),S=Math.abs(m/2);C+=wr(.01*C,T),S+=wr(.01*S,T);let k=y,E=v;for(;k<0;)k+=2*Math.PI,E+=2*Math.PI;E-k>2*Math.PI&&(k=0,E=2*Math.PI);const _=(E-k)/T.curveStepCount,M=[];for(let L=k;L<=E;L+=_)M.push([b+C*Math.cos(L),w+S*Math.sin(L)]);return M.push([b+C*Math.cos(E),w+S*Math.sin(E)]),M.push([b,w]),qg([M],T)})(e,r,n,i,a,s,u));return u.stroke!==Ao&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=DK(e,n);if(n.fill&&n.fill!==Ao)if(n.fillStyle==="solid"){const s=DK(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?s.push(...u):u.length===3?s.push(...ZM(zK([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...ZM(zK(u),10,(1+n.roughness)/2))}s.length&&i.push(qg([s],n))}return n.stroke!==Ao&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=Z4(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(KM([e],n)):i.push(qg([e],n))),n.stroke!==Ao&&i.push(a),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=n.fill&&n.fill!=="transparent"&&n.fill!==Ao,s=n.stroke!==Ao,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=hfe(ufe(EV(h))),g=[];let m=[],y=[0,0],v=[];const T=()=>{v.length>=4&&m.push(...ZM(v,d)),v=[]},b=()=>{T(),m.length&&(g.push(m),m=[])};for(const{key:C,data:S}of p)switch(C){case"M":b(),y=[S[0],S[1]],m.push(y);break;case"L":T(),m.push([S[0],S[1]]);break;case"C":if(!v.length){const k=m.length?m[m.length-1]:y;v.push([k[0],k[1]])}v.push([S[0],S[1]]),v.push([S[2],S[3]]),v.push([S[4],S[5]]);break;case"Z":T(),m.push([y[0],y[1]])}if(b(),!f)return g;const w=[];for(const C of g){const S=kje(C,f);S.length&&w.push(S)}return w})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=$K(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=$K(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(KM(l,n));else i.push(qg(l,n));return s&&(o?l.forEach((h=>{i.push(Z4(h,!1,n))})):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const a=typeof r=="number"&&r>=0?i.data.map((s=>+s.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Ao};break;case"fillPath":s={d:this.opsToPath(a),stroke:Ao,strokeWidth:0,fill:n.fill||Ao};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Ao,strokeWidth:n,fill:Ao}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}}class Sje{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new BA(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const a of r.ops){const s=typeof n=="number"&&n>=0?a.data.map((o=>+o.toFixed(n))):a.data;switch(a.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s),s}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s),s}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s),s}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a),a}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const _E="http://www.w3.org/2000/svg";class Eje{constructor(e,r){this.svg=e,this.gen=new BA(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(_E,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(_E,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(_E,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&a.appendChild(l)}return a}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const a=e.createElementNS(_E,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s)}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s)}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s)}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var Gt={canvas:(t,e)=>new Sje(t,e),svg:(t,e)=>new Eje(t,e),generator:t=>new BA(t),newSeed:()=>BA.newSeed()},xr=x(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||su((p=Fe())==null?void 0:p.htmlLabels);r?n=r:n="node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",ka(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await ws(s,Wr(vh(o),Fe()),{useHtmlLabels:i,width:e.width||((g=Fe().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},Fe());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],y=ut(h);await fV(m,o),d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height)}return i?s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):s.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:d,halfPadding:f,label:s}},"labelHelper"),QM=x(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??xn(Fe()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await ws(i,Wr(vh(e),Fe()),{useHtmlLabels:n,width:r.width||((u=(l=Fe())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=a.getBBox();const o=r.padding/2;if(xn(Fe())){const h=a.children[0],d=ut(a);s=h.getBoundingClientRect(),d.attr("width",s.width),d.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:o,label:i}},"insertLabel"),Kt=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),fr=x((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Zr(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}x(Zr,"createPathFromPoints");function rf(t,e,r,n,i,a){const s=[],l=r-t,u=n-e,h=l/a,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,y=f+i*Math.sin(d*(m-t));s.push({x:m,y})}return s}x(rf,"generateFullSineWavePoints");function FC(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),a=e.find(l=>l.getAttribute("stroke")!=="none"),s=x((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:s(i,"fill"),"fill-opacity":s(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}x(BO,"mergePaths");var Aje=x((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),sg=Aje,_je=x(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Fe(),o=xn(s);return await ws(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Rd=_je,wf=x((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),Rje=x(async(t,e)=>{const r=Fe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,o=s,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=zt(e),f=t.insert("g").attr("class","cluster swimlane "+(e.cssClasses||"")).attr("id",e.id).attr("data-id",e.id).attr("data-et","cluster").attr("data-look",e.look),p=su(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await ws(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width});let v=y.getBBox();if(p){const D=y.children[0],R=ut(y);v=D.getBoundingClientRect(),R.attr("width",v.width),R.attr("height",v.height)}const T=e.padding??0,b=e.width<=v.width+T?v.width+T:e.width;e.width<=v.width+T?e.diff=(b-e.width)/2-T:e.diff=-T;const w=e.height,C=e.y-w/2,S=e.y+w/2,k=e.x-b/2,E=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:C+w/3,_=g?4:0,M=v.height+2*_;let L,P;if(g){const D=Math.max(M,v.height+2*_),R=k+D,I=Math.max(0,b-D);if(e.look==="handDrawn"){const N=Gt.svg(f),F=Wt(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),z=Wt(e,{roughness:.7,fill:"none",stroke:o,seed:i}),V=N.rectangle(k,C,D,w,F);L=f.insert(()=>V,":first-child");const B=N.rectangle(R,C,I,w,z);P=f.insert(()=>B,":first-child"),L.select("path:nth-child(2)").attr("style",h.join(";")),L.select("path").attr("style",d.join(";").replace("fill","stroke"))}else L=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),L.attr("class","swimlane-title").attr("style",u).attr("x",k).attr("y",C).attr("width",D).attr("height",w).attr("fill",a).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",R).attr("y",C).attr("width",I).attr("height",w).attr("fill","none").attr("stroke",o);const $=k+D/2,O=e.y;m.attr("transform",`translate(${$}, ${O}) rotate(-90) translate(${-v.width/2}, ${-v.height/2})`)}else{const D=Math.max(0,E-C),R=Math.min(M,D),I=C+R,$=Math.max(0,S-I),O=e.x-b/2;if(e.look==="handDrawn"){const z=Gt.svg(f),V=Wt(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),B=Wt(e,{roughness:.7,fill:"none",stroke:o,seed:i}),G=z.rectangle(O,C,b,R,V);L=f.insert(()=>G,":first-child");const H=z.rectangle(O,I,b,$,B);P=f.insert(()=>H,":first-child"),L.select("path:nth-child(2)").attr("style",h.join(";")),L.select("path").attr("style",d.join(";").replace("fill","stroke"))}else L=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),L.attr("class","swimlane-title").attr("style",u).attr("x",O).attr("y",C).attr("width",b).attr("height",R).attr("fill",a).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",O).attr("y",I).attr("width",b).attr("height",$).attr("fill","none").attr("stroke",o);const N=e.x-v.width/2,F=C+(R-v.height)/2;m.attr("transform",`translate(${N}, ${F})`)}if(le.trace("Swimlane data ",e,JSON.stringify(e)),l){const D=m.select("span");D&&D.attr("style",l)}return e.offsetX=0,e.width=b,e.height=w,e.offsetY=v.height-T/2,e.intersect=function(D){return sg(e,D)},{cluster:f,labelBBox:v}},"swimlane"),mfe=x(async(t,e)=>{le.info("Creating subgraph rect for ",e.id,e);const r=Fe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=zt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=xn(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await ws(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await Rd(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(xn(r)){const k=g.children[0],E=ut(g);m=k.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,T=e.x-y/2,b=e.y-v/2;le.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const k=Gt.svg(d),E=Wt(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),_=k.path(wf(T,b,y,v,0),E);w=d.insert(()=>(le.debug("Rough node insert CXC",_),_),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",T).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=vx(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const S=w.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(k){return sg(e,k)},{cluster:d,labelBBox:m}},"rect"),Lje=x((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(o){return sg(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),Mje=x(async(t,e)=>{const r=Fe(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await Rd(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(xn(r)){const _=p.children[0],M=ut(p);g=_.getBoundingClientRect(),M.attr("width",g.width),M.attr("height",g.height)}const m=0*e.padding,y=m/2,v=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const T=e.height+m,b=e.height+m-g.height-6,w=e.x-v/2,C=e.y-T/2;e.width=v;const S=e.y-e.height/2-y+g.height+2;let k;if(e.look==="handDrawn"){const _=e.cssClasses.includes("statediagram-cluster-alt"),M=Gt.svg(u),L=e.rx||e.ry?M.path(wf(w,C,v,T,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):M.rectangle(w,C,v,T,{seed:i});k=u.insert(()=>L,":first-child");const P=M.rectangle(w,S,v,b,{fill:_?a:s,fillStyle:_?"hachure":"solid",stroke:l,seed:i});k=u.insert(()=>L,":first-child"),f=u.insert(()=>P)}else k=h.insert("rect",":first-child"),k.attr("class","outer").attr("x",w).attr("y",C).attr("width",v).attr("height",T).attr("data-look",e.look),f.attr("class","inner").attr("x",w).attr("y",S).attr("width",v).attr("height",b);d.attr("transform",`translate(${e.x-g.width/2}, ${C+1-(xn(r)?0:3)})`);const E=k.node().getBBox();return e.height=E.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(_){return sg(e,_)},{cluster:u,labelBBox:g}},"roundedWithTitle"),Ije=x(async(t,e)=>{le.info("Creating subgraph rect for ",e.id,e);const r=Fe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=zt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=xn(r),p=d.insert("g").attr("class","cluster-label "),g=await ws(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(xn(r)){const k=g.children[0],E=ut(g);m=k.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,T=e.x-y/2,b=e.y-v/2;le.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const k=Gt.svg(d),E=Wt(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),_=k.path(wf(T,b,y,v,e.rx),E);w=d.insert(()=>(le.debug("Rough node insert CXC",_),_),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",T).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=vx(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const S=w.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(k){return sg(e,k)},{cluster:d,labelBBox:m}},"kanbanSection"),Nje=x((t,e)=>{const r=Fe(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=s.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const y=Gt.svg(s).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert(()=>y,":first-child")}else{p=o.insert("rect",":first-child");let m="outer";e.look,m="divider",p.attr("class",m).attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return sg(e,m)},{cluster:s,labelBBox:{}}},"divider"),Dje=mfe,Oje={rect:mfe,squareRect:Dje,roundedWithTitle:Mje,noteGroup:Lje,divider:Nje,kanbanSection:Ije,swimlane:Rje},yfe=new Map,xR=x(async(t,e)=>{const r=e.shape||"rect",n=await Oje[r](t,e);return yfe.set(e.id,n),n},"insertCluster"),vfe=x(()=>{yfe=new Map},"clear");function bfe(t,e){return t.intersect(e)}x(bfe,"intersectNode");var $je=bfe;function xfe(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}x(FO,"sameSign");var Bje=Cfe;function kfe(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){s=Math.min(s,h.x),o=Math.min(o,h.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=n-t.width/2-s,u=i-t.height/2-o;for(let h=0;h1&&a.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,y=d.y-r.y,v=Math.sqrt(m*m+y*y);return gh,":first-child");return d.attr("class","anchor").attr("style",ka(o)),Kt(e,d),e.intersect=function(f){return le.info("Circle intersect",e,s,f),Bt.circle(e,s,f)},a}x(Sfe,"anchor");function zO(t,e,r,n,i,a,s){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/a,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),v=l+y*a*Math.sin(h)*(s?-1:1),T=u-y*i*Math.cos(h)*(s?-1:1),b=Math.atan2((e-T)/a,(t-v)/i);let C=Math.atan2((n-T)/a,(r-v)/i)-b;s&&C<0&&(C+=2*Math.PI),!s&&C>0&&(C-=2*Math.PI);const S=[];for(let k=0;k<20;k++){const E=k/19,_=b+E*C,M=v+i*Math.cos(_),L=T+a*Math.sin(_);S.push({x:M,y:L})}return S}x(zO,"generateArcPoints");function Efe(t,e,r){const[n,i]=[e,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}x(Efe,"calculateArcSagitta");async function Afe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=x(_=>_+s,"calcTotalHeight"),l=x(_=>{const M=_/2;return[M/(2.5+_/50),M]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await xr(t,e,fr(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=Efe(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2+g-g,v=d,{cssStyles:T}=e,b=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...zO(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...zO(y/2,v/2,y/2,-v/2,f,p,!0)],w=Gt.svg(u),C=Wt(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=Zr(b),k=w.path(S,C),E=u.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),T&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",T),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${f/2}, 0)`),Kt(e,E),e.intersect=function(_){return Bt.polygon(e,b,_)},u}x(Afe,"bowTieRect");function $h(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x($h,"insertPolygonShape");var RE=12;async function _fe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?28:i,s=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+RE),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),d=0,f=u,p=-h,g=0,m=[{x:d+RE,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+RE},{x:d+RE,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const T=Gt.svg(o),b=Wt(e,{}),w=Zr(m),C=T.path(w,b);y=o.insert(()=>C,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=$h(o,u,h,m);return n&&y.attr("style",n),Kt(e,y),e.intersect=function(T){return Bt.polygon(e,m,T)},o}x(_fe,"card");function Rfe(t,e){const{nodeStyles:r}=zt(e);e.label="";const n=t.insert("g").attr("class",fr(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],o=Gt.svg(n),l=Wt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Zr(s),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return Bt.polygon(e,s,f)},n}x(Rfe,"choice");async function AV(t,e,r){const{labelStyles:n,nodeStyles:i}=zt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await xr(t,e,fr(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?s.width/2+l*2:s.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Gt.svg(a),g=Wt(e,{}),m=p.circle(0,0,h*2,g);d=a.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",ka(f))}else d=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return Kt(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return Bt.circle(p,m,g)},e.intersect=function(p){return le.info("Circle intersect",e,h,p),Bt.circle(e,h,p)},a}x(AV,"circle");function Lfe(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},a={x:-(n/2)*e,y:n/2*r},s={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${o.x},${o.y} + M ${i.x},${i.y} L ${s.x},${s.y}`}x(Lfe,"createLine");function Mfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",fr(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:s}=e,o=Gt.svg(i),l=Wt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=Lfe(a),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),s&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),Kt(e,f),e.intersect=function(p){return le.info("crossedCircle intersect",e,{radius:a,point:p}),Bt.circle(e,a,p)},i}x(Mfe,"crossedCircle");function Pu(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-u/2+d-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Kt(e,S),e.intersect=function(k){return Bt.polygon(e,g,k)},i}x(Ife,"curlyBraceLeft");function Bu(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Kt(e,S),e.intersect=function(k){return Bt.polygon(e,g,k)},i}x(Nfe,"curlyBraceRight");function Pa(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;d_,":first-child").attr("stroke-opacity",0),M.insert(()=>w,":first-child"),M.insert(()=>k,":first-child"),M.attr("class","text"),f&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",n),M.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Kt(e,M),e.intersect=function(L){return Bt.polygon(e,m,L)},i}x(Dfe,"curlyBraces");async function Ofe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await xr(t,e,fr(e)),d=Math.max(o,(h.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+s*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=Gt.svg(u),y=Wt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,T=f,b=v-p,w=T/4,C=[{x:b,y:0},{x:w,y:0},{x:0,y:T/2},{x:w,y:T},{x:b,y:T},...FC(-b,-T/2,p,50,270,90)],S=Zr(C),k=m.path(S,y),E=u.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",n),E.attr("transform",`translate(${-d/2}, ${-f/2})`),Kt(e,E),e.intersect=function(_){return Bt.polygon(e,C,_)},u}x(Ofe,"curvedTrapezoid");var zje=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),Vje=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),Gje=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),VK=8,GK=8;async function $fe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?24:i,s=e.look==="neo"?24:i;if(e.width||e.height){const y=e.width??0;e.width=(e.width??0)-s,e.widthC,":first-child"),g=o.insert(()=>w,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=zje(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",ka(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Kt(e,g),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(e.padding??0)/1.5-(l.y-(l.top??0))})`),e.intersect=function(y){const v=Bt.rect(e,y),T=v.x-(e.x??0);if(d!=0&&(Math.abs(T)<(e.width??0)/2||Math.abs(T)==(e.width??0)/2&&Math.abs(v.y-(e.y??0))>(e.height??0)/2-f)){let b=f*f*(1-T*T/(d*d));b>0&&(b=Math.sqrt(b)),b=f-b,y.y-(e.y??0)>0&&(b=-b),v.y+=b}return v},o}x($fe,"cylinder");async function bx(t,e,r){const{labelStyles:n,nodeStyles:i}=zt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await xr(t,e,fr(e)),o=Math.max(s.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(s.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r!=null&&r.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=Gt.svg(a),y=Wt(e,{}),v=f||p?m.path(wf(u,h,o,l,f||0),y):m.rectangle(u,h,o,l,y);d=a.insert(()=>v,":first-child"),d.attr("class","basic label-container").attr("style",ka(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",ka(f)).attr("ry",ka(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return Kt(e,d),e.calcIntersect=function(m,y){return Bt.rect(m,y)},e.intersect=function(m){return Bt.rect(e,m)},a}x(bx,"drawRect");async function Pfe(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:s,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},u=await bx(t,e,l);if(e.look==="handDrawn"){const p=Gt.svg(u),g=Wt(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return u;let v=null;if(y instanceof SVGGraphicsElement)v=y.getBBox();else return u;return u.insert(()=>p.line(v.x,v.y,v.x+v.width,v.y,g),".basic.label-container g.label"),u.insert(()=>p.line(v.x,v.y+v.height,v.x+v.width,v.y+v.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}x(Pfe,"datastore");async function Bfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?16:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await xr(t,e,fr(e)),u=o.width+i,h=o.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=Gt.svg(s),y=Wt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],T=m.polygon(v.map(w=>[w.x,w.y]),y),b=s.insert(()=>T,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(e.padding??0)/2-(o.x-(o.left??0))}, ${p+d+(e.padding??0)/2-(o.y-(o.top??0))})`),Kt(e,b),e.intersect=function(w){return Bt.rect(e,w)},s}x(Bfe,"dividedRectangle");async function Ffe(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=zt(e),i=e.look==="neo"?12:5;e.labelStyle=r;const a=e.padding??0,s=e.look==="neo"?16:a,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(s??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=Gt.svg(o),y=Wt(e,{roughness:.2,strokeWidth:2.5}),v=Wt(e,{roughness:.2,strokeWidth:1.5}),T=m.circle(0,0,u*2,y),b=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",ka(e.cssClasses)).attr("style",ka(f)),(p=d.node())==null||p.appendChild(T),(g=d.node())==null||g.appendChild(b)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),y=d.insert("circle");d.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),y.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return Kt(e,d),e.intersect=function(m){return le.info("DoubleCircle intersect",e,u,m),Bt.circle(e,u,m)},o}x(Ffe,"doublecircle");function zfe(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=zt(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",fr(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=Gt.svg(a),{nodeBorder:u}=r,h=Wt(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),f=a.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),Kt(e,f),e.intersect=function(p){return le.info("filledCircle intersect",e,{radius:s,point:p}),Bt.circle(e,s,p)},a}x(zfe,"filledCircle");var WK=10,HK=10;async function Vfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.height=(e==null?void 0:e.height)??0,e.heightv,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),e.width=u,e.height=h,Kt(e,T),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(e.padding??0)/2+(o.y-(o.top??0))})`),e.intersect=function(b){return le.info("Triangle intersect",e,f,b),Bt.polygon(e,f,b)},s}x(Vfe,"flippedTriangle");function Gfe(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=zt(e);e.label="";const s=t.insert("g").attr("class",fr(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),u=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),u=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,d=-1*u/2,f=Gt.svg(s),p=Wt(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=s.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),Kt(e,m);const y=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=y/2||0,e.height+=y/2||0),e.intersect=function(v){return Bt.rect(e,v)},s}x(Gfe,"forkJoin");async function Wfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=15,a=10,s=e.look==="neo"?16:e.padding??0,o=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0:e.height)??0)-o*2,e.heightT,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Kt(e,b),e.intersect=function(w){return le.info("Pill intersect",e,{radius:f,point:w}),Bt.polygon(e,y,w)},l}x(Wfe,"halfRoundedRectangle");var Wje=x((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function Hfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const a=e.padding??0,s=70,o=32,l=e.look==="neo"?s:a,u=e.look==="neo"?o:a;if(e.width||e.height){const b=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*b-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await xr(t,e,fr(e)),f=(e!=null&&e.height?e==null?void 0:e.height:d.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:d.width)+2*p+u,m=[{x:p,y:0},{x:g-p,y:0},{x:g,y:-f/2},{x:g-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const T=Gt.svg(h),b=Wt(e,{}),w=Wje(0,0,g,f,p),C=T.path(w,b);y=h.insert(()=>C,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=$h(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,Kt(e,y),e.intersect=function(T){return Bt.polygon(e,m,T)},h}x(Hfe,"hexagon");async function qfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await xr(t,e,fr(e)),a=Math.max(30,(e==null?void 0:e.width)??0),s=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=Gt.svg(i),u=Wt(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=Zr(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-s/2})`),Kt(e,p),e.intersect=function(g){return le.info("Pill intersect",e,{points:h}),Bt.polygon(e,h,g)},i}x(qfe,"hourglass");async function Ufe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await xr(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=yx(e),v=-g/2,T=-p/2,b=e.label?8:0,w=Gt.svg(u),C=Wt(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=w.rectangle(v,T,g,p,C),k=Math.max(g,h.width),E=p+h.height+b,_=w.rectangle(-k/2,-E/2,k,E,{...C,fill:"transparent",stroke:"none"}),M=u.insert(()=>S,":first-child"),L=u.insert(()=>_);if(e.icon){const P=u.append("g");P.html(`${await bh(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const D=P.node().getBBox(),R=D.width,I=D.height,$=D.x,O=D.y;P.attr("transform",`translate(${-R/2-$},${f?h.height/2+b/2-I/2-O:-h.height/2-b/2-I/2-O})`),P.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-E/2:E/2-h.height})`),M.attr("transform",`translate(0,${f?h.height/2+b/2:-h.height/2-b/2})`),Kt(e,L),e.intersect=function(P){if(le.info("iconSquare intersect",e,P),!e.label)return Bt.rect(e,P);const D=e.x??0,R=e.y??0,I=e.height??0;let $=[];return f?$=[{x:D-h.width/2,y:R-I/2},{x:D+h.width/2,y:R-I/2},{x:D+h.width/2,y:R-I/2+h.height+b},{x:D+g/2,y:R-I/2+h.height+b},{x:D+g/2,y:R+I/2},{x:D-g/2,y:R+I/2},{x:D-g/2,y:R-I/2+h.height+b},{x:D-h.width/2,y:R-I/2+h.height+b}]:$=[{x:D-g/2,y:R-I/2},{x:D+g/2,y:R-I/2},{x:D+g/2,y:R-I/2+p},{x:D+h.width/2,y:R-I/2+p},{x:D+h.width/2/2,y:R+I/2},{x:D-h.width/2,y:R+I/2},{x:D-h.width/2,y:R-I/2+p},{x:D-g/2,y:R-I/2+p}],Bt.polygon(e,$,P)},u}x(Ufe,"icon");async function Yfe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await xr(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=yx(e),T=Gt.svg(u),b=Wt(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=v.get("fill");b.stroke=w??y;const C=u.append("g");e.icon&&C.html(`${await bh(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const S=C.node().getBBox(),k=S.width,E=S.height,_=S.x,M=S.y,L=Math.max(k,E)*Math.SQRT2+f*2,P=T.circle(0,0,L,b),D=Math.max(L,h.width),R=L+h.height+p,I=T.rectangle(-D/2,-R/2,D,R,{...b,fill:"transparent",stroke:"none"}),$=u.insert(()=>P,":first-child"),O=u.insert(()=>I);return C.attr("transform",`translate(${-k/2-_},${g?h.height/2+p/2-E/2-M:-h.height/2-p/2-E/2-M})`),C.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-R/2:R/2-h.height})`),$.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),Kt(e,O),e.intersect=function(N){return le.info("iconSquare intersect",e,N),Bt.rect(e,N)},u}x(Yfe,"iconCircle");async function Xfe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await xr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:T}=yx(e),b=-m/2,w=-g/2,C=e.label?8:0,S=Gt.svg(u),k=Wt(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const E=T.get("fill");k.stroke=E??v;const _=S.path(wf(b,w,m,g,5),k),M=Math.max(m,h.width),L=g+h.height+C,P=S.rectangle(-M/2,-L/2,M,L,{...k,fill:"transparent",stroke:"none"}),D=u.insert(()=>_,":first-child").attr("class","icon-shape2"),R=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await bh(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const $=I.node().getBBox(),O=$.width,N=$.height,F=$.x,z=$.y;I.attr("transform",`translate(${-O/2-F},${p?h.height/2+C/2-N/2-z:-h.height/2-C/2-N/2-z})`),I.attr("style",`color: ${T.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-L/2:L/2-h.height})`),D.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),Kt(e,R),e.intersect=function(I){if(le.info("iconSquare intersect",e,I),!e.label)return Bt.rect(e,I);const $=e.x??0,O=e.y??0,N=e.height??0;let F=[];return p?F=[{x:$-h.width/2,y:O-N/2},{x:$+h.width/2,y:O-N/2},{x:$+h.width/2,y:O-N/2+h.height+C},{x:$+m/2,y:O-N/2+h.height+C},{x:$+m/2,y:O+N/2},{x:$-m/2,y:O+N/2},{x:$-m/2,y:O-N/2+h.height+C},{x:$-h.width/2,y:O-N/2+h.height+C}]:F=[{x:$-m/2,y:O-N/2},{x:$+m/2,y:O-N/2},{x:$+m/2,y:O-N/2+g},{x:$+h.width/2,y:O-N/2+g},{x:$+h.width/2/2,y:O+N/2},{x:$-h.width/2,y:O+N/2},{x:$-h.width/2,y:O-N/2+g},{x:$-m/2,y:O-N/2+g}],Bt.polygon(e,F,I)},u}x(Xfe,"iconRounded");async function jfe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await xr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:T}=yx(e),b=-m/2,w=-g/2,C=e.label?8:0,S=Gt.svg(u),k=Wt(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const E=T.get("fill");k.stroke=E??v;const _=S.path(wf(b,w,m,g,.1),k),M=Math.max(m,h.width),L=g+h.height+C,P=S.rectangle(-M/2,-L/2,M,L,{...k,fill:"transparent",stroke:"none"}),D=u.insert(()=>_,":first-child"),R=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await bh(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const $=I.node().getBBox(),O=$.width,N=$.height,F=$.x,z=$.y;I.attr("transform",`translate(${-O/2-F},${p?h.height/2+C/2-N/2-z:-h.height/2-C/2-N/2-z})`),I.attr("style",`color: ${T.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-L/2:L/2-h.height})`),D.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),Kt(e,R),e.intersect=function(I){if(le.info("iconSquare intersect",e,I),!e.label)return Bt.rect(e,I);const $=e.x??0,O=e.y??0,N=e.height??0;let F=[];return p?F=[{x:$-h.width/2,y:O-N/2},{x:$+h.width/2,y:O-N/2},{x:$+h.width/2,y:O-N/2+h.height+C},{x:$+m/2,y:O-N/2+h.height+C},{x:$+m/2,y:O+N/2},{x:$-m/2,y:O+N/2},{x:$-m/2,y:O-N/2+h.height+C},{x:$-h.width/2,y:O-N/2+h.height+C}]:F=[{x:$-m/2,y:O-N/2},{x:$+m/2,y:O-N/2},{x:$+m/2,y:O-N/2+g},{x:$+h.width/2,y:O-N/2+g},{x:$+h.width/2/2,y:O+N/2},{x:$-h.width/2,y:O+N/2},{x:$-h.width/2,y:O-N/2+g},{x:$-m/2,y:O-N/2+g}],Bt.polygon(e,F,I)},u}x(jfe,"iconSquare");async function Kfe(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=zt(e);e.labelStyle=s;const o=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?o??0:0,(e==null?void 0:e.assetWidth)??i),u=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??a;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await xr(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,T=Gt.svg(d),b=Wt(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=T.rectangle(m,y,u,h,b),C=Math.max(u,f.width),S=h+f.height+v,k=T.rectangle(-C/2,-S/2,C,S,{...b,fill:"none",stroke:"none"}),E=d.insert(()=>w,":first-child"),_=d.insert(()=>k);if(e.img){const M=d.append("image");M.attr("href",e.img),M.attr("width",u),M.attr("height",h),M.attr("preserveAspectRatio","none"),M.attr("transform",`translate(${-u/2},${g?S/2-h:-S/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-v/2:h/2-f.height/2+v/2})`),E.attr("transform",`translate(0,${g?f.height/2+v/2:-f.height/2-v/2})`),Kt(e,_),e.intersect=function(M){if(le.info("iconSquare intersect",e,M),!e.label)return Bt.rect(e,M);const L=e.x??0,P=e.y??0,D=e.height??0;let R=[];return g?R=[{x:L-f.width/2,y:P-D/2},{x:L+f.width/2,y:P-D/2},{x:L+f.width/2,y:P-D/2+f.height+v},{x:L+u/2,y:P-D/2+f.height+v},{x:L+u/2,y:P+D/2},{x:L-u/2,y:P+D/2},{x:L-u/2,y:P-D/2+f.height+v},{x:L-f.width/2,y:P-D/2+f.height+v}]:R=[{x:L-u/2,y:P-D/2},{x:L+u/2,y:P-D/2},{x:L+u/2,y:P-D/2+h},{x:L+f.width/2,y:P-D/2+h},{x:L+f.width/2/2,y:P+D/2},{x:L-f.width/2,y:P+D/2},{x:L-f.width/2,y:P-D/2+h},{x:L-u/2,y:P-D/2+h}],Bt.polygon(e,R,M)},d}x(Kfe,"imageSquare");async function Zfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=Math.max(l.width+(s??0)*2,(e==null?void 0:e.width)??0),h=Math.max(l.height+(a??0)*2,(e==null?void 0:e.height)??0),d=[{x:0,y:0},{x:u,y:0},{x:u+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Gt.svg(o),m=Wt(e,{}),y=Zr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=$h(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,Kt(e,f),e.intersect=function(g){return Bt.polygon(e,d,g)},o}x(Zfe,"inv_trapezoid");async function Qfe(t,e){const{shapeSvg:r,bbox:n,label:i}=await xr(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Kt(e,a),e.intersect=function(l){return Bt.rect(e,l)},r}x(Qfe,"labelRect");async function Jfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:0,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:-(3*u)/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Gt.svg(o),m=Wt(e,{}),y=Zr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=$h(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Kt(e,f),e.intersect=function(g){return Bt.polygon(e,d,g)},o}x(Jfe,"lean_left");async function epe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Gt.svg(o),m=Wt(e,{}),y=Zr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=$h(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Kt(e,f),e.intersect=function(g){return Bt.polygon(e,d,g)},o}x(epe,"lean_right");function tpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",fr(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,(e==null?void 0:e.width)??0),o=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:s,y:0},{x:0,y:o+l/2},{x:s-2*l,y:o+l/2},{x:0,y:2*o},{x:s,y:o-l/2},{x:2*l,y:o-l/2}],h=Gt.svg(i),d=Wt(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Zr(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),a&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${s/2},${-o})`),Kt(e,g),e.intersect=function(m){return le.info("lightningBolt intersect",e,m),Bt.polygon(e,u,m)},i}x(tpe,"lightningBolt");var Hje=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),qje=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),Uje=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),qK=10,UK=10;async function rpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-a,e.widthS,":first-child").attr("class","line"),m=o.insert(()=>C,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=Hje(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",ka(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Kt(e,m),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),e.intersect=function(v){const T=Bt.rect(e,v),b=T.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(T.y-(e.y??0))>(e.height??0)/2-f)){let w=f*f*(1-b*b/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,v.y-(e.y??0)>0&&(w=-w),T.y+=w}return T},o}x(rpe,"linedCylinder");async function npe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;if(e.width||e.height){const w=e.width;e.width=(w??0)*10/11-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,fr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(a??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(s??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=Gt.svg(o),y=Wt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...rf(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,f,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],T=m.polygon(v.map(w=>[w.x,w.y]),y),b=o.insert(()=>T,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(e.padding??0)-f/2-(l.y-(l.top??0))})`),Kt(e,b),e.intersect=function(w){return Bt.polygon(e,v,w)},o}x(npe,"linedWaveEdgedRect");async function ipe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await xr(t,e,fr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+a*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+s*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,y=-g/2,{cssStyles:v}=e,T=Gt.svg(l),b=Wt(e,{}),w=[{x:m-o,y:y+o},{x:m-o,y:y+g+o},{x:m+p-o,y:y+g+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y:y+g-o},{x:m+p+o,y:y+g-o},{x:m+p+o,y:y-o},{x:m+o,y:y-o},{x:m+o,y},{x:m,y},{x:m,y:y+o}],C=[{x:m,y:y+o},{x:m+p-o,y:y+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y},{x:m,y}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Zr(w);let k=T.path(S,b);const E=Zr(C);let _=T.path(E,b);e.look!=="handDrawn"&&(k=BO(k),_=BO(_));const M=l.insert("g",":first-child");return M.insert(()=>k),M.insert(()=>_),M.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(u.width/2)-o-(u.x-(u.left??0))}, ${-(u.height/2)+o-(u.y-(u.top??0))})`),Kt(e,M),e.intersect=function(L){return Bt.polygon(e,w,L)},l}x(ipe,"multiRect");async function ape(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await xr(t,e,fr(e)),o=e.padding??0,l=e.look==="neo"?16:o,u=e.look==="neo"?12:o;let h=!0;(e.width||e.height)&&(h=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const d=Math.max(a.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(a.height,(e==null?void 0:e.height)??0)+u*3,p=e.look==="neo"?f/4:f/8,g=f+(h?p/2:-p/2),m=-d/2,y=-g/2,v=10,{cssStyles:T}=e,b=rf(m-v,y+g+v,m+d-v,y+g+v,p,.8),w=b==null?void 0:b[b.length-1],C=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...b,{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y:w.y-2*v},{x:m+d+v,y:w.y-2*v},{x:m+d+v,y:y-v},{x:m+v,y:y-v},{x:m+v,y},{x:m,y},{x:m,y:y+v}],S=[{x:m,y:y+v},{x:m+d-v,y:y+v},{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y},{x:m,y}],k=Gt.svg(i),E=Wt(e,{});e.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const _=Zr(C),M=k.path(_,E),L=Zr(S),P=k.path(L,E),D=i.insert(()=>M,":first-child");return D.insert(()=>P),D.attr("class","basic label-container outer-path"),T&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",T),n&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",n),D.attr("transform",`translate(0,${-p/2})`),s.attr("transform",`translate(${-(a.width/2)-v-(a.x-(a.left??0))}, ${-(a.height/2)+v-p/2-(a.y-(a.top??0))})`),Kt(e,D),e.intersect=function(R){return Bt.polygon(e,C,R)},i}x(ape,"multiWaveEdgedRectangle");async function spe(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=zt(e);e.labelStyle=n,e.useHtmlLabels||xn(Xt())||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await xr(t,e,fr(e)),u=Math.max(o.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(o.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=Gt.svg(s),m=Wt(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,u,h,m),v=s.insert(()=>y,":first-child");return v.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Kt(e,v),e.intersect=function(T){return Bt.rect(e,T)},s}x(spe,"note");var Yje=x((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function ope(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await xr(t,e,fr(e)),s=a.width+(e.padding??0),o=a.height+(e.padding??0),l=s+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Gt.svg(i),g=Wt(e,{}),m=Yje(0,0,l),y=p.path(m,g);d=i.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=$h(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),Kt(e,d),e.calcIntersect=function(p,g){const m=p.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],v=Bt.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}x(ope,"question");async function lpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?21:i??0,s=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await xr(t,e,fr(e)),h=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),f=-h/2,p=-d/2,g=p/2,m=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:y}=e,v=Gt.svg(o),T=Wt(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const b=Zr(m),w=v.path(b,T),C=o.insert(()=>w,":first-child");return C.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${-g/2},0)`),u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),Kt(e,C),e.intersect=function(S){return Bt.polygon(e,m,S)},o}x(lpe,"rect_left_inv_arrow");async function cpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),o=a.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await Rd(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(xn(Fe())){const E=h.children[0],_=ut(h);d=E.getBoundingClientRect(),_.attr("width",d.width),_.attr("height",d.height)}le.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await Rd(o,Array.isArray(f)?f.join("
"):f,e.labelStyle,!0,!0),m=g.children[0],y=ut(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;ut(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),ut(h).attr("transform","translate( "+(d.width(le.debug("Rough node insert CXC",M),L),":first-child"),S=a.insert(()=>(le.debug("Rough node insert CXC",M),M),":first-child")}else S=s.insert("rect",":first-child"),k=s.insert("line"),S.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-v).attr("y",-d.height/2-v).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),k.attr("class","divider").attr("x1",-d.width/2-v).attr("x2",d.width/2+v).attr("y1",-d.height/2-v+p.height+v).attr("y2",-d.height/2-v+p.height+v);return Kt(e,S),e.intersect=function(E){return Bt.rect(e,E)},a}x(cpe,"rectWithTitle");async function upe(t,e,{config:{themeVariables:r}}){const n=(r==null?void 0:r.radius)??5,i={rx:n,ry:n,labelPaddingX:((e==null?void 0:e.padding)??0)*1,labelPaddingY:((e==null?void 0:e.padding)??0)*1};return bx(t,e,i)}x(upe,"roundedRect");var qf=8;async function hpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?qf:qf*2),h=((e==null?void 0:e.height)??o.height)+a*2,d=u-qf,f=h,p=qf-u/2,g=-h/2,{cssStyles:m}=e,y=Gt.svg(s),v=Wt(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-qf,y:g+f},{x:p-qf,y:g},{x:p,y:g},{x:p,y:g+f}],b=y.polygon(T.map(C=>[C.x,C.y]),v),w=s.insert(()=>b,":first-child");return w.attr("class","basic label-container outer-path").attr("style",ka(m)),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),l.attr("transform",`translate(${qf/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Kt(e,w),e.intersect=function(C){return Bt.rect(e,C)},s}x(hpe,"shadedProcess");async function dpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-s*2,10));const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,fr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:y}=e,v=Gt.svg(o),T=Wt(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const b=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],w=Zr(b),C=v.path(w,T),S=o.insert(()=>C,":first-child");return S.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",y),n&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),Kt(e,S),e.intersect=function(k){return Bt.polygon(e,b,k)},o}x(dpe,"slopedRect");async function fpe(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,a={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return bx(t,e,a)}x(fpe,"squareRect");async function ppe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?20:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=l.height+(e.look==="neo"?s*2:s),h=l.width+u/4+(e.look==="neo"?a*2:a),d=u/2,{cssStyles:f}=e,p=Gt.svg(o),g=Wt(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-u/2},{x:h/2-d,y:-u/2},...FC(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...FC(h/2-d,0,d,50,270,450)],y=Zr(m),v=p.path(y,g),T=o.insert(()=>v,":first-child");return T.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),Kt(e,T),e.intersect=function(b){return Bt.polygon(e,m,b)},o}x(ppe,"stadium");async function gpe(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return bx(t,e,r)}x(gpe,"state");function mpe(t,e,{config:{themeVariables:r}}){var T,b;const{labelStyles:n,nodeStyles:i}=zt(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l,nodeShadow:u}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const h=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=Gt.svg(h),f=Wt(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:s,strokeWidth:2}),g=o??l,m=(e.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),v=h.insert(()=>p,":first-child");if(v.insert(()=>y),e.look!=="handDrawn"&&v.attr("class","outer-path"),a&&v.selectAll("path").attr("style",a),i&&v.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const w=((b=(T=t.node())==null?void 0:T.ownerSVGElement)==null?void 0:b.id)??"",C=w?`${w}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${C})`)}return Kt(e,v),e.intersect=function(w){return Bt.circle(e,(e.width??0)/2,w)},h}x(mpe,"stateEnd");function ype(t,e,{config:{themeVariables:r}}){var o,l;const{lineColor:n,nodeShadow:i}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s;if(e.look==="handDrawn"){const h=Gt.svg(a).circle(0,0,e.width,EYe(n));s=a.insert(()=>h),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&i&&e.look!=="handDrawn"){const u=((l=(o=t.node())==null?void 0:o.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${h})`)}return Kt(e,s),e.intersect=function(u){return Bt.circle(e,(e.width??7)/2,u)},a}x(ype,"stateStart");var Ug=8;async function vpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,a=e.look==="neo"?28:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.width)??l.width)+2*Ug+a,h=((e==null?void 0:e.height)??l.height)+s,d=u-2*Ug,f=h,p=-u/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(e.look==="handDrawn"){const y=Gt.svg(o),v=Wt(e,{}),T=y.rectangle(p,g,d+16,f,v),b=y.line(p+Ug,g,p+Ug,g+f,v),w=y.line(p+Ug+d,g,p+Ug+d,g+f,v);o.insert(()=>b,":first-child"),o.insert(()=>w,":first-child");const C=o.insert(()=>T,":first-child"),{cssStyles:S}=e;C.attr("class","basic label-container").attr("style",ka(S)),Kt(e,C)}else{const y=$h(o,d,f,m);n&&y.attr("style",n),Kt(e,y)}return e.intersect=function(y){return Bt.polygon(e,m,y)},o}x(vpe,"subroutine");var JM=.2;async function bpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-s*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-JM*(e.height+s*2),10));const{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2,h=JM*u,d=JM*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2+h-h,g=u,m=-p/2,y=-g/2,{cssStyles:v}=e,T=Gt.svg(o),b=Wt(e,{}),w=[{x:m-h/2,y},{x:m+p+h/2,y},{x:m+p+h/2,y:y+g},{x:m-h/2,y:y+g}],C=[{x:m+p-h/2,y:y+g},{x:m+p+h/2,y:y+g},{x:m+p+h/2,y:y+g-d}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Zr(w),k=T.path(S,b),E=Zr(C),_=T.path(E,{...b,fillStyle:"solid"}),M=o.insert(()=>_,":first-child");return M.insert(()=>k,":first-child"),M.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",n),Kt(e,M),e.intersect=function(L){return Bt.polygon(e,w,L)},o}x(bpe,"taggedRect");async function xpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await xr(t,e,fr(e)),o=Math.max(a.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(a.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=l/8,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=Gt.svg(i),m=Wt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...rf(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],v=-o/2+o/2*.1,T=-f/2-d*.4,b=[{x:v+o-h,y:(T+l)*1.3},{x:v+o,y:T+l-d},{x:v+o,y:(T+l)*.9},...rf(v+o,(T+l)*1.25,v+o-h,(T+l)*1.3,-l*.02,.5)],w=Zr(y),C=g.path(w,m),S=Zr(b),k=g.path(S,{...m,fillStyle:"solid"}),E=i.insert(()=>k,":first-child");return E.insert(()=>C,":first-child"),E.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),Kt(e,E),e.intersect=function(_){return Bt.polygon(e,y,_)},i}x(xpe,"taggedWaveEdgedRectangle");async function Tpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await xr(t,e,fr(e)),s=Math.max(a.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(a.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-s/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",s).attr("height",o),Kt(e,h),e.intersect=function(d){return Bt.rect(e,d)},i}x(Tpe,"text");var Xje=x((t,e,r,n,i,a)=>`M${t},${e} a${i},${a} 0,0,1 0,${-n} l${r},0 a${i},${a} 0,0,1 0,${n} M${r},${-n} a${i},${a} 0,0,0 0,${n} - l${-r},0`,"createCylinderPathD"),Xje=x((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),jje=x((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),YK=5,XK=10;async function Tpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-a,e.heightb,":first-child"),g=s.insert(()=>T,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=Yje(0,0,f,u,d,h);g=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Ca(p)).attr("style",n),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Kt(e,g),e.intersect=function(m){const y=Bt.rect(e,m),v=y.y-(e.y??0);if(h!=0&&(Math.abs(v)<(e.height??0)/2||Math.abs(v)==(e.height??0)/2&&Math.abs(y.x-(e.x??0))>(e.width??0)/2-d)){let T=d*d*(1-v*v/(h*h));T!=0&&(T=Math.sqrt(Math.abs(T))),T=d-T,m.x-(e.x??0)>0&&(T=-T),y.x+=T}return y},s}x(Tpe,"tiltedCylinder");async function wpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=(e.look==="neo",i),s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Gt.svg(o),m=Wt(e,{}),y=Zr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=$h(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Kt(e,f),e.intersect=function(g){return Bt.polygon(e,d,g)},o}x(wpe,"trapezoid");async function Cpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-s*2,e.heightT,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Kt(e,b),e.intersect=function(w){return Bt.polygon(e,y,w)},u}x(Cpe,"trapezoidalPentagon");var jK=10,KK=10;async function kpe(t,e){var w;const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-a)/2,e.widthT,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=h,e.height=d,Kt(e,b),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(C){return le.info("Triangle intersect",e,p,C),Bt.polygon(e,p,C)},s}x(kpe,"triangle");async function Spe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await xr(t,e,fr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(a??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(s??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,v=14-d,T=v>0?v/2:0,b=Gt.svg(l),w=Wt(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const C=[{x:-d/2-T,y:g/2},...rf(-d/2-T,g/2,d/2+T,g/2,p,.8),{x:d/2+T,y:-g/2},{x:-d/2-T,y:-g/2}],S=Zr(C),k=b.path(S,w),E=l.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),Kt(e,E),e.intersect=function(_){return Bt.polygon(e,C,_)},l}x(Spe,"waveEdgedRectangle");async function Epe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const w=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-w*(20/9)),e.width=e.width-a*2}const{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s,d=h/8,f=h+d*2,{cssStyles:p}=e,g=Gt.svg(o),m=Wt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...rf(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...rf(u/2,-f/2,-u/2,-f/2,d,-1)],v=Zr(y),T=g.path(v,m),b=o.insert(()=>T,":first-child");return b.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),Kt(e,b),e.intersect=function(w){return Bt.polygon(e,y,w)},o}x(Epe,"waveRectangle");var vi=10;async function Ape(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-vi,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-vi,10));const{shapeSvg:s,bbox:o,label:l}=await xr(t,e,fr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+vi,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+a*2+vi,d=u-vi,f=h-vi,p=-d/2,g=-f/2,{cssStyles:m}=e,y=Gt.svg(s),v=Wt(e,{}),T=[{x:p-vi,y:g-vi},{x:p-vi,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-vi}],b=`M${p-vi},${g-vi} L${p+d},${g-vi} L${p+d},${g+f} L${p-vi},${g+f} L${p-vi},${g-vi} + l${-r},0`,"createCylinderPathD"),jje=x((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),Kje=x((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),YK=5,XK=10;async function wpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-a,e.heightb,":first-child"),g=s.insert(()=>T,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=Xje(0,0,f,u,d,h);g=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",ka(p)).attr("style",n),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Kt(e,g),e.intersect=function(m){const y=Bt.rect(e,m),v=y.y-(e.y??0);if(h!=0&&(Math.abs(v)<(e.height??0)/2||Math.abs(v)==(e.height??0)/2&&Math.abs(y.x-(e.x??0))>(e.width??0)/2-d)){let T=d*d*(1-v*v/(h*h));T!=0&&(T=Math.sqrt(Math.abs(T))),T=d-T,m.x-(e.x??0)>0&&(T=-T),y.x+=T}return y},s}x(wpe,"tiltedCylinder");async function Cpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=(e.look==="neo",i),s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Gt.svg(o),m=Wt(e,{}),y=Zr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=$h(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Kt(e,f),e.intersect=function(g){return Bt.polygon(e,d,g)},o}x(Cpe,"trapezoid");async function kpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-s*2,e.heightT,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Kt(e,b),e.intersect=function(w){return Bt.polygon(e,y,w)},u}x(kpe,"trapezoidalPentagon");var jK=10,KK=10;async function Spe(t,e){var w;const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-a)/2,e.widthT,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=h,e.height=d,Kt(e,b),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(C){return le.info("Triangle intersect",e,p,C),Bt.polygon(e,p,C)},s}x(Spe,"triangle");async function Epe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await xr(t,e,fr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(a??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(s??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,v=14-d,T=v>0?v/2:0,b=Gt.svg(l),w=Wt(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const C=[{x:-d/2-T,y:g/2},...rf(-d/2-T,g/2,d/2+T,g/2,p,.8),{x:d/2+T,y:-g/2},{x:-d/2-T,y:-g/2}],S=Zr(C),k=b.path(S,w),E=l.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),Kt(e,E),e.intersect=function(_){return Bt.polygon(e,C,_)},l}x(Epe,"waveEdgedRectangle");async function Ape(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const w=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-w*(20/9)),e.width=e.width-a*2}const{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s,d=h/8,f=h+d*2,{cssStyles:p}=e,g=Gt.svg(o),m=Wt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...rf(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...rf(u/2,-f/2,-u/2,-f/2,d,-1)],v=Zr(y),T=g.path(v,m),b=o.insert(()=>T,":first-child");return b.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),Kt(e,b),e.intersect=function(w){return Bt.polygon(e,y,w)},o}x(Ape,"waveRectangle");var vi=10;async function _pe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-vi,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-vi,10));const{shapeSvg:s,bbox:o,label:l}=await xr(t,e,fr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+vi,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+a*2+vi,d=u-vi,f=h-vi,p=-d/2,g=-f/2,{cssStyles:m}=e,y=Gt.svg(s),v=Wt(e,{}),T=[{x:p-vi,y:g-vi},{x:p-vi,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-vi}],b=`M${p-vi},${g-vi} L${p+d},${g-vi} L${p+d},${g+f} L${p-vi},${g+f} L${p-vi},${g-vi} M${p-vi},${g} L${p+d},${g} - M${p},${g-vi} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const w=y.path(b,v),C=s.insert(()=>w,":first-child");return C.attr("transform",`translate(${vi/2}, ${vi/2})`),C.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+vi/2-(o.x-(o.left??0))}, ${-(o.height/2)+vi/2-(o.y-(o.top??0))})`),Kt(e,C),e.intersect=function(S){return Bt.polygon(e,T,S)},s}x(Ape,"windowPane");var ZK=new Set(["redux-color","redux-dark-color"]),Kje=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function _V(t,e){var Z,Y,ie,K;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=Xt(),{rowEven:a,rowOdd:s,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Q}=Xt(),{background:te}=Q,J={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${te}`]};await _V(t,J)}const u=Xt();e.useHtmlLabels=u.htmlLabels;let h=((Z=u.er)==null?void 0:Z.diagramPadding)??10,d=((Y=u.er)==null?void 0:Y.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=zt(e);if(r.attributes.length===0&&e.label){const Q={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};zs(e.label,u)+Q.labelPaddingX*20){const Q=v.width+h*2-(C+S+k+E);C+=Q/L,S+=Q/L,k>0&&(k+=Q/L),E>0&&(E+=Q/L)}const D=C+S+k+E,R=Gt.svg(y),I=Wt(e,{});e.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let $=0;w.length>0&&($=w.reduce((Q,te)=>Q+((te==null?void 0:te.rowHeight)??0),0));const O=Math.max(P.width+h*2,(e==null?void 0:e.width)||0,D),N=Math.max(($??0)+v.height,(e==null?void 0:e.height)||0),F=-O/2,z=-N/2;if(y.selectAll("g:not(:first-child)").each((Q,te,J)=>{const ge=ut(J[te]),ee=ge.attr("transform");let Re=0,Ie=0;if(ee){const ce=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ee);ce&&(Re=parseFloat(ce[1]),Ie=parseFloat(ce[2]),ge.attr("class").includes("attribute-name")?Re+=C:ge.attr("class").includes("attribute-keys")?Re+=C+S:ge.attr("class").includes("attribute-comment")&&(Re+=C+S+k))}ge.attr("transform",`translate(${F+h/2+Re}, ${Ie+z+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(z+d/2)+")"),n!=null&&ZK.has(n)){const Q=r.colorIndex??0;y.attr("data-color-id",`color-${Q%l.length}`)}const V=R.rectangle(F,z,O,N,I),B=y.insert(()=>V,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[Q,te]of w.entries()){const ge=(Q+1)%2===0&&te.yOffset!==0,ee=R.rectangle(F,v.height+z+(te==null?void 0:te.yOffset),O,te==null?void 0:te.rowHeight,{...I,fill:ge?a:s,stroke:o});y.insert(()=>ee,"g.label").attr("style",f.join("")).attr("class",`row-rect-${ge?"even":"odd"}`)}const G=1e-4;let H=xm(F,v.height+z,O+F,v.height+z,G),q=R.polygon(H.map(Q=>[Q.x,Q.y]),I);if(y.insert(()=>q).attr("class","divider"),H=xm(C+F,v.height+z,C+F,N+z,G),q=R.polygon(H.map(Q=>[Q.x,Q.y]),I),y.insert(()=>q).attr("class","divider"),_){const Q=C+S+F;H=xm(Q,v.height+z,Q,N+z,G),q=R.polygon(H.map(te=>[te.x,te.y]),I),y.insert(()=>q).attr("class","divider")}if(M){const Q=C+S+k+F;H=xm(Q,v.height+z,Q,N+z,G),q=R.polygon(H.map(te=>[te.x,te.y]),I),y.insert(()=>q).attr("class","divider")}for(const Q of b){const te=v.height+z+Q;H=xm(F,te,O+F,te,G),q=R.polygon(H.map(J=>[J.x,J.y]),I),y.insert(()=>q).attr("class","divider")}if(Kt(e,B),g&&e.look!=="handDrawn")if(n!=null&&Kje.has(n))y.selectAll("path").attr("style",g);else{const Q=g.split(";"),te=(K=Q==null?void 0:Q.filter(J=>J.includes("stroke")))==null?void 0:K.map(J=>`${J}`).join("; ");y.selectAll("path").attr("style",te??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Q){return Bt.rect(e,Q)},y}x(_V,"erBox");async function bm(t,e,r,n=0,i=0,a=[],s=""){const o=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==fd(e)&&(e=fd(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await ws(o,e,{width:zs(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(su(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=ut(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}x(bm,"addText");function xm(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}x(xm,"lineToPolygon");async function _pe(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",fr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const T=e.annotations[0];await YT(o,{text:`«${T}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await YT(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=s.insert("g").attr("class","members-group text");let m=0;for(const T of e.members){const b=await YT(u,T,m,[T.parseClassifier()]);m+=b+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let y=0;for(const T of e.methods){const b=await YT(h,T,y,[T.parseClassifier()]);y+=b+a}let v=s.node().getBBox();if(o!==null){const T=o.node().getBBox();o.attr("transform",`translate(${-T.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=s.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=s.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=s.node().getBBox(),{shapeSvg:s,bbox:v}}x(_pe,"textHelper");async function YT(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=Xt();let s="useHtmlLabels"in e?e.useHtmlLabels:su(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),$i(o)&&(s=!0);const l=await ws(i,Lz(vh(o)),{width:zs(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=ut(l);h=d.innerHTML.split("
").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(y=>{function v(){var T;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((T=a.fontSize)==null?void 0:T.toString())??window.getComputedStyle(document.body).fontSize,C=parseInt(b,10)*5+"px";m.style.minWidth=C,m.style.maxWidth=C}else m.style.width="100%";y(m)}x(v,"setupImage"),setTimeout(()=>{m.complete&&v()}),m.addEventListener("error",v),m.addEventListener("load",v)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&ut(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}x(YT,"addText");async function Rpe(t,e){var R,I;const r=Fe(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,o=e.useHtmlLabels??su(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await _pe(t,e,r,o,s),{labelStyles:d,nodeStyles:f}=zt(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((R=l.styles)==null?void 0:R.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((I=r.class)!=null&&I.hideEmptyMembersBox),m=Gt.svg(u),y=Wt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let T=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?T+=s:l.members.length>0&&l.methods.length===0&&(T+=s*2);const w=-v/2,C=-T/2;let S=g?a*2:l.members.length===0&&l.methods.length===0?-a:0;b&&(S=a*2);const k=m.rectangle(w-a,C-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0),v+2*a,T+2*a+S,y),E=u.insert(()=>k,":first-child");E.attr("class","basic label-container outer-path");const _=E.node().getBBox(),M=u.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,L=u.select(".label-group").node().getBBox().height-(g?a/2:0)||0,P=u.select(".members-group").node().getBBox().height-(g?a/2:0)||0,D=(M+L+C+a-(C-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each(($,O,N)=>{var H,q;const F=ut(N[O]),z=F.attr("transform");let V=0;if(z){const Y=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);Y&&(V=parseFloat(Y[2]))}let B=V+C+a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0);if(F.attr("class").includes("methods-group")){const Z=Math.max(P,s/2);b?B=Math.max(D,M+L+Z+C+s*2+a)+s*2:B=M+L+Z+C+s*4+a}l.members.length===0&&l.methods.length===0&&((H=r.class)!=null&&H.hideEmptyMembersBox)&&(l.annotations.length>0?B=V-s:B=V),o||(B-=4);let G=w;(F.attr("class").includes("label-group")||F.attr("class").includes("annotation-group"))&&(G=-((q=F.node())==null?void 0:q.getBBox().width)/2||0,u.selectAll("text").each(function(Z,Y,ie){window.getComputedStyle(ie[Y]).textAnchor==="middle"&&(G=0)})),F.attr("transform",`translate(${G}, ${B})`)}),l.members.length>0||l.methods.length>0||g){const $=M+L+C+a,O=m.line(_.x,$,_.x+_.width,$+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const $=M+L+P+C+s*2+a,O=m.line(_.x,b?Math.max(D,$):$,_.x+_.width,(b?Math.max(D,$):$)+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),E.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const $=RegExp(/color\s*:\s*([^;]*)/),O=$.exec(p);if(O){const N=O[0].replace("color","fill");u.selectAll("tspan").attr("style",N)}else if(d){const N=$.exec(d);if(N){const F=N[0].replace("color","fill");u.selectAll("tspan").attr("style",F)}}}return Kt(e,E),e.intersect=function($){return Bt.rect(e,$)},u}x(Rpe,"classBox");async function Lpe(t,e){var _,M;const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=fr(e),{themeVariables:h}=Fe(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await wc(p,`<<${i.type}>>`,0,e.labelStyle):g=await wc(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await wc(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const L=await wc(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=L;const P=await wc(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const D=await wc(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=D,await wc(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const L=await wc(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=L,await wc(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const v=(((_=p.node())==null?void 0:_.getBBox().width)??200)+s,T=(((M=p.node())==null?void 0:M.getBBox().height)??200)+s,b=-v/2,w=-T/2,C=Gt.svg(p),S=Wt(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const k=C.rectangle(b,w,v,T,S),E=p.insert(()=>k,":first-child");if(E.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const L=e.colorIndex??0;p.attr("data-color-id",`color-${L%d.length}`)}if(p.selectAll(".label").each((L,P,D)=>{const R=ut(D[P]),I=R.attr("transform");let $=0,O=0;if(I){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);V&&($=parseFloat(V[1]),O=parseFloat(V[2]))}const N=O-T/2;let F=b+s/2;(P===0||P===1)&&(F=$),R.attr("transform",`translate(${F}, ${N+s})`)}),m>g+y+o){const L=w+g+y+o;let P;if(e.look==="neo"){const I=[[b,L],[b+v,L],[b+v,L+.001],[b,L+.001]];P=C.polygon(I,S)}else P=C.line(b,L,b+v,L,S);p.insert(()=>P).attr("class","divider")}return Kt(e,E),e.intersect=function(L){return Bt.rect(e,L)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}x(Lpe,"requirementBox");async function wc(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=Fe(),s=a.htmlLabels??!0,o=await ws(i,Lz(vh(e)),{width:zs(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const u=o.children[0],h=ut(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}x(wc,"addText");var Zje=x(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Mpe(t,e,{config:r}){var P,D;const{labelStyles:n,nodeStyles:i}=zt(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,fr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(d=(D=r==null?void 0:r.kanban)==null?void 0:D.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await QM(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await QM(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await QM(o,"assigned"in e&&e.assigned||"",p);e.width=s;const T=10,b=(e==null?void 0:e.width)||0,w=Math.max(m.height,v.height)/2,C=Math.max(l.height+T*2,(e==null?void 0:e.height)||0)+w,S=-b/2,k=-C/2;u.attr("transform","translate("+(h-b/2)+", "+(-w-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-w+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*a)+", "+(-w+l.height/2)+")");let E;const{rx:_,ry:M}=e,{cssStyles:L}=e;if(e.look==="handDrawn"){const R=Gt.svg(o),I=Wt(e,{}),$=_||M?R.path(wf(S,k,b,C,_||0),I):R.rectangle(S,k,b,C,I);E=o.insert(()=>$,":first-child"),E.attr("class","basic label-container").attr("style",L||null)}else{E=o.insert("rect",":first-child"),E.attr("class","basic label-container __APA__").attr("style",i).attr("rx",_??5).attr("ry",M??5).attr("x",S).attr("y",k).attr("width",b).attr("height",C);const R="priority"in e&&e.priority;if(R){const I=o.append("line"),$=S+2,O=k+Math.floor((_??0)/2),N=k+C-Math.floor((_??0)/2);I.attr("x1",$).attr("y1",O).attr("x2",$).attr("y2",N).attr("stroke-width","4").attr("stroke",Zje(R))}}return Kt(e,E),e.height=C,e.intersect=function(R){return Bt.rect(e,R)},o}x(Mpe,"kanbanItem");async function Ipe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,fr(e)),l=a.width+10*s,u=a.height+8*s,h=.15*l,{cssStyles:d}=e,f=a.width+20,p=a.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let y;const v=`M0 0 + M${p},${g-vi} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const w=y.path(b,v),C=s.insert(()=>w,":first-child");return C.attr("transform",`translate(${vi/2}, ${vi/2})`),C.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+vi/2-(o.x-(o.left??0))}, ${-(o.height/2)+vi/2-(o.y-(o.top??0))})`),Kt(e,C),e.intersect=function(S){return Bt.polygon(e,T,S)},s}x(_pe,"windowPane");var ZK=new Set(["redux-color","redux-dark-color"]),Zje=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function _V(t,e){var Z,Y,ie,K;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=Xt(),{rowEven:a,rowOdd:s,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Q}=Xt(),{background:te}=Q,J={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${te}`]};await _V(t,J)}const u=Xt();e.useHtmlLabels=u.htmlLabels;let h=((Z=u.er)==null?void 0:Z.diagramPadding)??10,d=((Y=u.er)==null?void 0:Y.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=zt(e);if(r.attributes.length===0&&e.label){const Q={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};zs(e.label,u)+Q.labelPaddingX*20){const Q=v.width+h*2-(C+S+k+E);C+=Q/L,S+=Q/L,k>0&&(k+=Q/L),E>0&&(E+=Q/L)}const D=C+S+k+E,R=Gt.svg(y),I=Wt(e,{});e.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let $=0;w.length>0&&($=w.reduce((Q,te)=>Q+((te==null?void 0:te.rowHeight)??0),0));const O=Math.max(P.width+h*2,(e==null?void 0:e.width)||0,D),N=Math.max(($??0)+v.height,(e==null?void 0:e.height)||0),F=-O/2,z=-N/2;if(y.selectAll("g:not(:first-child)").each((Q,te,J)=>{const ge=ut(J[te]),ee=ge.attr("transform");let Re=0,Ie=0;if(ee){const ce=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ee);ce&&(Re=parseFloat(ce[1]),Ie=parseFloat(ce[2]),ge.attr("class").includes("attribute-name")?Re+=C:ge.attr("class").includes("attribute-keys")?Re+=C+S:ge.attr("class").includes("attribute-comment")&&(Re+=C+S+k))}ge.attr("transform",`translate(${F+h/2+Re}, ${Ie+z+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(z+d/2)+")"),n!=null&&ZK.has(n)){const Q=r.colorIndex??0;y.attr("data-color-id",`color-${Q%l.length}`)}const V=R.rectangle(F,z,O,N,I),B=y.insert(()=>V,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[Q,te]of w.entries()){const ge=(Q+1)%2===0&&te.yOffset!==0,ee=R.rectangle(F,v.height+z+(te==null?void 0:te.yOffset),O,te==null?void 0:te.rowHeight,{...I,fill:ge?a:s,stroke:o});y.insert(()=>ee,"g.label").attr("style",f.join("")).attr("class",`row-rect-${ge?"even":"odd"}`)}const G=1e-4;let H=xm(F,v.height+z,O+F,v.height+z,G),q=R.polygon(H.map(Q=>[Q.x,Q.y]),I);if(y.insert(()=>q).attr("class","divider"),H=xm(C+F,v.height+z,C+F,N+z,G),q=R.polygon(H.map(Q=>[Q.x,Q.y]),I),y.insert(()=>q).attr("class","divider"),_){const Q=C+S+F;H=xm(Q,v.height+z,Q,N+z,G),q=R.polygon(H.map(te=>[te.x,te.y]),I),y.insert(()=>q).attr("class","divider")}if(M){const Q=C+S+k+F;H=xm(Q,v.height+z,Q,N+z,G),q=R.polygon(H.map(te=>[te.x,te.y]),I),y.insert(()=>q).attr("class","divider")}for(const Q of b){const te=v.height+z+Q;H=xm(F,te,O+F,te,G),q=R.polygon(H.map(J=>[J.x,J.y]),I),y.insert(()=>q).attr("class","divider")}if(Kt(e,B),g&&e.look!=="handDrawn")if(n!=null&&Zje.has(n))y.selectAll("path").attr("style",g);else{const Q=g.split(";"),te=(K=Q==null?void 0:Q.filter(J=>J.includes("stroke")))==null?void 0:K.map(J=>`${J}`).join("; ");y.selectAll("path").attr("style",te??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Q){return Bt.rect(e,Q)},y}x(_V,"erBox");async function bm(t,e,r,n=0,i=0,a=[],s=""){const o=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==fd(e)&&(e=fd(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await ws(o,e,{width:zs(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(su(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=ut(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}x(bm,"addText");function xm(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}x(xm,"lineToPolygon");async function Rpe(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",fr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const T=e.annotations[0];await YT(o,{text:`«${T}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await YT(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=s.insert("g").attr("class","members-group text");let m=0;for(const T of e.members){const b=await YT(u,T,m,[T.parseClassifier()]);m+=b+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let y=0;for(const T of e.methods){const b=await YT(h,T,y,[T.parseClassifier()]);y+=b+a}let v=s.node().getBBox();if(o!==null){const T=o.node().getBBox();o.attr("transform",`translate(${-T.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=s.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=s.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=s.node().getBBox(),{shapeSvg:s,bbox:v}}x(Rpe,"textHelper");async function YT(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=Xt();let s="useHtmlLabels"in e?e.useHtmlLabels:su(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),$i(o)&&(s=!0);const l=await ws(i,Lz(vh(o)),{width:zs(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=ut(l);h=d.innerHTML.split("
").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(y=>{function v(){var T;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((T=a.fontSize)==null?void 0:T.toString())??window.getComputedStyle(document.body).fontSize,C=parseInt(b,10)*5+"px";m.style.minWidth=C,m.style.maxWidth=C}else m.style.width="100%";y(m)}x(v,"setupImage"),setTimeout(()=>{m.complete&&v()}),m.addEventListener("error",v),m.addEventListener("load",v)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&ut(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}x(YT,"addText");async function Lpe(t,e){var R,I;const r=Fe(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,o=e.useHtmlLabels??su(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await Rpe(t,e,r,o,s),{labelStyles:d,nodeStyles:f}=zt(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((R=l.styles)==null?void 0:R.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((I=r.class)!=null&&I.hideEmptyMembersBox),m=Gt.svg(u),y=Wt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let T=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?T+=s:l.members.length>0&&l.methods.length===0&&(T+=s*2);const w=-v/2,C=-T/2;let S=g?a*2:l.members.length===0&&l.methods.length===0?-a:0;b&&(S=a*2);const k=m.rectangle(w-a,C-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0),v+2*a,T+2*a+S,y),E=u.insert(()=>k,":first-child");E.attr("class","basic label-container outer-path");const _=E.node().getBBox(),M=u.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,L=u.select(".label-group").node().getBBox().height-(g?a/2:0)||0,P=u.select(".members-group").node().getBBox().height-(g?a/2:0)||0,D=(M+L+C+a-(C-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each(($,O,N)=>{var H,q;const F=ut(N[O]),z=F.attr("transform");let V=0;if(z){const Y=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);Y&&(V=parseFloat(Y[2]))}let B=V+C+a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0);if(F.attr("class").includes("methods-group")){const Z=Math.max(P,s/2);b?B=Math.max(D,M+L+Z+C+s*2+a)+s*2:B=M+L+Z+C+s*4+a}l.members.length===0&&l.methods.length===0&&((H=r.class)!=null&&H.hideEmptyMembersBox)&&(l.annotations.length>0?B=V-s:B=V),o||(B-=4);let G=w;(F.attr("class").includes("label-group")||F.attr("class").includes("annotation-group"))&&(G=-((q=F.node())==null?void 0:q.getBBox().width)/2||0,u.selectAll("text").each(function(Z,Y,ie){window.getComputedStyle(ie[Y]).textAnchor==="middle"&&(G=0)})),F.attr("transform",`translate(${G}, ${B})`)}),l.members.length>0||l.methods.length>0||g){const $=M+L+C+a,O=m.line(_.x,$,_.x+_.width,$+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const $=M+L+P+C+s*2+a,O=m.line(_.x,b?Math.max(D,$):$,_.x+_.width,(b?Math.max(D,$):$)+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),E.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const $=RegExp(/color\s*:\s*([^;]*)/),O=$.exec(p);if(O){const N=O[0].replace("color","fill");u.selectAll("tspan").attr("style",N)}else if(d){const N=$.exec(d);if(N){const F=N[0].replace("color","fill");u.selectAll("tspan").attr("style",F)}}}return Kt(e,E),e.intersect=function($){return Bt.rect(e,$)},u}x(Lpe,"classBox");async function Mpe(t,e){var _,M;const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=fr(e),{themeVariables:h}=Fe(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await wc(p,`<<${i.type}>>`,0,e.labelStyle):g=await wc(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await wc(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const L=await wc(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=L;const P=await wc(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const D=await wc(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=D,await wc(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const L=await wc(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=L,await wc(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const v=(((_=p.node())==null?void 0:_.getBBox().width)??200)+s,T=(((M=p.node())==null?void 0:M.getBBox().height)??200)+s,b=-v/2,w=-T/2,C=Gt.svg(p),S=Wt(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const k=C.rectangle(b,w,v,T,S),E=p.insert(()=>k,":first-child");if(E.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const L=e.colorIndex??0;p.attr("data-color-id",`color-${L%d.length}`)}if(p.selectAll(".label").each((L,P,D)=>{const R=ut(D[P]),I=R.attr("transform");let $=0,O=0;if(I){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);V&&($=parseFloat(V[1]),O=parseFloat(V[2]))}const N=O-T/2;let F=b+s/2;(P===0||P===1)&&(F=$),R.attr("transform",`translate(${F}, ${N+s})`)}),m>g+y+o){const L=w+g+y+o;let P;if(e.look==="neo"){const I=[[b,L],[b+v,L],[b+v,L+.001],[b,L+.001]];P=C.polygon(I,S)}else P=C.line(b,L,b+v,L,S);p.insert(()=>P).attr("class","divider")}return Kt(e,E),e.intersect=function(L){return Bt.rect(e,L)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}x(Mpe,"requirementBox");async function wc(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=Fe(),s=a.htmlLabels??!0,o=await ws(i,Lz(vh(e)),{width:zs(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const u=o.children[0],h=ut(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}x(wc,"addText");var Qje=x(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Ipe(t,e,{config:r}){var P,D;const{labelStyles:n,nodeStyles:i}=zt(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,fr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(d=(D=r==null?void 0:r.kanban)==null?void 0:D.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await QM(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await QM(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await QM(o,"assigned"in e&&e.assigned||"",p);e.width=s;const T=10,b=(e==null?void 0:e.width)||0,w=Math.max(m.height,v.height)/2,C=Math.max(l.height+T*2,(e==null?void 0:e.height)||0)+w,S=-b/2,k=-C/2;u.attr("transform","translate("+(h-b/2)+", "+(-w-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-w+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*a)+", "+(-w+l.height/2)+")");let E;const{rx:_,ry:M}=e,{cssStyles:L}=e;if(e.look==="handDrawn"){const R=Gt.svg(o),I=Wt(e,{}),$=_||M?R.path(wf(S,k,b,C,_||0),I):R.rectangle(S,k,b,C,I);E=o.insert(()=>$,":first-child"),E.attr("class","basic label-container").attr("style",L||null)}else{E=o.insert("rect",":first-child"),E.attr("class","basic label-container __APA__").attr("style",i).attr("rx",_??5).attr("ry",M??5).attr("x",S).attr("y",k).attr("width",b).attr("height",C);const R="priority"in e&&e.priority;if(R){const I=o.append("line"),$=S+2,O=k+Math.floor((_??0)/2),N=k+C-Math.floor((_??0)/2);I.attr("x1",$).attr("y1",O).attr("x2",$).attr("y2",N).attr("stroke-width","4").attr("stroke",Qje(R))}}return Kt(e,E),e.height=C,e.intersect=function(R){return Bt.rect(e,R)},o}x(Ipe,"kanbanItem");async function Npe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,fr(e)),l=a.width+10*s,u=a.height+8*s,h=.15*l,{cssStyles:d}=e,f=a.width+20,p=a.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let y;const v=`M0 0 a${h},${h} 1 0,0 ${g*.25},${-1*m*.1} a${h},${h} 1 0,0 ${g*.25},0 a${h},${h} 1 0,0 ${g*.25},0 @@ -477,7 +477,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33} a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34} a${h},${h} 1 0,0 ${g*.1},${-1*m*.33} - H0 V0 Z`;if(e.look==="handDrawn"){const T=Gt.svg(i),b=Wt(e,{}),w=T.path(v,b);y=i.insert(()=>w,":first-child"),y.attr("class","basic label-container").attr("style",Ca(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),Kt(e,y),e.calcIntersect=function(T,b){return Bt.rect(T,b)},e.intersect=function(T){return le.info("Bang intersect",e,T),Bt.rect(e,T)},i}x(Ipe,"bang");async function Npe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,fr(e)),l=a.width+2*s,u=a.height+2*s,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0 + H0 V0 Z`;if(e.look==="handDrawn"){const T=Gt.svg(i),b=Wt(e,{}),w=T.path(v,b);y=i.insert(()=>w,":first-child"),y.attr("class","basic label-container").attr("style",ka(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),Kt(e,y),e.calcIntersect=function(T,b){return Bt.rect(T,b)},e.intersect=function(T){return le.info("Bang intersect",e,T),Bt.rect(e,T)},i}x(Npe,"bang");async function Dpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,fr(e)),l=a.width+2*s,u=a.height+2*s,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0 a${h},${h} 0 0,1 ${l*.25},${-1*l*.1} a${f},${f} 1 0,1 ${l*.4},${-1*l*.1} a${d},${d} 1 0,1 ${l*.35},${l*.2} @@ -491,7 +491,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error a${h},${h} 1 0,1 ${-1*l*.1},${-1*u*.35} a${p},${p} 1 0,1 ${l*.1},${-1*u*.65} - H0 V0 Z`;if(e.look==="handDrawn"){const v=Gt.svg(i),T=Wt(e,{}),b=v.path(y,T);m=i.insert(()=>b,":first-child"),m.attr("class","basic label-container").attr("style",Ca(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),Kt(e,m),e.calcIntersect=function(v,T){return Bt.rect(v,T)},e.intersect=function(v){return le.info("Cloud intersect",e,v),Bt.rect(e,v)},i}x(Npe,"cloud");async function Dpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,fr(e)),l=a.width+8*s,u=a.height+2*s,h=5,d=e.look==="neo"?` + H0 V0 Z`;if(e.look==="handDrawn"){const v=Gt.svg(i),T=Wt(e,{}),b=v.path(y,T);m=i.insert(()=>b,":first-child"),m.attr("class","basic label-container").attr("style",ka(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),Kt(e,m),e.calcIntersect=function(v,T){return Bt.rect(v,T)},e.intersect=function(v){return le.info("Cloud intersect",e,v),Bt.rect(e,v)},i}x(Dpe,"cloud");async function Ope(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,fr(e)),l=a.width+8*s,u=a.height+2*s,h=5,d=e.look==="neo"?` M${-l/2} ${u/2-h} v${-u+2*h} q0,-${h} ${h},-${h} @@ -511,31 +511,33 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error h${-(l-2*h)} q${-h},0 ${-h},${-h} Z - `;if(!e.domId)throw new Error(`defaultMindmapNode: node "${e.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=i.append("path").attr("id",e.domId).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>o.node()),Kt(e,f),e.calcIntersect=function(p,g){return Bt.rect(p,g)},e.intersect=function(p){return Bt.rect(e,p)},i}x(Dpe,"defaultMindmapNode");async function Ope(t,e){const r={padding:e.padding??0};return AV(t,e,r)}x(Ope,"mindmapCircle");var Qje=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:dpe},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:cpe},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:fpe},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:ype},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Ofe},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:$fe},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:AV},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Ipe},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Npe},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:spe},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Wfe},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Jfe},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Qfe},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:wpe},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Kfe},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Bfe},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:xpe},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Afe},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:upe},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:mpe},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:gpe},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Vfe},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Hfe},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Mfe},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Ife},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Nfe},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:epe},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Spe},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Gfe},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Tpe},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:tpe},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Dfe},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Pfe},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:kpe},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Ape},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Ffe},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Cpe},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:zfe},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:hpe},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:ipe},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:npe},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Efe},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Lfe},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:bpe},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:vpe},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Epe},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:ope},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:rpe}],Jje=x(()=>{const e=[...Object.entries({state:ppe,choice:_fe,note:ape,rectWithTitle:lpe,labelRect:Zfe,iconSquare:Xfe,iconCircle:Ufe,icon:qfe,iconRounded:Yfe,imageSquare:jfe,anchor:kfe,kanbanItem:Mpe,mindmapCircle:Ope,defaultMindmapNode:Dpe,classBox:Rpe,erBox:_V,requirementBox:Lpe}),...Qje.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),$pe=Jje();function Ppe(t){return t in $pe}x(Ppe,"isValidShape");var TR=new Map;async function rS(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?$pe[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;r.config.securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return n.attr("data-look",Ca(e.look)),e.tooltip&&i.attr("title",e.tooltip),TR.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}x(rS,"insertNode");var eKe=x((t,e)=>{TR.set(e.id,t)},"setNodeElem"),Bpe=x(()=>{TR.clear()},"clear"),FA=x(t=>{const e=TR.get(t.id);le.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),Pc=x((t,e)=>{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,n=t.y??0;return"translate("+-(r+t.width/2)+", "+-(n+t.height/2)+")"},"computeLabelTransform"),ma={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},QK={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function XT(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=si(t),e=si(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}x(XT,"calculateDeltaAndAngle");var si=x(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),Fpe=x(t=>({x:x(function(e,r,n){let i=0;const a=si(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(ma,t.arrowTypeEnd)){const{angle:p,deltaX:g}=XT(n[n.length-1],n[n.length-2]);i=ma[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(si(e).x-si(n[n.length-1]).x),o=Math.abs(si(e).y-si(n[n.length-1]).y),l=Math.abs(si(e).x-si(n[0]).x),u=Math.abs(si(e).y-si(n[0]).y),h=ma[t.arrowTypeStart],d=ma[t.arrowTypeEnd],f=1;if(s0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(ma,t.arrowTypeEnd)){const{angle:p,deltaY:g}=XT(n[n.length-1],n[n.length-2]);i=ma[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(si(e).y-si(n[n.length-1]).y),o=Math.abs(si(e).x-si(n[n.length-1]).x),l=Math.abs(si(e).y-si(n[0]).y),u=Math.abs(si(e).x-si(n[0]).x),h=ma[t.arrowTypeStart],d=ma[t.arrowTypeEnd],f=1;if(s0&&o0&&u{e.arrowTypeStart&&JK(t,"start",e.arrowTypeStart,r,n,i,a,s),e.arrowTypeEnd&&JK(t,"end",e.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),rKe={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},nKe=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],JK=x((t,e,r,n,i,a,s=!1,o)=>{var g;const l=rKe[r],u=l&&nKe.includes(l.type);if(!l){le.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${a}-${h}${e==="start"?"Start":"End"}${s&&u?"-margin":""}`;if(o&&o.trim()!==""){const m=o.replace(/[^\dA-Za-z]/g,"_"),y=`${p}_${m}`;if(!document.getElementById(y)){const v=document.getElementById(p);if(v){const T=v.cloneNode(!0);T.id=y,T.querySelectorAll("path, circle, line").forEach(w=>{w.setAttribute("stroke",o),l.fill&&w.setAttribute("fill",o)}),(g=v.parentNode)==null||g.appendChild(T)}}t.attr(`marker-${e}`,`url(${n}#${y})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),iKe=x(t=>{var e,r;return typeof t=="string"?t:(r=(e=Fe())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),zC=new Map,Li=new Map,zpe=x(()=>{zC.clear(),Li.clear()},"clear"),uT=x(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),zA=x(async(t,e)=>{const r=Fe();let n=xn(r);const{labelStyles:i}=zt(e);e.labelStyle=i;const a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",e.id),o=e.labelType==="markdown",u=await ws(t,e.label,{style:uT(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);s.node().appendChild(u),le.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=ut(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=ut(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}s.attr("transform",Pc(d,n)),zC.set(e.id,a),e.width=h.width,e.height=h.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rd(g,e.startLabelLeft,uT(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ut(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Pc(y,n)),Li.get(e.id)||Li.set(e.id,{}),Li.get(e.id).startLeft=p,jT(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rd(g,e.startLabelRight,uT(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ut(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Pc(y,n)),Li.get(e.id)||Li.set(e.id,{}),Li.get(e.id).startRight=p,jT(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rd(p,e.endLabelLeft,uT(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ut(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Pc(y,n)),Li.get(e.id)||Li.set(e.id,{}),Li.get(e.id).endLeft=p,jT(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rd(p,e.endLabelRight,uT(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ut(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Pc(y,n)),Li.get(e.id)||Li.set(e.id,{}),Li.get(e.id).endRight=p,jT(f,e.endLabelRight)}return u},"insertEdgeLabel");function jT(t,e){xn(Fe())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(jT,"setTerminalWidth");var Vpe=x((t,e)=>{le.debug("Moving label abc88 ",t.id,t.label,zC.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Fe(),{subGraphTitleTotalMargin:i}=vx(n);if(t.label){const a=zC.get(t.id);let s=t.x,o=t.y;if(r){const l=yr.calcLabelPosition(r);le.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=Li.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=Li.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=Li.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=Li.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),aKe=x((t,e)=>{var s;if(!(t!=null&&t.isLabelEdge)||!((s=t==null?void 0:t.id)!=null&&s.endsWith("-to-label"))||!Array.isArray(e)||e.length!==2)return e;const[r,n]=e,i=Math.abs(n.x-r.x),a=Math.abs(n.y-r.y);return i<.001||a<.001?e:a>=i?[r,{x:r.x,y:n.y},n]:[r,{x:n.x,y:r.y},n]},"orthogonalizeToLabelClippedPoints"),sKe=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),oKe=x((t,e,r)=>{le.debug(`intersection calc abc89: + `;if(!e.domId)throw new Error(`defaultMindmapNode: node "${e.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=i.append("path").attr("id",e.domId).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>o.node()),Kt(e,f),e.calcIntersect=function(p,g){return Bt.rect(p,g)},e.intersect=function(p){return Bt.rect(e,p)},i}x(Ope,"defaultMindmapNode");async function $pe(t,e){const r={padding:e.padding??0};return AV(t,e,r)}x($pe,"mindmapCircle");var Jje=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:fpe},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:upe},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:ppe},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:vpe},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:$fe},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Pfe},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:AV},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Npe},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Dpe},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:ope},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Hfe},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:epe},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Jfe},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Cpe},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Zfe},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Ffe},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Tpe},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:_fe},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:hpe},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:ype},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:mpe},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Gfe},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:qfe},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Ife},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Nfe},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Dfe},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:tpe},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Epe},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Wfe},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:wpe},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:rpe},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Ofe},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Bfe},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Spe},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:_pe},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:zfe},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:kpe},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Vfe},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:dpe},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:ape},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:ipe},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Afe},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Mfe},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:xpe},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:bpe},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Ape},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:lpe},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:npe}],eKe=x(()=>{const e=[...Object.entries({state:gpe,choice:Rfe,note:spe,rectWithTitle:cpe,labelRect:Qfe,iconSquare:jfe,iconCircle:Yfe,icon:Ufe,iconRounded:Xfe,imageSquare:Kfe,anchor:Sfe,kanbanItem:Ipe,mindmapCircle:$pe,defaultMindmapNode:Ope,classBox:Lpe,erBox:_V,requirementBox:Mpe}),...Jje.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),Ppe=eKe();function Bpe(t){return t in Ppe}x(Bpe,"isValidShape");var TR=new Map;async function rS(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?Ppe[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;r.config.securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return n.attr("data-look",ka(e.look)),e.tooltip&&i.attr("title",e.tooltip),TR.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}x(rS,"insertNode");var tKe=x((t,e)=>{TR.set(e.id,t)},"setNodeElem"),Fpe=x(()=>{TR.clear()},"clear"),FA=x(t=>{const e=TR.get(t.id);le.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),Pc=x((t,e)=>{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,n=t.y??0;return"translate("+-(r+t.width/2)+", "+-(n+t.height/2)+")"},"computeLabelTransform"),ya={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},QK={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function XT(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=si(t),e=si(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}x(XT,"calculateDeltaAndAngle");var si=x(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),zpe=x(t=>({x:x(function(e,r,n){let i=0;const a=si(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(ya,t.arrowTypeEnd)){const{angle:p,deltaX:g}=XT(n[n.length-1],n[n.length-2]);i=ya[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(si(e).x-si(n[n.length-1]).x),o=Math.abs(si(e).y-si(n[n.length-1]).y),l=Math.abs(si(e).x-si(n[0]).x),u=Math.abs(si(e).y-si(n[0]).y),h=ya[t.arrowTypeStart],d=ya[t.arrowTypeEnd],f=1;if(s0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(ya,t.arrowTypeEnd)){const{angle:p,deltaY:g}=XT(n[n.length-1],n[n.length-2]);i=ya[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(si(e).y-si(n[n.length-1]).y),o=Math.abs(si(e).x-si(n[n.length-1]).x),l=Math.abs(si(e).y-si(n[0]).y),u=Math.abs(si(e).x-si(n[0]).x),h=ya[t.arrowTypeStart],d=ya[t.arrowTypeEnd],f=1;if(s0&&o0&&u{e.arrowTypeStart&&JK(t,"start",e.arrowTypeStart,r,n,i,a,s),e.arrowTypeEnd&&JK(t,"end",e.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),nKe={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},iKe=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],JK=x((t,e,r,n,i,a,s=!1,o)=>{var g;const l=nKe[r],u=l&&iKe.includes(l.type);if(!l){le.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${a}-${h}${e==="start"?"Start":"End"}${s&&u?"-margin":""}`;if(o&&o.trim()!==""){const m=o.replace(/[^\dA-Za-z]/g,"_"),y=`${p}_${m}`;if(!document.getElementById(y)){const v=document.getElementById(p);if(v){const T=v.cloneNode(!0);T.id=y,T.querySelectorAll("path, circle, line").forEach(w=>{w.setAttribute("stroke",o),l.fill&&w.setAttribute("fill",o)}),(g=v.parentNode)==null||g.appendChild(T)}}t.attr(`marker-${e}`,`url(${n}#${y})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),aKe=x(t=>{var e,r;return typeof t=="string"?t:(r=(e=Fe())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),zC=new Map,Li=new Map,Vpe=x(()=>{zC.clear(),Li.clear()},"clear"),uT=x(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),zA=x(async(t,e)=>{const r=Fe();let n=xn(r);const{labelStyles:i}=zt(e);e.labelStyle=i;const a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",e.id),o=e.labelType==="markdown",u=await ws(t,e.label,{style:uT(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);s.node().appendChild(u),le.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=ut(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=ut(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}s.attr("transform",Pc(d,n)),zC.set(e.id,a),e.width=h.width,e.height=h.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rd(g,e.startLabelLeft,uT(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ut(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Pc(y,n)),Li.get(e.id)||Li.set(e.id,{}),Li.get(e.id).startLeft=p,jT(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rd(g,e.startLabelRight,uT(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ut(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Pc(y,n)),Li.get(e.id)||Li.set(e.id,{}),Li.get(e.id).startRight=p,jT(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rd(p,e.endLabelLeft,uT(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ut(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Pc(y,n)),Li.get(e.id)||Li.set(e.id,{}),Li.get(e.id).endLeft=p,jT(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rd(p,e.endLabelRight,uT(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ut(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Pc(y,n)),Li.get(e.id)||Li.set(e.id,{}),Li.get(e.id).endRight=p,jT(f,e.endLabelRight)}return u},"insertEdgeLabel");function jT(t,e){xn(Fe())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(jT,"setTerminalWidth");var Gpe=x((t,e)=>{le.debug("Moving label abc88 ",t.id,t.label,zC.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Fe(),{subGraphTitleTotalMargin:i}=vx(n);if(t.label){const a=zC.get(t.id);let s=t.x,o=t.y;if(r){const l=yr.calcLabelPosition(r);le.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=Li.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=Li.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=Li.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=Li.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),sKe=x((t,e)=>{var s;if(!(t!=null&&t.isLabelEdge)||!((s=t==null?void 0:t.id)!=null&&s.endsWith("-to-label"))||!Array.isArray(e)||e.length!==2)return e;const[r,n]=e,i=Math.abs(n.x-r.x),a=Math.abs(n.y-r.y);return i<.001||a<.001?e:a>=i?[r,{x:r.x,y:n.y},n]:[r,{x:n.x,y:r.y},n]},"orthogonalizeToLabelClippedPoints"),oKe=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),lKe=x((t,e,r)=>{le.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(e)} insidePoint : ${JSON.stringify(r)} - node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{le.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(le.info("abc88 checking point",a,e),!sKe(e,a)&&!i){const s=oKe(e,n,a);le.debug("abc88 inside",a,n,s),le.debug("abc88 intersection",s,e);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?le.warn("abc88 no intersect",s,r):r.push(s),i=!0}else le.warn("abc88 outside",a,n),n=a,i||r.push(a)}),le.debug("returning points",r),r},"cutPathAtIntersect");function Gpe(t){const e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}x(Gpe,"extractCornerPoints");var tZ=x(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),lKe=x(function(t){const{cornerPointPositions:e}=Gpe(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){le.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;s.x===o.x?f={x:u<0?o.x-p+d:o.x+p-d,y:h<0?o.y-d:o.y+d}:f={x:u<0?o.x-d:o.x+d,y:h<0?o.y-p+d:o.y+p-d}}else le.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),cKe=x((t,e,r)=>{const n=t-e-r,i=2,a=2,s=i+a,o=Math.floor(n/s),l=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),RV=x(function(t,e,r,n,i,a,s,o=!1){var N;if(!s)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:u}=Fe();let h=e.points,d=!1;const f=i;var p=a;const g=[];for(const F in e.cssCompiledStyles)tV(F)||g.push(e.cssCompiledStyles[F]);if(u==="swimlane"){if(p.intersect&&f.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[f.intersect(h[0]),p.intersect(h[1])];else{const F=h.slice(1,-1),z=F[0],V=F[F.length-1],B=.5,G=Math.abs(h[h.length-1].x-V.x)!Number.isNaN(F.y));const v=iKe(e.curve);v!=="rounded"&&(y=lKe(y));let T=Pw;switch(v){case"linear":T=Pw;break;case"basis":T=DC;break;case"cardinal":T=lue;break;case"bumpX":T=nue;break;case"bumpY":T=iue;break;case"catmullRom":T=uue;break;case"monotoneX":T=mue;break;case"monotoneY":T=yue;break;case"natural":T=bue;break;case"step":T=xue;break;case"stepAfter":T=wue;break;case"stepBefore":T=Tue;break;case"rounded":T=Pw;break;default:T=DC}const{x:b,y:w}=Fpe(e),C=NC().x(b).y(w).curve(T);let S;switch(e.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(e.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let k,E=v==="rounded"?Wpe(Hpe(y,e),5):C(y);const _=Array.isArray(e.style)?e.style:[e.style];let M=_.find(F=>F==null?void 0:F.startsWith("stroke:")),L="";e.animate&&(L="edge-animation-fast"),e.animation&&(L="edge-animation-"+e.animation);let P=!1;if(e.look==="handDrawn"){const F=Gt.svg(t);Object.assign([],y);const z=F.path(E,{roughness:.3,seed:l});S+=" transition",k=ut(z).select("path").attr("id",`${s}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(L?" "+L:"")).attr("style",_?_.reduce((B,G)=>B+";"+G,""):"");let V=k.attr("d");k.attr("d",V),t.node().appendChild(k.node())}else{const F=g.join(";"),z=_?_.reduce((Z,Y)=>Z+Y+";",""):"",V=(F?F+";"+z+";":z)+";"+(_?_.reduce((Z,Y)=>Z+";"+Y,""):"");k=t.append("path").attr("d",E).attr("id",`${s}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(L?" "+L:"")).attr("style",V),M=(N=V.match(/stroke:([^;]+)/))==null?void 0:N[1],P=e.animate===!0||!!e.animation||F.includes("animation");const B=k.node(),G=typeof B.getTotalLength=="function"?B.getTotalLength():0,H=QK[e.arrowTypeStart]||0,q=QK[e.arrowTypeEnd]||0;if(e.look==="neo"&&!P){const Y=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?cKe(G,H,q):`0 ${H} ${G-H-q} ${q}`}; stroke-dashoffset: 0;`;k.attr("style",Y+k.attr("style"))}}k.attr("data-edge",!0),k.attr("data-et","edge"),k.attr("data-id",e.id),k.attr("data-points",m),k.attr("data-look",Ca(e.look)),e.showPoints&&y.forEach(F=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",F.x).attr("cy",F.y)});let D="";(Fe().flowchart.arrowMarkerAbsolute||Fe().state.arrowMarkerAbsolute)&&(D=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,D=D.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),le.info("arrowTypeStart",e.arrowTypeStart),le.info("arrowTypeEnd",e.arrowTypeEnd);const R=!P&&(e==null?void 0:e.look)==="neo";tKe(k,e,D,s,n,R,M);const I=Math.floor(h.length/2),$=h[I];yr.isLabelCoordinateInPath($,k.attr("d"))||(d=!0);let O={};return d&&(O.updatedPath=h),O.originalPath=e.points,O},"insertEdge");function Wpe(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let a=0;a({...i}));if(t.length>=2&&ma[e.arrowTypeStart]){const i=ma[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=VO(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=a.x+l,r[0].y=a.y+u}const n=t.length;if(n>=2&&ma[e.arrowTypeEnd]){const i=ma[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=VO(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}x(Hpe,"applyMarkerOffsetsToPoints");var uKe=x((t,e,r,n)=>{e.forEach(i=>{NKe[i](t,r,n)})},"insertMarkers"),hKe=x((t,e,r)=>{le.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),t.append("marker").attr("id",r+"_"+e+"-extensionStart-margin").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd-margin").attr("class","marker extension "+e).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),dKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart-margin").attr("class","marker composition "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd-margin").attr("class","marker composition "+e).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),fKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart-margin").attr("class","marker aggregation "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd-margin").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),pKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart-margin").attr("class","marker dependency "+e).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd-margin").attr("class","marker dependency "+e).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),gKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart-margin").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd-margin").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),mKe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),yKe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),vKe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossEnd-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),t.append("marker").attr("id",r+"_"+e+"-crossStart-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),bKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),xKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{transitionColor:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),TKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),wKe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),CKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),kKe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),SKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),EKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");o.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),AKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),_Ke=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");o.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),RKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 + node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{le.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(le.info("abc88 checking point",a,e),!oKe(e,a)&&!i){const s=lKe(e,n,a);le.debug("abc88 inside",a,n,s),le.debug("abc88 intersection",s,e);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?le.warn("abc88 no intersect",s,r):r.push(s),i=!0}else le.warn("abc88 outside",a,n),n=a,i||r.push(a)}),le.debug("returning points",r),r},"cutPathAtIntersect");function Wpe(t){const e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}x(Wpe,"extractCornerPoints");var tZ=x(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),cKe=x(function(t){const{cornerPointPositions:e}=Wpe(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){le.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;s.x===o.x?f={x:u<0?o.x-p+d:o.x+p-d,y:h<0?o.y-d:o.y+d}:f={x:u<0?o.x-d:o.x+d,y:h<0?o.y-p+d:o.y+p-d}}else le.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),uKe=x((t,e,r)=>{const n=t-e-r,i=2,a=2,s=i+a,o=Math.floor(n/s),l=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),RV=x(function(t,e,r,n,i,a,s,o=!1){var N;if(!s)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:u}=Fe();let h=e.points,d=!1;const f=i;var p=a;const g=[];for(const F in e.cssCompiledStyles)tV(F)||g.push(e.cssCompiledStyles[F]);if(u==="swimlane"){if(p.intersect&&f.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[f.intersect(h[0]),p.intersect(h[1])];else{const F=h.slice(1,-1),z=F[0],V=F[F.length-1],B=.5,G=Math.abs(h[h.length-1].x-V.x)!Number.isNaN(F.y));const v=aKe(e.curve);v!=="rounded"&&(y=cKe(y));let T=Pw;switch(v){case"linear":T=Pw;break;case"basis":T=DC;break;case"cardinal":T=cue;break;case"bumpX":T=iue;break;case"bumpY":T=aue;break;case"catmullRom":T=hue;break;case"monotoneX":T=yue;break;case"monotoneY":T=vue;break;case"natural":T=xue;break;case"step":T=Tue;break;case"stepAfter":T=Cue;break;case"stepBefore":T=wue;break;case"rounded":T=Pw;break;default:T=DC}const{x:b,y:w}=zpe(e),C=NC().x(b).y(w).curve(T);let S;switch(e.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(e.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let k,E=v==="rounded"?Hpe(qpe(y,e),5):C(y);const _=Array.isArray(e.style)?e.style:[e.style];let M=_.find(F=>F==null?void 0:F.startsWith("stroke:")),L="";e.animate&&(L="edge-animation-fast"),e.animation&&(L="edge-animation-"+e.animation);let P=!1;if(e.look==="handDrawn"){const F=Gt.svg(t);Object.assign([],y);const z=F.path(E,{roughness:.3,seed:l});S+=" transition",k=ut(z).select("path").attr("id",`${s}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(L?" "+L:"")).attr("style",_?_.reduce((B,G)=>B+";"+G,""):"");let V=k.attr("d");k.attr("d",V),t.node().appendChild(k.node())}else{const F=g.join(";"),z=_?_.reduce((Z,Y)=>Z+Y+";",""):"",V=(F?F+";"+z+";":z)+";"+(_?_.reduce((Z,Y)=>Z+";"+Y,""):"");k=t.append("path").attr("d",E).attr("id",`${s}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(L?" "+L:"")).attr("style",V),M=(N=V.match(/stroke:([^;]+)/))==null?void 0:N[1],P=e.animate===!0||!!e.animation||F.includes("animation");const B=k.node(),G=typeof B.getTotalLength=="function"?B.getTotalLength():0,H=QK[e.arrowTypeStart]||0,q=QK[e.arrowTypeEnd]||0;if(e.look==="neo"&&!P){const Y=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?uKe(G,H,q):`0 ${H} ${G-H-q} ${q}`}; stroke-dashoffset: 0;`;k.attr("style",Y+k.attr("style"))}}k.attr("data-edge",!0),k.attr("data-et","edge"),k.attr("data-id",e.id),k.attr("data-points",m),k.attr("data-look",ka(e.look)),e.showPoints&&y.forEach(F=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",F.x).attr("cy",F.y)});let D="";(Fe().flowchart.arrowMarkerAbsolute||Fe().state.arrowMarkerAbsolute)&&(D=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,D=D.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),le.info("arrowTypeStart",e.arrowTypeStart),le.info("arrowTypeEnd",e.arrowTypeEnd);const R=!P&&(e==null?void 0:e.look)==="neo";rKe(k,e,D,s,n,R,M);const I=Math.floor(h.length/2),$=h[I];yr.isLabelCoordinateInPath($,k.attr("d"))||(d=!0);let O={};return d&&(O.updatedPath=h),O.originalPath=e.points,O},"insertEdge");function Hpe(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let a=0;a({...i}));if(t.length>=2&&ya[e.arrowTypeStart]){const i=ya[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=VO(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=a.x+l,r[0].y=a.y+u}const n=t.length;if(n>=2&&ya[e.arrowTypeEnd]){const i=ya[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=VO(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}x(qpe,"applyMarkerOffsetsToPoints");var hKe=x((t,e,r,n)=>{e.forEach(i=>{DKe[i](t,r,n)})},"insertMarkers"),dKe=x((t,e,r)=>{le.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),t.append("marker").attr("id",r+"_"+e+"-extensionStart-margin").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd-margin").attr("class","marker extension "+e).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),fKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart-margin").attr("class","marker composition "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd-margin").attr("class","marker composition "+e).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),pKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart-margin").attr("class","marker aggregation "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd-margin").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),gKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart-margin").attr("class","marker dependency "+e).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd-margin").attr("class","marker dependency "+e).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),mKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart-margin").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd-margin").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),yKe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),vKe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),bKe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossEnd-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),t.append("marker").attr("id",r+"_"+e+"-crossStart-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),xKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),TKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{transitionColor:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),wKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),CKe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),kKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),SKe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),EKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),AKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");o.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),_Ke=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),RKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");o.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),LKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 L20,10 M20,10 - L0,20`)},"requirement_arrow"),LKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 + L0,20`)},"requirement_arrow"),MKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 L20,10 M20,10 - L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),MKe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),IKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a}=i,s=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),NKe={extension:hKe,composition:dKe,aggregation:fKe,dependency:pKe,lollipop:gKe,point:mKe,circle:yKe,cross:vKe,barb:bKe,barbNeo:xKe,only_one:TKe,zero_or_one:wKe,one_or_more:CKe,zero_or_more:kKe,only_one_neo:SKe,zero_or_one_neo:EKe,one_or_more_neo:AKe,zero_or_more_neo:_Ke,requirement_arrow:RKe,requirement_contains:MKe,requirement_arrow_neo:LKe,requirement_contains_neo:IKe},LV=uKe,DKe={common:At,getConfig:Xt,insertCluster:xR,insertEdge:RV,insertEdgeLabel:zA,insertMarkers:LV,insertNode:rS,interpolateToCurve:lV,labelHelper:xr,log:le,positionEdgeLabel:Vpe},VC={},qpe=x(t=>{for(const e of t)VC[e.name]=e},"registerLayoutLoaders"),OKe=x(()=>{qpe([{name:"dagre",loader:x(async()=>await tr(()=>Promise.resolve().then(()=>sut),void 0,import.meta.url),"loader")},{name:"swimlane",loader:x(async()=>await tr(()=>Promise.resolve().then(()=>vut),void 0,import.meta.url),"loader")},{name:"cose-bilkent",loader:x(async()=>await tr(()=>Promise.resolve().then(()=>lmt),void 0,import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");OKe();var xx=x(async(t,e,r)=>{if(!(t.layoutAlgorithm in VC))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const d of t.nodes){const f=d.domId||d.id;d.domId=`${t.diagramId}-${f}`}const n=VC[t.layoutAlgorithm],i=await n.loader(),{theme:a,themeVariables:s}=t.config,{useGradient:o,gradientStart:l,gradientStop:u}=s,h=e.attr("id");if(e.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),o){const d=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return i.render(t,e,DKe,{algorithm:n.algorithm},r)},"render"),nS=x((t="",{fallback:e="dagre"}={})=>{if(t in VC)return t;if(e in VC)return le.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),MV="comm",Upe="rule",Ype="decl",$Ke="@media",PKe="@import",BKe="@supports",FKe="@namespace",GO="@keyframes",Xpe="@layer",zKe="@scope",VKe=Math.abs,Vw=String.fromCharCode;function jpe(t){return t.trim()}function WO(t,e,r){return t.replace(e,r)}function fy(t,e){return t.charCodeAt(e)|0}function Mb(t,e,r){return t.slice(e,r)}function Lc(t){return t.length}function Kpe(t){return t.length}function LE(t,e){return e.push(t),t}var wR=1,Ib=1,Zpe=0,bl=0,Gi=0,Tx="";function IV(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:wR,column:Ib,length:s,return:"",siblings:o}}function GKe(){return Gi}function WKe(){return Gi=bl>0?fy(Tx,--bl):0,Ib--,Gi===10&&(Ib=1,wR--),Gi}function Zl(){return Gi=bl2||GC(Gi)>3?"":" "}function YKe(t,e){for(;--e&&Zl()&&!(Gi<48||Gi>102||Gi>57&&Gi<65||Gi>70&&Gi<97););return CR(t,J4()+(e<6&&Ld()==32&&Zl()==32))}function HO(t){for(;Zl();)switch(Gi){case t:return bl;case 34:case 39:t!==34&&t!==39&&HO(Gi);break;case 40:t===41&&HO(t);break;case 92:Zl();break}return bl}function XKe(t,e){for(;Zl()&&t+Gi!==57;)if(t+Gi===84&&Ld()===47)break;return"/*"+CR(e,bl-1)+"*"+Vw(t===47?t:Zl())}function jKe(t){for(;!GC(Ld());)Zl();return CR(t,bl)}function KKe(t){return qKe(e3("",null,null,null,[""],t=HKe(t),0,[0],t))}function e3(t,e,r,n,i,a,s,o,l){for(var u=0,h=0,d=s,f=0,p=0,g=0,m=1,y=1,v=1,T=0,b=0,w="",C=i,S=a,k=n,E=w;y;)switch(g=b,b=Zl()){case 40:g!=108&&fy(E,d-1)==58?(T++,E+="("):E+=eI(b);break;case 41:T--,E+=")";break;case 34:case 39:case 91:E+=eI(b);break;case 9:case 10:case 13:case 32:if(T>0){E+=Vw(b);break}E+=UKe(g);break;case 92:E+=YKe(J4()-1,7);continue;case 47:switch(Ld()){case 42:case 47:LE(ZKe(XKe(Zl(),J4()),e,r,l),l),(GC(g||1)==5||GC(Ld()||1)==5)&&Lc(E)&&Mb(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*m:o[u++]=Lc(E)*v;case 125*m:case 59:case 0:if(T>0&&b){E+=Vw(b);break}switch(b){case 0:case 125:y=0;case 59+h:v==-1&&(E=WO(E,/\f/g,"")),p>0&&(Lc(E)-d||m===0)&&LE(p>32?nZ(E+";",n,r,d-1,l):nZ(WO(E," ","")+";",n,r,d-2,l),l);break;case 59:E+=";";default:if(LE(k=rZ(E,e,r,u,h,i,o,w,C=[],S=[],d,a),a),b===123)if(h===0)e3(E,e,k,k,C,a,d,o,S);else{switch(f){case 99:if(fy(E,3)===110)break;case 108:if(fy(E,2)===97)break;default:h=0;case 100:case 109:case 115:}h?e3(t,k,k,n&&LE(rZ(t,k,k,0,0,i,o,w,i,C=[],d,S),S),i,S,d,o,n?C:S):e3(E,k,k,k,[""],S,0,o,S)}}u=h=p=0,m=v=1,w=E="",d=s;break;case 58:d=1+Lc(E),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&WKe()==125)continue}switch(E+=Vw(b),b*m){case 38:v=h>0?1:(E+="\f",-1);break;case 44:if(T>0)break;o[u++]=(Lc(E)-1)*v,v=1;break;case 64:Ld()===45&&(E+=eI(Zl())),f=Ld(),h=d=Lc(w=E+=jKe(J4())),b++;break;case 45:g===45&&Lc(E)==2&&(m=0)}}return a}function rZ(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=Kpe(p),m=0,y=0,v=0;m0?p[T]+" "+b:WO(b,/&\f/g,p[T])))&&(l[v++]=w);return IV(t,e,r,i===0?Upe:o,l,u,h,d)}function ZKe(t,e,r,n){return IV(t,e,r,MV,Vw(GKe()),Mb(t,2,-2),0,n)}function nZ(t,e,r,n,i){return IV(t,e,r,Ype,Mb(t,0,n),Mb(t,n+1,-1),n,i)}function qO(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),tZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>nyt);return{diagram:e}},void 0,import.meta.url);return{id:Qpe,diagram:t}},"loader"),rZe={id:Qpe,detector:eZe,loader:tZe},nZe=rZe,Jpe="flowchart",iZe=x((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),aZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bW);return{diagram:e}},void 0,import.meta.url);return{id:Jpe,diagram:t}},"loader"),sZe={id:Jpe,detector:iZe,loader:aZe},oZe=sZe,e0e="flowchart-v2",lZe=x((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),cZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bW);return{diagram:e}},void 0,import.meta.url);return{id:e0e,diagram:t}},"loader"),uZe={id:e0e,detector:lZe,loader:cZe},hZe=uZe,t0e="swimlane",dZe=x(t=>/^\s*swimlane-beta\b/.test(t),"detector"),fZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>vyt);return{diagram:e}},void 0,import.meta.url);return{id:t0e,diagram:t}},"loader"),pZe={id:t0e,detector:dZe,loader:fZe},gZe=pZe,r0e="er",mZe=x(t=>/^\s*erDiagram/.test(t),"detector"),yZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Eyt);return{diagram:e}},void 0,import.meta.url);return{id:r0e,diagram:t}},"loader"),vZe={id:r0e,detector:mZe,loader:yZe},bZe=vZe,n0e="gitGraph",xZe=x(t=>/^\s*gitGraph/.test(t),"detector"),TZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>RAt);return{diagram:e}},void 0,import.meta.url);return{id:n0e,diagram:t}},"loader"),wZe={id:n0e,detector:xZe,loader:TZe},CZe=wZe,i0e="gantt",kZe=x(t=>/^\s*gantt/.test(t),"detector"),SZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>P_t);return{diagram:e}},void 0,import.meta.url);return{id:i0e,diagram:t}},"loader"),EZe={id:i0e,detector:kZe,loader:SZe},AZe=EZe,a0e="info",_Ze=x(t=>/^\s*info/.test(t),"detector"),RZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>q_t);return{diagram:e}},void 0,import.meta.url);return{id:a0e,diagram:t}},"loader"),LZe={id:a0e,detector:_Ze,loader:RZe},s0e="pie",MZe=x(t=>/^\s*pie/.test(t),"detector"),IZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>l6t);return{diagram:e}},void 0,import.meta.url);return{id:s0e,diagram:t}},"loader"),NZe={id:s0e,detector:MZe,loader:IZe},o0e="quadrantChart",DZe=x(t=>/^\s*quadrantChart/.test(t),"detector"),OZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>m6t);return{diagram:e}},void 0,import.meta.url);return{id:o0e,diagram:t}},"loader"),$Ze={id:o0e,detector:DZe,loader:OZe},PZe=$Ze,l0e="xychart",BZe=x(t=>/^\s*xychart(-beta)?/.test(t),"detector"),FZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>M6t);return{diagram:e}},void 0,import.meta.url);return{id:l0e,diagram:t}},"loader"),zZe={id:l0e,detector:BZe,loader:FZe},VZe=zZe,c0e="requirement",GZe=x(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),WZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>F6t);return{diagram:e}},void 0,import.meta.url);return{id:c0e,diagram:t}},"loader"),HZe={id:c0e,detector:GZe,loader:WZe},qZe=HZe,u0e="sequence",UZe=x(t=>/^\s*sequenceDiagram/.test(t),"detector"),YZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>DRt);return{diagram:e}},void 0,import.meta.url);return{id:u0e,diagram:t}},"loader"),XZe={id:u0e,detector:UZe,loader:YZe},jZe=XZe,h0e="class",KZe=x((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),ZZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>zRt);return{diagram:e}},void 0,import.meta.url);return{id:h0e,diagram:t}},"loader"),QZe={id:h0e,detector:KZe,loader:ZZe},JZe=QZe,d0e="classDiagram",eQe=x((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),tQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>GRt);return{diagram:e}},void 0,import.meta.url);return{id:d0e,diagram:t}},"loader"),rQe={id:d0e,detector:eQe,loader:tQe},nQe=rQe,f0e="state",iQe=x((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),aQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>MLt);return{diagram:e}},void 0,import.meta.url);return{id:f0e,diagram:t}},"loader"),sQe={id:f0e,detector:iQe,loader:aQe},oQe=sQe,p0e="stateDiagram",lQe=x((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),cQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>NLt);return{diagram:e}},void 0,import.meta.url);return{id:p0e,diagram:t}},"loader"),uQe={id:p0e,detector:lQe,loader:cQe},hQe=uQe,g0e="journey",dQe=x(t=>/^\s*journey/.test(t),"detector"),fQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>t7t);return{diagram:e}},void 0,import.meta.url);return{id:g0e,diagram:t}},"loader"),pQe={id:g0e,detector:dQe,loader:fQe},gQe=pQe,mQe=x((t,e,r)=>{le.debug(`rendering svg for syntax error -`);const n=xs(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),Ai(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),m0e={draw:mQe},yQe=m0e,vQe={db:{},renderer:m0e,parser:{parse:x(()=>{},"parse")}},bQe=vQe,y0e="flowchart-elk",xQe=x((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),TQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bW);return{diagram:e}},void 0,import.meta.url);return{id:y0e,diagram:t}},"loader"),wQe={id:y0e,detector:xQe,loader:TQe},CQe=wQe,v0e="timeline",kQe=x(t=>/^\s*timeline/.test(t),"detector"),SQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>L7t);return{diagram:e}},void 0,import.meta.url);return{id:v0e,diagram:t}},"loader"),EQe={id:v0e,detector:kQe,loader:SQe},AQe=EQe,b0e="mindmap",_Qe=x(t=>/^\s*mindmap/.test(t),"detector"),RQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>U7t);return{diagram:e}},void 0,import.meta.url);return{id:b0e,diagram:t}},"loader"),LQe={id:b0e,detector:_Qe,loader:RQe},MQe=LQe,x0e="kanban",IQe=x(t=>/^\s*kanban/.test(t),"detector"),NQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>dMt);return{diagram:e}},void 0,import.meta.url);return{id:x0e,diagram:t}},"loader"),DQe={id:x0e,detector:IQe,loader:NQe},OQe=DQe,T0e="sankey",$Qe=x(t=>/^\s*sankey(-beta)?/.test(t),"detector"),PQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ZMt);return{diagram:e}},void 0,import.meta.url);return{id:T0e,diagram:t}},"loader"),BQe={id:T0e,detector:$Qe,loader:PQe},FQe=BQe,w0e="packet",zQe=x(t=>/^\s*packet(-beta)?/.test(t),"detector"),VQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>lIt);return{diagram:e}},void 0,import.meta.url);return{id:w0e,diagram:t}},"loader"),GQe={id:w0e,detector:zQe,loader:VQe},C0e="radar",WQe=x(t=>/^\s*radar-beta/.test(t),"detector"),HQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>RIt);return{diagram:e}},void 0,import.meta.url);return{id:C0e,diagram:t}},"loader"),qQe={id:C0e,detector:WQe,loader:HQe},k0e="block",UQe=x(t=>/^\s*block(-beta)?/.test(t),"detector"),YQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>rNt);return{diagram:e}},void 0,import.meta.url);return{id:k0e,diagram:t}},"loader"),XQe={id:k0e,detector:UQe,loader:YQe},jQe=XQe,S0e="treeView",KQe=x(t=>/^\s*treeView-beta/.test(t),"detector"),ZQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ENt);return{diagram:e}},void 0,import.meta.url);return{id:S0e,diagram:t}},"loader"),QQe={id:S0e,detector:KQe,loader:ZQe},JQe=QQe,E0e="architecture",eJe=x(t=>/^\s*architecture/.test(t),"detector"),tJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>eDt);return{diagram:e}},void 0,import.meta.url);return{id:E0e,diagram:t}},"loader"),rJe={id:E0e,detector:eJe,loader:tJe},nJe=rJe,A0e="eventmodeling",iJe=x(t=>/^\s*eventmodeling/.test(t),"detector"),aJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>mDt);return{diagram:e}},void 0,import.meta.url);return{id:A0e,diagram:t}},"loader"),sJe={id:A0e,detector:iJe,loader:aJe},oJe=sJe,_0e="ishikawa",lJe=x(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),cJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>NDt);return{diagram:e}},void 0,import.meta.url);return{id:_0e,diagram:t}},"loader"),uJe={id:_0e,detector:lJe,loader:cJe},R0e="venn",hJe=x(t=>/^\s*venn-beta/.test(t),"detector"),dJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>vOt);return{diagram:e}},void 0,import.meta.url);return{id:R0e,diagram:t}},"loader"),fJe={id:R0e,detector:hJe,loader:dJe},pJe=fJe,L0e="treemap",gJe=x(t=>/^\s*treemap/.test(t),"detector"),mJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ROt);return{diagram:e}},void 0,import.meta.url);return{id:L0e,diagram:t}},"loader"),yJe={id:L0e,detector:gJe,loader:mJe},M0e="wardley",vJe=x(t=>/^\s*wardley-beta/i.test(t),"detector"),bJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>VOt);return{diagram:e}},void 0,import.meta.url);return{id:M0e,diagram:t}},"loader"),xJe={id:M0e,detector:vJe,loader:bJe},TJe=xJe,I0e="cynefin",wJe=x(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),CJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>i$t);return{diagram:e}},void 0,import.meta.url);return{id:I0e,diagram:t}},"loader"),kJe={id:I0e,detector:wJe,loader:CJe},N0e="railroad",SJe=x(t=>/^\s*railroad-beta/i.test(t),"detector"),EJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>R$t);return{diagram:e}},void 0,import.meta.url);return{id:N0e,diagram:t}},"loader"),AJe={id:N0e,detector:SJe,loader:EJe},D0e="railroadEbnf",_Je=x(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),RJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>B$t);return{diagram:e}},void 0,import.meta.url);return{id:D0e,diagram:t}},"loader"),LJe={id:D0e,detector:_Je,loader:RJe},O0e="railroadAbnf",MJe=x(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),IJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>X$t);return{diagram:e}},void 0,import.meta.url);return{id:O0e,diagram:t}},"loader"),NJe={id:O0e,detector:MJe,loader:IJe},$0e="railroadPeg",DJe=x(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),OJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>iPt);return{diagram:e}},void 0,import.meta.url);return{id:$0e,diagram:t}},"loader"),$Je={id:$0e,detector:DJe,loader:OJe},iZ=!1,kR=x(()=>{iZ||(iZ=!0,nA("error",bQe,t=>t.toLowerCase().trim()==="error"),nA("---",{db:{clear:x(()=>{},"clear")},styles:{},renderer:{draw:x(()=>{},"draw")},parser:{parse:x(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:x(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),qD(CQe,MQe,nJe),qD(nZe,OQe,nQe,JZe,bZe,AZe,LZe,NZe,qZe,jZe,gZe,hZe,oZe,AQe,CZe,hQe,oQe,gQe,PZe,FQe,GQe,VZe,jQe,oJe,JQe,qQe,uJe,yJe,AJe,LJe,NJe,$Je,pJe,TJe,kJe))},"addDiagrams"),PJe=x(async()=>{le.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(A0).map(async([r,{detector:n,loader:i}])=>{if(i)try{KD(r)}catch{try{const{diagram:a,id:s}=await i();nA(s,a,n)}catch(a){throw le.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete A0[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){le.error(`Failed to load ${e.length} external diagrams`);for(const r of e)le.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),BJe="graphics-document document";function P0e(t,e){t.attr("role",BJe),e!==""&&t.attr("aria-roledescription",e)}x(P0e,"setA11yDiagramInfo");function B0e(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}x(B0e,"addSVGa11yTitleDescription");var g0,UO=(g0=class{constructor(e,r,n,i,a){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=a}static async fromText(e,r={}){var u,h;const n=Xt(),i=kz(e,n);e=sXe(e)+` -`;try{KD(i)}catch{const d=kFe(i);if(!d)throw new Jle(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();nA(f,p)}const{db:a,parser:s,renderer:o,init:l}=KD(i);return s.parser&&(s.parser.yy=a),(u=a.clear)==null||u.call(a),l==null||l(n),r.title&&((h=a.setDiagramTitle)==null||h.call(a,r.title)),await s.parse(e),new g0(i,e,a,s,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},x(g0,"Diagram"),g0),aZ=[],FJe=x(()=>{aZ.forEach(t=>{t()}),aZ=[]},"attachFunctions"),zJe=x(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function F0e(t){const e=t.match(Qle);if(!e)return{text:t,metadata:{}};const r=e[1],n=r?e[2].split(` + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),IKe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),NKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a}=i,s=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),DKe={extension:dKe,composition:fKe,aggregation:pKe,dependency:gKe,lollipop:mKe,point:yKe,circle:vKe,cross:bKe,barb:xKe,barbNeo:TKe,only_one:wKe,zero_or_one:CKe,one_or_more:kKe,zero_or_more:SKe,only_one_neo:EKe,zero_or_one_neo:AKe,one_or_more_neo:_Ke,zero_or_more_neo:RKe,requirement_arrow:LKe,requirement_contains:IKe,requirement_arrow_neo:MKe,requirement_contains_neo:NKe},LV=hKe,OKe={common:At,getConfig:Xt,insertCluster:xR,insertEdge:RV,insertEdgeLabel:zA,insertMarkers:LV,insertNode:rS,interpolateToCurve:lV,labelHelper:xr,log:le,positionEdgeLabel:Gpe},VC={},Upe=x(t=>{for(const e of t)VC[e.name]=e},"registerLayoutLoaders"),$Ke=x(()=>{Upe([{name:"dagre",loader:x(async()=>await tr(()=>Promise.resolve().then(()=>cut),void 0,import.meta.url),"loader")},{name:"swimlane",loader:x(async()=>await tr(()=>Promise.resolve().then(()=>Tut),void 0,import.meta.url),"loader")},{name:"cose-bilkent",loader:x(async()=>await tr(()=>Promise.resolve().then(()=>hmt),void 0,import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");$Ke();var xx=x(async(t,e,r)=>{if(!(t.layoutAlgorithm in VC))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const d of t.nodes){const f=d.domId||d.id;d.domId=`${t.diagramId}-${f}`}const n=VC[t.layoutAlgorithm],i=await n.loader(),{theme:a,themeVariables:s}=t.config,{useGradient:o,gradientStart:l,gradientStop:u}=s,h=e.attr("id");if(e.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),o){const d=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return i.render(t,e,OKe,{algorithm:n.algorithm},r)},"render"),nS=x((t="",{fallback:e="dagre"}={})=>{if(t in VC)return t;if(e in VC)return le.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),MV="comm",Ype="rule",Xpe="decl",PKe="@media",BKe="@import",FKe="@supports",zKe="@namespace",GO="@keyframes",jpe="@layer",VKe="@scope",GKe=Math.abs,Vw=String.fromCharCode;function Kpe(t){return t.trim()}function WO(t,e,r){return t.replace(e,r)}function fy(t,e){return t.charCodeAt(e)|0}function Mb(t,e,r){return t.slice(e,r)}function Lc(t){return t.length}function Zpe(t){return t.length}function LE(t,e){return e.push(t),t}var wR=1,Ib=1,Qpe=0,bl=0,Gi=0,Tx="";function IV(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:wR,column:Ib,length:s,return:"",siblings:o}}function WKe(){return Gi}function HKe(){return Gi=bl>0?fy(Tx,--bl):0,Ib--,Gi===10&&(Ib=1,wR--),Gi}function Zl(){return Gi=bl2||GC(Gi)>3?"":" "}function XKe(t,e){for(;--e&&Zl()&&!(Gi<48||Gi>102||Gi>57&&Gi<65||Gi>70&&Gi<97););return CR(t,J4()+(e<6&&Ld()==32&&Zl()==32))}function HO(t){for(;Zl();)switch(Gi){case t:return bl;case 34:case 39:t!==34&&t!==39&&HO(Gi);break;case 40:t===41&&HO(t);break;case 92:Zl();break}return bl}function jKe(t,e){for(;Zl()&&t+Gi!==57;)if(t+Gi===84&&Ld()===47)break;return"/*"+CR(e,bl-1)+"*"+Vw(t===47?t:Zl())}function KKe(t){for(;!GC(Ld());)Zl();return CR(t,bl)}function ZKe(t){return UKe(e3("",null,null,null,[""],t=qKe(t),0,[0],t))}function e3(t,e,r,n,i,a,s,o,l){for(var u=0,h=0,d=s,f=0,p=0,g=0,m=1,y=1,v=1,T=0,b=0,w="",C=i,S=a,k=n,E=w;y;)switch(g=b,b=Zl()){case 40:g!=108&&fy(E,d-1)==58?(T++,E+="("):E+=eI(b);break;case 41:T--,E+=")";break;case 34:case 39:case 91:E+=eI(b);break;case 9:case 10:case 13:case 32:if(T>0){E+=Vw(b);break}E+=YKe(g);break;case 92:E+=XKe(J4()-1,7);continue;case 47:switch(Ld()){case 42:case 47:LE(QKe(jKe(Zl(),J4()),e,r,l),l),(GC(g||1)==5||GC(Ld()||1)==5)&&Lc(E)&&Mb(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*m:o[u++]=Lc(E)*v;case 125*m:case 59:case 0:if(T>0&&b){E+=Vw(b);break}switch(b){case 0:case 125:y=0;case 59+h:v==-1&&(E=WO(E,/\f/g,"")),p>0&&(Lc(E)-d||m===0)&&LE(p>32?nZ(E+";",n,r,d-1,l):nZ(WO(E," ","")+";",n,r,d-2,l),l);break;case 59:E+=";";default:if(LE(k=rZ(E,e,r,u,h,i,o,w,C=[],S=[],d,a),a),b===123)if(h===0)e3(E,e,k,k,C,a,d,o,S);else{switch(f){case 99:if(fy(E,3)===110)break;case 108:if(fy(E,2)===97)break;default:h=0;case 100:case 109:case 115:}h?e3(t,k,k,n&&LE(rZ(t,k,k,0,0,i,o,w,i,C=[],d,S),S),i,S,d,o,n?C:S):e3(E,k,k,k,[""],S,0,o,S)}}u=h=p=0,m=v=1,w=E="",d=s;break;case 58:d=1+Lc(E),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&HKe()==125)continue}switch(E+=Vw(b),b*m){case 38:v=h>0?1:(E+="\f",-1);break;case 44:if(T>0)break;o[u++]=(Lc(E)-1)*v,v=1;break;case 64:Ld()===45&&(E+=eI(Zl())),f=Ld(),h=d=Lc(w=E+=KKe(J4())),b++;break;case 45:g===45&&Lc(E)==2&&(m=0)}}return a}function rZ(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=Zpe(p),m=0,y=0,v=0;m0?p[T]+" "+b:WO(b,/&\f/g,p[T])))&&(l[v++]=w);return IV(t,e,r,i===0?Ype:o,l,u,h,d)}function QKe(t,e,r,n){return IV(t,e,r,MV,Vw(WKe()),Mb(t,2,-2),0,n)}function nZ(t,e,r,n,i){return IV(t,e,r,Xpe,Mb(t,0,n),Mb(t,n+1,-1),n,i)}function qO(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),rZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>syt);return{diagram:e}},void 0,import.meta.url);return{id:Jpe,diagram:t}},"loader"),nZe={id:Jpe,detector:tZe,loader:rZe},iZe=nZe,e0e="flowchart",aZe=x((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),sZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bW);return{diagram:e}},void 0,import.meta.url);return{id:e0e,diagram:t}},"loader"),oZe={id:e0e,detector:aZe,loader:sZe},lZe=oZe,t0e="flowchart-v2",cZe=x((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),uZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bW);return{diagram:e}},void 0,import.meta.url);return{id:t0e,diagram:t}},"loader"),hZe={id:t0e,detector:cZe,loader:uZe},dZe=hZe,r0e="swimlane",fZe=x(t=>/^\s*swimlane-beta\b/.test(t),"detector"),pZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Tyt);return{diagram:e}},void 0,import.meta.url);return{id:r0e,diagram:t}},"loader"),gZe={id:r0e,detector:fZe,loader:pZe},mZe=gZe,n0e="er",yZe=x(t=>/^\s*erDiagram/.test(t),"detector"),vZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Ryt);return{diagram:e}},void 0,import.meta.url);return{id:n0e,diagram:t}},"loader"),bZe={id:n0e,detector:yZe,loader:vZe},xZe=bZe,i0e="gitGraph",TZe=x(t=>/^\s*gitGraph/.test(t),"detector"),wZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>IAt);return{diagram:e}},void 0,import.meta.url);return{id:i0e,diagram:t}},"loader"),CZe={id:i0e,detector:TZe,loader:wZe},kZe=CZe,a0e="gantt",SZe=x(t=>/^\s*gantt/.test(t),"detector"),EZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>z_t);return{diagram:e}},void 0,import.meta.url);return{id:a0e,diagram:t}},"loader"),AZe={id:a0e,detector:SZe,loader:EZe},_Ze=AZe,s0e="info",RZe=x(t=>/^\s*info/.test(t),"detector"),LZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>X_t);return{diagram:e}},void 0,import.meta.url);return{id:s0e,diagram:t}},"loader"),MZe={id:s0e,detector:RZe,loader:LZe},o0e="pie",IZe=x(t=>/^\s*pie/.test(t),"detector"),NZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>h6t);return{diagram:e}},void 0,import.meta.url);return{id:o0e,diagram:t}},"loader"),DZe={id:o0e,detector:IZe,loader:NZe},l0e="quadrantChart",OZe=x(t=>/^\s*quadrantChart/.test(t),"detector"),$Ze=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>b6t);return{diagram:e}},void 0,import.meta.url);return{id:l0e,diagram:t}},"loader"),PZe={id:l0e,detector:OZe,loader:$Ze},BZe=PZe,c0e="xychart",FZe=x(t=>/^\s*xychart(-beta)?/.test(t),"detector"),zZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>D6t);return{diagram:e}},void 0,import.meta.url);return{id:c0e,diagram:t}},"loader"),VZe={id:c0e,detector:FZe,loader:zZe},GZe=VZe,u0e="requirement",WZe=x(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),HZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>G6t);return{diagram:e}},void 0,import.meta.url);return{id:u0e,diagram:t}},"loader"),qZe={id:u0e,detector:WZe,loader:HZe},UZe=qZe,h0e="sequence",YZe=x(t=>/^\s*sequenceDiagram/.test(t),"detector"),XZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>PRt);return{diagram:e}},void 0,import.meta.url);return{id:h0e,diagram:t}},"loader"),jZe={id:h0e,detector:YZe,loader:XZe},KZe=jZe,d0e="class",ZZe=x((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),QZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>WRt);return{diagram:e}},void 0,import.meta.url);return{id:d0e,diagram:t}},"loader"),JZe={id:d0e,detector:ZZe,loader:QZe},eQe=JZe,f0e="classDiagram",tQe=x((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),rQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>qRt);return{diagram:e}},void 0,import.meta.url);return{id:f0e,diagram:t}},"loader"),nQe={id:f0e,detector:tQe,loader:rQe},iQe=nQe,p0e="state",aQe=x((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),sQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>DLt);return{diagram:e}},void 0,import.meta.url);return{id:p0e,diagram:t}},"loader"),oQe={id:p0e,detector:aQe,loader:sQe},lQe=oQe,g0e="stateDiagram",cQe=x((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),uQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>$Lt);return{diagram:e}},void 0,import.meta.url);return{id:g0e,diagram:t}},"loader"),hQe={id:g0e,detector:cQe,loader:uQe},dQe=hQe,m0e="journey",fQe=x(t=>/^\s*journey/.test(t),"detector"),pQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>i7t);return{diagram:e}},void 0,import.meta.url);return{id:m0e,diagram:t}},"loader"),gQe={id:m0e,detector:fQe,loader:pQe},mQe=gQe,yQe=x((t,e,r)=>{le.debug(`rendering svg for syntax error +`);const n=xs(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),Ai(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),y0e={draw:yQe},vQe=y0e,bQe={db:{},renderer:y0e,parser:{parse:x(()=>{},"parse")}},xQe=bQe,v0e="flowchart-elk",TQe=x((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),wQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bW);return{diagram:e}},void 0,import.meta.url);return{id:v0e,diagram:t}},"loader"),CQe={id:v0e,detector:TQe,loader:wQe},kQe=CQe,b0e="timeline",SQe=x(t=>/^\s*timeline/.test(t),"detector"),EQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>N7t);return{diagram:e}},void 0,import.meta.url);return{id:b0e,diagram:t}},"loader"),AQe={id:b0e,detector:SQe,loader:EQe},_Qe=AQe,x0e="mindmap",RQe=x(t=>/^\s*mindmap/.test(t),"detector"),LQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>j7t);return{diagram:e}},void 0,import.meta.url);return{id:x0e,diagram:t}},"loader"),MQe={id:x0e,detector:RQe,loader:LQe},IQe=MQe,T0e="kanban",NQe=x(t=>/^\s*kanban/.test(t),"detector"),DQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>gMt);return{diagram:e}},void 0,import.meta.url);return{id:T0e,diagram:t}},"loader"),OQe={id:T0e,detector:NQe,loader:DQe},$Qe=OQe,w0e="sankey",PQe=x(t=>/^\s*sankey(-beta)?/.test(t),"detector"),BQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>eIt);return{diagram:e}},void 0,import.meta.url);return{id:w0e,diagram:t}},"loader"),FQe={id:w0e,detector:PQe,loader:BQe},zQe=FQe,C0e="packet",VQe=x(t=>/^\s*packet(-beta)?/.test(t),"detector"),GQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>hIt);return{diagram:e}},void 0,import.meta.url);return{id:C0e,diagram:t}},"loader"),WQe={id:C0e,detector:VQe,loader:GQe},k0e="radar",HQe=x(t=>/^\s*radar-beta/.test(t),"detector"),qQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>IIt);return{diagram:e}},void 0,import.meta.url);return{id:k0e,diagram:t}},"loader"),UQe={id:k0e,detector:HQe,loader:qQe},S0e="block",YQe=x(t=>/^\s*block(-beta)?/.test(t),"detector"),XQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>aNt);return{diagram:e}},void 0,import.meta.url);return{id:S0e,diagram:t}},"loader"),jQe={id:S0e,detector:YQe,loader:XQe},KQe=jQe,E0e="treeView",ZQe=x(t=>/^\s*treeView-beta/.test(t),"detector"),QQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>RNt);return{diagram:e}},void 0,import.meta.url);return{id:E0e,diagram:t}},"loader"),JQe={id:E0e,detector:ZQe,loader:QQe},eJe=JQe,A0e="architecture",tJe=x(t=>/^\s*architecture/.test(t),"detector"),rJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>nDt);return{diagram:e}},void 0,import.meta.url);return{id:A0e,diagram:t}},"loader"),nJe={id:A0e,detector:tJe,loader:rJe},iJe=nJe,_0e="eventmodeling",aJe=x(t=>/^\s*eventmodeling/.test(t),"detector"),sJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bDt);return{diagram:e}},void 0,import.meta.url);return{id:_0e,diagram:t}},"loader"),oJe={id:_0e,detector:aJe,loader:sJe},lJe=oJe,R0e="ishikawa",cJe=x(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),uJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>$Dt);return{diagram:e}},void 0,import.meta.url);return{id:R0e,diagram:t}},"loader"),hJe={id:R0e,detector:cJe,loader:uJe},L0e="venn",dJe=x(t=>/^\s*venn-beta/.test(t),"detector"),fJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>TOt);return{diagram:e}},void 0,import.meta.url);return{id:L0e,diagram:t}},"loader"),pJe={id:L0e,detector:dJe,loader:fJe},gJe=pJe,M0e="treemap",mJe=x(t=>/^\s*treemap/.test(t),"detector"),yJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>IOt);return{diagram:e}},void 0,import.meta.url);return{id:M0e,diagram:t}},"loader"),vJe={id:M0e,detector:mJe,loader:yJe},I0e="wardley",bJe=x(t=>/^\s*wardley-beta/i.test(t),"detector"),xJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>HOt);return{diagram:e}},void 0,import.meta.url);return{id:I0e,diagram:t}},"loader"),TJe={id:I0e,detector:bJe,loader:xJe},wJe=TJe,N0e="cynefin",CJe=x(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),kJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>o$t);return{diagram:e}},void 0,import.meta.url);return{id:N0e,diagram:t}},"loader"),SJe={id:N0e,detector:CJe,loader:kJe},D0e="railroad",EJe=x(t=>/^\s*railroad-beta/i.test(t),"detector"),AJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>I$t);return{diagram:e}},void 0,import.meta.url);return{id:D0e,diagram:t}},"loader"),_Je={id:D0e,detector:EJe,loader:AJe},O0e="railroadEbnf",RJe=x(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),LJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>V$t);return{diagram:e}},void 0,import.meta.url);return{id:O0e,diagram:t}},"loader"),MJe={id:O0e,detector:RJe,loader:LJe},$0e="railroadAbnf",IJe=x(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),NJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Z$t);return{diagram:e}},void 0,import.meta.url);return{id:$0e,diagram:t}},"loader"),DJe={id:$0e,detector:IJe,loader:NJe},P0e="railroadPeg",OJe=x(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),$Je=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>oPt);return{diagram:e}},void 0,import.meta.url);return{id:P0e,diagram:t}},"loader"),PJe={id:P0e,detector:OJe,loader:$Je},iZ=!1,kR=x(()=>{iZ||(iZ=!0,nA("error",xQe,t=>t.toLowerCase().trim()==="error"),nA("---",{db:{clear:x(()=>{},"clear")},styles:{},renderer:{draw:x(()=>{},"draw")},parser:{parse:x(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:x(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),qD(kQe,IQe,iJe),qD(iZe,$Qe,iQe,eQe,xZe,_Ze,MZe,DZe,UZe,KZe,mZe,dZe,lZe,_Qe,kZe,dQe,lQe,mQe,BZe,zQe,WQe,GZe,KQe,lJe,eJe,UQe,hJe,vJe,_Je,MJe,DJe,PJe,gJe,wJe,SJe))},"addDiagrams"),BJe=x(async()=>{le.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(A0).map(async([r,{detector:n,loader:i}])=>{if(i)try{KD(r)}catch{try{const{diagram:a,id:s}=await i();nA(s,a,n)}catch(a){throw le.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete A0[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){le.error(`Failed to load ${e.length} external diagrams`);for(const r of e)le.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),FJe="graphics-document document";function B0e(t,e){t.attr("role",FJe),e!==""&&t.attr("aria-roledescription",e)}x(B0e,"setA11yDiagramInfo");function F0e(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}x(F0e,"addSVGa11yTitleDescription");var g0,UO=(g0=class{constructor(e,r,n,i,a){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=a}static async fromText(e,r={}){var u,h;const n=Xt(),i=kz(e,n);e=oXe(e)+` +`;try{KD(i)}catch{const d=SFe(i);if(!d)throw new ece(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();nA(f,p)}const{db:a,parser:s,renderer:o,init:l}=KD(i);return s.parser&&(s.parser.yy=a),(u=a.clear)==null||u.call(a),l==null||l(n),r.title&&((h=a.setDiagramTitle)==null||h.call(a,r.title)),await s.parse(e),new g0(i,e,a,s,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},x(g0,"Diagram"),g0),aZ=[],zJe=x(()=>{aZ.forEach(t=>{t()}),aZ=[]},"attachFunctions"),VJe=x(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function z0e(t){const e=t.match(Jle);if(!e)return{text:t,metadata:{}};const r=e[1],n=r?e[2].split(` `).map(s=>s.startsWith(r)?s.slice(r.length):s).join(` -`):e[2];let i=dR(n,{schema:hR})??{};i=typeof i=="object"&&!Array.isArray(i)?i:{};const a={};return i.displayMode&&(a.displayMode=i.displayMode.toString()),i.title&&(a.title=i.title.toString()),i.config&&(a.config=i.config),{text:t.slice(e[0].length),metadata:a}}x(F0e,"extractFrontMatter");var VJe=x(t=>t.replace(/\r\n?/g,` -`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),GJe=x(t=>{const{text:e,metadata:r}=F0e(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}},"processFrontmatter"),WJe=x(t=>{const e=yr.detectInit(t)??{},r=yr.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(e.wrap=!0),{text:KYe(t),directive:e}},"processDirectives");function NV(t){const e=VJe(t),r=GJe(e),n=WJe(r.text),i=ri(r.config,n.directive);return t=zJe(n.text),{code:t,title:r.title,config:i}}x(NV,"preprocessDiagram");function z0e(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}x(z0e,"toBase64");var HJe=5e4,qJe="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",UJe="sandbox",YJe="loose",XJe="http://www.w3.org/2000/svg",jJe="http://www.w3.org/1999/xlink",KJe="http://www.w3.org/1999/xhtml",ZJe="100%",QJe="100%",JJe="border:0;margin:0;",eet="margin:0",tet="allow-top-navigation-by-user-activation allow-popups",ret='The "iframe" tag is not supported by your browser.',net=["foreignobject"],iet=["dominant-baseline"];function DV(t){const e=NV(t);return tA(),xFe(e.config??{}),e}x(DV,"processAndSetConfigs");async function V0e(t,e){kR();try{const{code:r,config:n}=DV(t);return{diagramType:(await W0e(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}x(V0e,"parse");var sZ=x((t,e,r=[])=>{const n=Ule(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),aet=x((t,e=new Map)=>{const r=new CSSStyleSheet;if(t.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),t.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){const o=xn(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{bK(l.styles)||o.forEach(u=>{r.insertRule(sZ(l.id,u,l.styles),r.cssRules.length)}),bK(l.textStyles)||r.insertRule(sZ(l.id,"tspan",((l==null?void 0:l.textStyles)||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(t.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const i=new CSSStyleSheet;i.replaceSync(t.themeCSS),n=XD(i)+` +`):e[2];let i=dR(n,{schema:hR})??{};i=typeof i=="object"&&!Array.isArray(i)?i:{};const a={};return i.displayMode&&(a.displayMode=i.displayMode.toString()),i.title&&(a.title=i.title.toString()),i.config&&(a.config=i.config),{text:t.slice(e[0].length),metadata:a}}x(z0e,"extractFrontMatter");var GJe=x(t=>t.replace(/\r\n?/g,` +`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),WJe=x(t=>{const{text:e,metadata:r}=z0e(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}},"processFrontmatter"),HJe=x(t=>{const e=yr.detectInit(t)??{},r=yr.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(e.wrap=!0),{text:ZYe(t),directive:e}},"processDirectives");function NV(t){const e=GJe(t),r=WJe(e),n=HJe(r.text),i=ri(r.config,n.directive);return t=VJe(n.text),{code:t,title:r.title,config:i}}x(NV,"preprocessDiagram");function V0e(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}x(V0e,"toBase64");var qJe=5e4,UJe="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",YJe="sandbox",XJe="loose",jJe="http://www.w3.org/2000/svg",KJe="http://www.w3.org/1999/xlink",ZJe="http://www.w3.org/1999/xhtml",QJe="100%",JJe="100%",eet="border:0;margin:0;",tet="margin:0",ret="allow-top-navigation-by-user-activation allow-popups",net='The "iframe" tag is not supported by your browser.',iet=["foreignobject"],aet=["dominant-baseline"];function DV(t){const e=NV(t);return tA(),TFe(e.config??{}),e}x(DV,"processAndSetConfigs");async function G0e(t,e){kR();try{const{code:r,config:n}=DV(t);return{diagramType:(await H0e(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}x(G0e,"parse");var sZ=x((t,e,r=[])=>{const n=Yle(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),set=x((t,e=new Map)=>{const r=new CSSStyleSheet;if(t.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),t.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){const o=xn(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{bK(l.styles)||o.forEach(u=>{r.insertRule(sZ(l.id,u,l.styles),r.cssRules.length)}),bK(l.textStyles)||r.insertRule(sZ(l.id,"tspan",((l==null?void 0:l.textStyles)||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(t.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const i=new CSSStyleSheet;i.replaceSync(t.themeCSS),n=XD(i)+` `}else n+=`${t.themeCSS} -`;return n+XD(r)},"createCssStyles"),set=x((t,e)=>qO(KKe(`${t}{${e}}`),JKe([x(function(n,i,a,s){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===GO)return;n.props=n.props.map(o=>o===t&&Array.isArray(n.children)&&n.children.every(u=>u.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(u.props))||(o.startsWith(`${t} `)||o.startsWith(`${t}>`))&&!o.startsWith(`${t} ||`)?o:`${t} ${o}`)}else n.type.startsWith("@")&&([...[$Ke,BKe,Xpe,zKe,"@container","@starting-style"],GO].includes(n.type)||(le.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=MV))},"addNamespace"),QKe])),"compileCSS"),oet=x((t,e,r,n)=>{const i=aet(t,r),a=zFe(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return set(n,a)},"createUserStyles"),cet=x((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=vh(n),n=n.replace(/
/g,"
"),n},"cleanUpSvgCode"),uet=x((t="",e)=>{var i,a;const r=(a=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&a.height?e.viewBox.baseVal.height+"px":QJe,n=z0e(`${t}`);return``},"putIntoIFrame"),oZ=x((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",XJe);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function YO(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}x(YO,"sandboxedIframe");var het=x((t,e,r,n)=>{var i,a,s;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(s=t.getElementById(n))==null||s.remove()},"removeExistingElements"),det=x(async function(t,e,r){var P,D,R,I,$,O;kR();const n=DV(e);e=n.code;const i=Xt();le.debug(i),e.length>((i==null?void 0:i.maxTextSize)??HJe)&&(e=qJe);const a=`#${t}`,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=x(()=>{const F=ut(f?o:u).node();F&&"remove"in F&&F.remove()},"removeTempElements");let d=ut(document.body);const f=i.securityLevel===UJe,p=i.securityLevel===YJe,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const N=YO(ut(r),s);d=ut(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=ut(r);oZ(d,t,l,`font-family: ${g}`,jJe)}else{if(het(document,t,l,s),f){const N=YO(ut(document.body),s);d=ut(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=ut("body");oZ(d,t,l)}let m,y;try{m=await UO.fromText(e,{title:n.title})}catch(N){if(i.suppressErrorRendering)throw h(),N;m=await UO.fromText("error"),y=N}const v=d.select(u).node(),T=m.type,b=v.firstChild,w=b.firstChild,C=(D=(P=m.renderer).getClasses)==null?void 0:D.call(P,e,m),S=oet(i,T,C,a),k=document.createElement("style");k.innerHTML=S,b.insertBefore(k,w);try{await m.renderer.draw(e,t,"11.16.1",m)}catch(N){throw i.suppressErrorRendering?h():yQe.draw(e,t,"11.16.1"),N}const E=d.select(`${u} svg`),_=(I=(R=m.db).getAccTitle)==null?void 0:I.call(R),M=(O=($=m.db).getAccDescription)==null?void 0:O.call($);H0e(T,E,_,M),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",KJe);let L=d.select(u).node().innerHTML;if(le.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),L=cet(L,f,su(i.arrowMarkerAbsolute)),f){const N=d.select(u+" svg").node();L=uet(L,N)}else p||(L=ph.sanitize(L,{ADD_TAGS:net,ADD_ATTR:iet,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(FJe(),y)throw y;return h(),{diagramType:T,svg:L,bindFunctions:m.db.bindFunctions}},"render");function G0e(t={}){var n;const e=Wi({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),vFe(e),e!=null&&e.theme&&e.theme in ch?e.themeVariables=ch[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=ch.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?yFe(e):Yle();Tz(r.logLevel),kR()}x(G0e,"initialize");var W0e=x((t,e={})=>{const{code:r}=NV(t);return UO.fromText(r,e)},"getDiagramFromText");function H0e(t,e,r,n){P0e(e,t),B0e(e,r,n,e.attr("id"))}x(H0e,"addA11yInfo");var O0=Object.freeze({render:det,parse:V0e,getDiagramFromText:W0e,initialize:G0e,getConfig:Xt,setConfig:Xle,getSiteConfig:Yle,updateSiteConfig:bFe,reset:x(()=>{tA()},"reset"),globalReset:x(()=>{tA(Tb)},"globalReset"),defaultConfig:Tb});Tz(Xt().logLevel);tA(Xt());var fet=x((t,e,r)=>{le.warn(t),dV(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),q0e=x(async function(t={querySelector:".mermaid"}){try{await pet(t)}catch(e){if(dV(e)&&le.error(e.str),Oo.parseError&&Oo.parseError(e),!t.suppressErrors)throw le.error("Use the suppressErrors option to suppress these errors"),e}},"run"),pet=x(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=O0.getConfig();le.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");le.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(le.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),O0.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new yr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(le.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=jde(yr.entityDecode(s)).trim().replace(//gi,"
");const h=yr.detectInit(s);h&&le.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await j0e(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){fet(d,o,Oo.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),U0e=x(function(t){O0.initialize(t)},"initialize"),get=x(async function(t,e,r){le.warn("mermaid.init is deprecated. Please use run instead."),t&&U0e(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await q0e(n)},"init"),met=x(async(t,{lazyLoad:e=!0}={})=>{kR(),qD(...t),e===!1&&await PJe()},"registerExternalDiagrams"),Y0e=x(function(){if(Oo.startOnLoad){const{startOnLoad:t}=O0.getConfig();t&&Oo.run().catch(e=>le.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",Y0e,!1);var yet=x(function(t){Oo.parseError=t},"setParseErrorHandler"),VA=[],tI=!1,X0e=x(async()=>{if(!tI){for(tI=!0;VA.length>0;){const t=VA.shift();if(t)try{await t()}catch(e){le.error("Error executing queue",e)}}tI=!1}},"executeQueue"),vet=x(async(t,e)=>new Promise((r,n)=>{const i=x(()=>new Promise((a,s)=>{O0.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;le.error("Error parsing",o),(l=Oo.parseError)==null||l.call(Oo,o),s(o),n(o)})}),"performCall");VA.push(i),X0e().catch(n)}),"parse"),j0e=x((t,e,r)=>new Promise((n,i)=>{const a=x(()=>new Promise((s,o)=>{O0.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;le.error("Error parsing",l),(u=Oo.parseError)==null||u.call(Oo,l),o(l),i(l)})}),"performCall");VA.push(a),X0e().catch(i)}),"render"),bet=x(()=>Object.keys(A0).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Oo={startOnLoad:!0,mermaidAPI:O0,parse:vet,render:j0e,init:get,run:q0e,registerExternalDiagrams:met,registerLayoutLoaders:qpe,initialize:U0e,parseError:void 0,contentLoaded:Y0e,setParseErrorHandler:yet,detectType:kz,registerIconPacks:pV,getRegisteredDiagramsMetadata:bet},lZ=Oo;/*! Check if previously processed *//*! +`;return n+XD(r)},"createCssStyles"),oet=x((t,e)=>qO(ZKe(`${t}{${e}}`),eZe([x(function(n,i,a,s){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===GO)return;n.props=n.props.map(o=>o===t&&Array.isArray(n.children)&&n.children.every(u=>u.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(u.props))||(o.startsWith(`${t} `)||o.startsWith(`${t}>`))&&!o.startsWith(`${t} ||`)?o:`${t} ${o}`)}else n.type.startsWith("@")&&([...[PKe,FKe,jpe,VKe,"@container","@starting-style"],GO].includes(n.type)||(le.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=MV))},"addNamespace"),JKe])),"compileCSS"),cet=x((t,e,r,n)=>{const i=set(t,r),a=VFe(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return oet(n,a)},"createUserStyles"),uet=x((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=vh(n),n=n.replace(/
/g,"
"),n},"cleanUpSvgCode"),het=x((t="",e)=>{var i,a;const r=(a=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&a.height?e.viewBox.baseVal.height+"px":JJe,n=V0e(`${t}`);return``},"putIntoIFrame"),oZ=x((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",jJe);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function YO(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}x(YO,"sandboxedIframe");var det=x((t,e,r,n)=>{var i,a,s;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(s=t.getElementById(n))==null||s.remove()},"removeExistingElements"),fet=x(async function(t,e,r){var P,D,R,I,$,O;kR();const n=DV(e);e=n.code;const i=Xt();le.debug(i),e.length>((i==null?void 0:i.maxTextSize)??qJe)&&(e=UJe);const a=`#${t}`,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=x(()=>{const F=ut(f?o:u).node();F&&"remove"in F&&F.remove()},"removeTempElements");let d=ut(document.body);const f=i.securityLevel===YJe,p=i.securityLevel===XJe,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const N=YO(ut(r),s);d=ut(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=ut(r);oZ(d,t,l,`font-family: ${g}`,KJe)}else{if(det(document,t,l,s),f){const N=YO(ut(document.body),s);d=ut(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=ut("body");oZ(d,t,l)}let m,y;try{m=await UO.fromText(e,{title:n.title})}catch(N){if(i.suppressErrorRendering)throw h(),N;m=await UO.fromText("error"),y=N}const v=d.select(u).node(),T=m.type,b=v.firstChild,w=b.firstChild,C=(D=(P=m.renderer).getClasses)==null?void 0:D.call(P,e,m),S=cet(i,T,C,a),k=document.createElement("style");k.innerHTML=S,b.insertBefore(k,w);try{await m.renderer.draw(e,t,"11.16.1",m)}catch(N){throw i.suppressErrorRendering?h():vQe.draw(e,t,"11.16.1"),N}const E=d.select(`${u} svg`),_=(I=(R=m.db).getAccTitle)==null?void 0:I.call(R),M=(O=($=m.db).getAccDescription)==null?void 0:O.call($);q0e(T,E,_,M),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",ZJe);let L=d.select(u).node().innerHTML;if(le.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),L=uet(L,f,su(i.arrowMarkerAbsolute)),f){const N=d.select(u+" svg").node();L=het(L,N)}else p||(L=ph.sanitize(L,{ADD_TAGS:iet,ADD_ATTR:aet,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(zJe(),y)throw y;return h(),{diagramType:T,svg:L,bindFunctions:m.db.bindFunctions}},"render");function W0e(t={}){var n;const e=Wi({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),bFe(e),e!=null&&e.theme&&e.theme in ch?e.themeVariables=ch[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=ch.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?vFe(e):Xle();Tz(r.logLevel),kR()}x(W0e,"initialize");var H0e=x((t,e={})=>{const{code:r}=NV(t);return UO.fromText(r,e)},"getDiagramFromText");function q0e(t,e,r,n){B0e(e,t),F0e(e,r,n,e.attr("id"))}x(q0e,"addA11yInfo");var O0=Object.freeze({render:fet,parse:G0e,getDiagramFromText:H0e,initialize:W0e,getConfig:Xt,setConfig:jle,getSiteConfig:Xle,updateSiteConfig:xFe,reset:x(()=>{tA()},"reset"),globalReset:x(()=>{tA(Tb)},"globalReset"),defaultConfig:Tb});Tz(Xt().logLevel);tA(Xt());var pet=x((t,e,r)=>{le.warn(t),dV(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),U0e=x(async function(t={querySelector:".mermaid"}){try{await get(t)}catch(e){if(dV(e)&&le.error(e.str),Oo.parseError&&Oo.parseError(e),!t.suppressErrors)throw le.error("Use the suppressErrors option to suppress these errors"),e}},"run"),get=x(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=O0.getConfig();le.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");le.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(le.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),O0.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new yr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(le.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=Kde(yr.entityDecode(s)).trim().replace(//gi,"
");const h=yr.detectInit(s);h&&le.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await K0e(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){pet(d,o,Oo.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),Y0e=x(function(t){O0.initialize(t)},"initialize"),met=x(async function(t,e,r){le.warn("mermaid.init is deprecated. Please use run instead."),t&&Y0e(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await U0e(n)},"init"),yet=x(async(t,{lazyLoad:e=!0}={})=>{kR(),qD(...t),e===!1&&await BJe()},"registerExternalDiagrams"),X0e=x(function(){if(Oo.startOnLoad){const{startOnLoad:t}=O0.getConfig();t&&Oo.run().catch(e=>le.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",X0e,!1);var vet=x(function(t){Oo.parseError=t},"setParseErrorHandler"),VA=[],tI=!1,j0e=x(async()=>{if(!tI){for(tI=!0;VA.length>0;){const t=VA.shift();if(t)try{await t()}catch(e){le.error("Error executing queue",e)}}tI=!1}},"executeQueue"),bet=x(async(t,e)=>new Promise((r,n)=>{const i=x(()=>new Promise((a,s)=>{O0.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;le.error("Error parsing",o),(l=Oo.parseError)==null||l.call(Oo,o),s(o),n(o)})}),"performCall");VA.push(i),j0e().catch(n)}),"parse"),K0e=x((t,e,r)=>new Promise((n,i)=>{const a=x(()=>new Promise((s,o)=>{O0.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;le.error("Error parsing",l),(u=Oo.parseError)==null||u.call(Oo,l),o(l),i(l)})}),"performCall");VA.push(a),j0e().catch(i)}),"render"),xet=x(()=>Object.keys(A0).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Oo={startOnLoad:!0,mermaidAPI:O0,parse:bet,render:K0e,init:met,run:U0e,registerExternalDiagrams:yet,registerLayoutLoaders:Upe,initialize:Y0e,parseError:void 0,contentLoaded:X0e,setParseErrorHandler:vet,detectType:kz,registerIconPacks:pV,getRegisteredDiagramsMetadata:xet},lZ=Oo;/*! Check if previously processed *//*! * Wait for document loaded before starting the execution - */function d0(t){try{const n=new URL(t,"http://edgeever.local").pathname.match(/^\/api\/v1\/resources\/([^/]+)(?:\/blob)?\/?$/);if(n!=null&&n[1])return decodeURIComponent(n[1])}catch{}const e=t.match(/\/api\/v1\/resources\/([^/?#]+)/);return e!=null&&e[1]&&e[1]!=="blob"?decodeURIComponent(e[1]):null}function OV(t,e){return/\/blob(?:$|[?#])/.test(t)||t.includes(`/resources/${e}/blob`)?t:t.startsWith("/api/v1/resources/")||t.includes("/api/v1/resources/")?`/api/v1/resources/${encodeURIComponent(e)}/blob`:t}function $V(t,e){const r=d0(t);return r?JSON.stringify({kind:"image",href:OV(t,r),filename:e.trim()||`image-${r}`,resourceId:r}):null}function xet(t,e){const r=d0(t);if(!r)return null;const n=e.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()||r;return JSON.stringify({kind:"attachment",href:OV(t,r),filename:n,resourceId:r})}const Tet=performance.now();let Ha="viewer",KT=!1;const GA=new Map;let wet=0;function dl(t){var e,r,n;try{(n=(r=(e=window.webkit)==null?void 0:e.messageHandlers)==null?void 0:r.edgeever)==null||n.postMessage(t)}catch{}}function WA(t){return t.startsWith("/api/")||t.includes("/api/v1/resources/")}function K0e(t){return!t||t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("edgeever-res:")?!1:!!(WA(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/"))}function Z0e(t){return new Promise(e=>{const r=`r${++wet}`;GA.set(r,e),dl({type:"loadResource",requestId:r,source:t}),setTimeout(()=>{GA.delete(r)&&e(null)},3e4)})}async function Cet(t){const e=Array.from(t.querySelectorAll("img[src]"));await Promise.all(e.map(async r=>{const n=r.getAttribute("src")||"";if(K0e(n)&&(r.dataset.originalSrc||(r.dataset.originalSrc=n),r.dataset.hydrating!=="1")){r.dataset.hydrating="1";try{const i=await Z0e(n);i&&r.setAttribute("src",i)}finally{delete r.dataset.hydrating}}}))}async function ket(t,e){const r=Array.from(t.querySelectorAll("pre code.language-mermaid, pre code[class*='mermaid']")),n=Array.from(t.querySelectorAll("pre")).filter(s=>{const o=s.textContent||"";return s.querySelector("code")&&/^(graph|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|mindmap|flowchart)/m.test(o.trim())}),i=new Set([...r.map(s=>s.parentElement).filter(Boolean),...n]);lZ.initialize({startOnLoad:!1,securityLevel:"strict",theme:e==="dark"?"dark":"default"});let a=0;for(const s of i){const o=(s.textContent||"").trim();if(o)try{const l=`mmd-${Date.now()}-${a++}`,{svg:u}=await lZ.render(l,o),h=document.createElement("div");h.className="edgeever-mermaid",h.innerHTML=u,s.replaceWith(h)}catch{}}}const Eet=[{label:"25%",width:25},{label:"50%",width:50},{label:"75%",width:75},{label:"100%",width:100}];function td(t){if(t==null||t==="")return null;const e=typeof t=="number"?t:Number.parseFloat(String(t).replace("%",""));return Number.isFinite(e)?Math.min(100,Math.max(10,Math.round(e))):null}function Q0e(t){return Math.min(100,Math.max(10,Math.round(t)))}function ME(t,e){const r=e==null?null:Q0e(e);if(r==null){t.style.removeProperty("width"),t.style.removeProperty("max-width"),t.style.removeProperty("--ee-image-width"),delete t.dataset.width,t.classList.remove("has-width");return}const n=`${r}%`;t.dataset.width=String(r),t.classList.add("has-width"),t.style.setProperty("--ee-image-width",n),t.style.setProperty("width",n),t.style.setProperty("max-width",n),t.style.setProperty("margin-left","auto"),t.style.setProperty("margin-right","auto"),t.style.setProperty("box-sizing","border-box"),t.style.setProperty("display","block")}function cZ(t,e){let r=0;const n=a=>{a.preventDefault(),a.stopPropagation(),typeof a.stopImmediatePropagation=="function"&&a.stopImmediatePropagation()},i=a=>{n(a);const s=Date.now();s-r<350||(r=s,e())};t.addEventListener("pointerdown",n),t.addEventListener("mousedown",n),t.addEventListener("touchstart",n,{passive:!1}),t.addEventListener("pointerup",i),t.addEventListener("click",i)}function Aet(){return G$e.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>td(e.getAttribute("data-width")??e.getAttribute("width")??e.style.width),renderHTML:e=>{const r=td(e.width);return r?{"data-width":String(r),style:`width: ${r}%`}:{}}}}},addNodeView(){return({editor:t,getPos:e,node:r})=>{let n=r;const i=document.createElement("figure");i.className="edgeever-image-node is-loading",i.contentEditable="false",i.setAttribute("role","img");const a=document.createElement("div");a.className="edgeever-image-loading";const s=document.createElement("span");s.className="edgeever-image-upload-spinner",a.append(s);const o=document.createElement("img");o.draggable=!1,o.hidden=!0;const l=document.createElement("button");l.type="button",l.className="edgeever-image-actions",l.contentEditable="false",l.hidden=!0,l.setAttribute("aria-label","图片操作"),l.textContent="⋯";const u=document.createElement("div");u.className="edgeever-image-size-controls",u.contentEditable="false",u.hidden=!0,u.setAttribute("role","group"),u.setAttribute("aria-label","图片宽度");const h=E=>{const _=e();if(typeof _!="number")return;const M=t.state.doc.nodeAt(_);if(!M||M.type.name!=="image")return;const L=Q0e(E);let P=t.state.tr.setNodeMarkup(_,void 0,{...M.attrs,width:L});try{P=P.setSelection(lr.create(P.doc,_))}catch{}t.view.dispatch(P),ME(i,L),f(L)},d=[];for(const E of Eet){const _=document.createElement("button");_.type="button",_.className="edgeever-image-size-button",_.textContent=E.label,_.setAttribute("aria-label",E.label),_.setAttribute("aria-pressed","false"),cZ(_,()=>h(E.width)),d.push({button:_,width:E.width}),u.append(_)}const f=E=>{for(const _ of d){const M=E!=null&&_.width===E;_.button.classList.toggle("is-active",M),_.button.setAttribute("aria-pressed",String(M))}},p=E=>{if(i.classList.toggle("is-loading",E==="loading"),i.classList.toggle("is-failed",E==="failed"),a.hidden=E==="ready",o.hidden=E!=="ready",l.hidden=E!=="ready",E==="failed"){a.replaceChildren();const _=document.createElement("span");_.className="edgeever-image-loading-label",_.textContent="图片加载失败",a.append(_),a.hidden=!1}else E==="loading"&&a.replaceChildren(s)},g=E=>{const _=String(E.src??"");return WA(_)||d0(_)?_:i.dataset.resourceHref||_},m=()=>{const E=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs),_=$V(E,String(n.attrs.alt??"image"));if(_){dl({type:"resourcePress",targetJson:_});return}dl({type:"log",message:`image actions: no resource id for href=${E.slice(0,120)}`})},y=()=>{const E=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs)||o.getAttribute("src")||"";E&&dl({type:"imagePreview",source:E,alt:String(n.attrs.alt??"")})};cZ(l,m);let v=0;const T=E=>{if(E.target instanceof Element&&E.target.closest(".edgeever-image-actions"))return;const _=Date.now();if(_-v<350)return;if(v=_,E.stopPropagation(),Ha==="viewer"||!t.isEditable){E.preventDefault(),y();return}E.preventDefault();const M=e();typeof M=="number"&&t.chain().setNodeSelection(M).run()};o.addEventListener("pointerdown",E=>E.stopPropagation()),o.addEventListener("click",T),o.addEventListener("pointerup",E=>{(E.pointerType==="touch"||E.pointerType==="pen")&&T(E)}),i.append(a,o,l,u);let b=0,w="",C=!1;const S=E=>{const _=String(E.alt??"");o.alt=_;const M=td(E.width);ME(i,M),f(M);const L=String(E.src??""),P=d0(L);P&&(i.dataset.resourceHref=OV(L,P),o.dataset.originalSrc=i.dataset.resourceHref)},k=E=>{b+=1;const _=b,M=String(E.src??"");w=M,S(E),p("loading"),u.hidden=!0;const L=P=>{_===b&&(o.onload=()=>{_===b&&(p("ready"),o.style.cursor=Ha==="viewer"||!t.isEditable?"zoom-in":"pointer",C&&t.isEditable&&Ha==="editor"&&(u.hidden=!1))},o.onerror=()=>{_===b&&p("failed")},o.src=P)};if(!M){p("failed");return}if(M.startsWith("data:")||M.startsWith("edgeever-res:")||M.startsWith("blob:")){L(M);return}if(K0e(M)){Z0e(M).then(P=>{_===b&&(P?L(P):p("failed"))});return}L(M)};return k(r.attrs),{dom:i,update:E=>{if(E.type.name!=="image")return!1;n=E;const _=String(E.attrs.src??"");return S(E.attrs),_!==w?k(E.attrs):(f(td(E.attrs.width)),ME(i,td(E.attrs.width))),!0},selectNode:()=>{var _,M;C=!0,i.classList.add("is-selected");const E=td((M=(_=t.state.selection.node)==null?void 0:_.attrs)==null?void 0:M.width)??td(i.dataset.width)??td(n.attrs.width);ME(i,E),t.isEditable&&Ha==="editor"&&!o.hidden&&(u.hidden=!1,f(E))},deselectNode:()=>{C=!1,i.classList.remove("is-selected"),u.hidden=!0},destroy:()=>{b+=1}}}}}).configure({inline:!1,allowBase64:!0})}function _et(t){return[F$e.configure({codeBlock:!1}),RDe.configure({languageClassPrefix:"language-"}),Aet(),r9e.configure({table:{resizable:!1}}),W$e.configure({placeholder:t}),rBe.configure({markedOptions:{gfm:!0}})]}const Ul=document.getElementById("editor"),rI=document.getElementById("toolbar"),Xr=new fDe({element:Ul,extensions:_et("开始书写…"),editable:!1,content:{type:"doc",content:[{type:"paragraph"}]},onUpdate:({editor:t})=>{KT||Ha!=="editor"||kp(t)},editorProps:{attributes:{class:"edgeever-prose",spellcheck:"true"},handleClick(t,e,r){return uZ(r,"click")},handleDOMEvents:{contextmenu(t,e){return uZ(e,"contextmenu")}}}});function uZ(t,e){const r=t.target;if(!r)return!1;if(r.closest(".edgeever-image-size-controls")||r.closest(".edgeever-image-actions")||r.closest(".edgeever-image-size-button"))return!0;const n=r.closest("a");if(n instanceof HTMLAnchorElement){const a=n.getAttribute("href")||"";if(WA(a)||d0(a)){const s=xet(a,n.textContent||"");if(s)return t.preventDefault(),t.stopPropagation(),dl({type:"resourcePress",targetJson:s}),!0}}const i=r.closest("img");if(i instanceof HTMLImageElement){if(i.closest("figure.edgeever-image-node")&&e==="click")return!1;const a=i.dataset.originalSrc||i.getAttribute("src")||"",s=i.dataset.originalSrc||(WA(a)||d0(a)?a:"");if(!s&&!d0(a))return Ha==="viewer"&&e==="click"&&a?(t.preventDefault(),dl({type:"imagePreview",source:a,alt:i.getAttribute("alt")||""}),!0):!1;const o=s||a,l=i.getAttribute("alt")||"image";if(e==="contextmenu"){const u=$V(o,l);if(u)return t.preventDefault(),t.stopPropagation(),dl({type:"resourcePress",targetJson:u}),!0}if(Ha==="viewer"&&e==="click")return t.preventDefault(),t.stopPropagation(),dl({type:"imagePreview",source:o,alt:l}),!0}return!1}(()=>{let t=null,e=null;const r=()=>{t&&clearTimeout(t),t=null,e=null};Ul.addEventListener("touchstart",n=>{var a;const i=(a=n.target)==null?void 0:a.closest("img");i instanceof HTMLImageElement&&(e=i,t=setTimeout(()=>{if(!e)return;const s=e.dataset.originalSrc||e.getAttribute("src")||"",o=$V(s,e.getAttribute("alt")||"image");o&&dl({type:"resourcePress",targetJson:o}),r()},480))},{passive:!0}),Ul.addEventListener("touchend",r,{passive:!0}),Ul.addEventListener("touchmove",r,{passive:!0}),Ul.addEventListener("touchcancel",r,{passive:!0})})();function kp(t){var e,r;try{const n=JSON.stringify(t.getJSON()),a=((r=(e=t.storage.markdown)==null?void 0:e.getMarkdown)==null?void 0:r.call(e))??t.getText({blockSeparator:` + */const cZ="\x3C!-- edgeever:merge-divider -->",Tet=/^\x3C!--\s*edgeever:merge-divider\s*-->\s*(?:\n+---[ \t]*(?:\n+|$)|(?:\n+|$))/,wet=ua.create({name:"edgeeverMergeDivider",group:"block",atom:!0,selectable:!0,draggable:!0,parseHTML(){return[{tag:"hr[data-edgeever-merge-divider]"}]},renderHTML({HTMLAttributes:t}){return["hr",On(t,{"data-edgeever-merge-divider":"true",class:"edgeever-merge-divider"})]},renderMarkdown(){return`${cZ} -`});dl({type:"change",contentMarkdown:a,contentJson:n})}catch(n){dl({type:"error",message:n instanceof Error?n.message:String(n)})}}function J0e(t){if(rI.classList.toggle("editor-mode",t),rI.innerHTML="",!t)return;const e=[{id:"bold",label:"B",run:()=>Xr.chain().focus().toggleBold().run()},{id:"bullet",label:"•",run:()=>Xr.chain().focus().toggleBulletList().run()},{id:"quote",label:"❝",run:()=>Xr.chain().focus().toggleBlockquote().run()},{id:"hr",label:"—",run:()=>Xr.chain().focus().setHorizontalRule().run()},{id:"h2",label:"H2",run:()=>Xr.chain().focus().toggleHeading({level:2}).run()},{id:"code",label:"",run:()=>Xr.chain().focus().toggleCodeBlock().run()}];for(const r of e){const n=document.createElement("button");n.type="button",n.textContent=r.label,n.dataset.action=r.id,n.addEventListener("click",()=>{r.run(),kp(Xr)}),rI.appendChild(n)}}async function hZ(t="light"){await Cet(Ul),Ha==="viewer"&&await ket(Ul,t)}const Ret={configure(t){const e=t.mode==="editor"?"editor":"viewer",r=e!==Ha;Ha=e,Xr.setEditable(Ha==="editor"),J0e(Ha==="editor"),document.documentElement.dataset.theme=t.theme||"light",document.body.classList.toggle("viewer-mode",Ha==="viewer"),document.body.classList.toggle("editor-mode",Ha==="editor"),t.placeholder&&Ul.setAttribute("data-placeholder",t.placeholder),Ha==="editor"&&r&&requestAnimationFrame(()=>{try{Xr.commands.focus("end")}catch{}})},setMarkdown(t){var e;KT=!0;try{Xr.commands.setContent(t||"",{contentType:"markdown"})}catch{try{const r=(e=Xr.storage.markdown)==null?void 0:e.manager;if(r)Xr.commands.setContent(r.parse(t||""));else throw new Error("no markdown manager")}catch{Xr.commands.setContent({type:"doc",content:[{type:"paragraph",content:t?[{type:"text",text:t}]:[]}]})}}Xr.setEditable(Ha==="editor"),KT=!1,hZ(document.documentElement.dataset.theme||"light")},setDocumentFromJSON(t){KT=!0;try{const e=JSON.parse(t);Xr.commands.setContent(e)}catch{Xr.commands.setContent({type:"doc",content:[{type:"paragraph"}]})}Xr.setEditable(Ha==="editor"),KT=!1,hZ(document.documentElement.dataset.theme||"light")},resolveResource(t,e){const r=GA.get(t);r&&(GA.delete(t),r(e))},getMarkdown(){var e,r;return((r=(e=Xr.storage.markdown)==null?void 0:e.getMarkdown)==null?void 0:r.call(e))??Xr.getText({blockSeparator:` +---`},parseMarkdown(t,e){return e.createNode("edgeeverMergeDivider")},markdownTokenizer:{name:"edgeeverMergeDivider",level:"block",start(t){return t.indexOf(cZ)},tokenize(t){const e=Tet.exec(t);if(e)return{type:"edgeeverMergeDivider",raw:e[0],text:""}}}});function d0(t){try{const n=new URL(t,"http://edgeever.local").pathname.match(/^\/api\/v1\/resources\/([^/]+)(?:\/blob)?\/?$/);if(n!=null&&n[1])return decodeURIComponent(n[1])}catch{}const e=t.match(/\/api\/v1\/resources\/([^/?#]+)/);return e!=null&&e[1]&&e[1]!=="blob"?decodeURIComponent(e[1]):null}function OV(t,e){return/\/blob(?:$|[?#])/.test(t)||t.includes(`/resources/${e}/blob`)?t:t.startsWith("/api/v1/resources/")||t.includes("/api/v1/resources/")?`/api/v1/resources/${encodeURIComponent(e)}/blob`:t}function $V(t,e){const r=d0(t);return r?JSON.stringify({kind:"image",href:OV(t,r),filename:e.trim()||`image-${r}`,resourceId:r}):null}function Cet(t,e){const r=d0(t);if(!r)return null;const n=e.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()||r;return JSON.stringify({kind:"attachment",href:OV(t,r),filename:n,resourceId:r})}const ket=performance.now();let Ha="viewer",KT=!1;const GA=new Map;let Eet=0;function dl(t){var e,r,n;try{(n=(r=(e=window.webkit)==null?void 0:e.messageHandlers)==null?void 0:r.edgeever)==null||n.postMessage(t)}catch{}}function WA(t){return t.startsWith("/api/")||t.includes("/api/v1/resources/")}function Z0e(t){return!t||t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("edgeever-res:")?!1:!!(WA(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/"))}function Q0e(t){return new Promise(e=>{const r=`r${++Eet}`;GA.set(r,e),dl({type:"loadResource",requestId:r,source:t}),setTimeout(()=>{GA.delete(r)&&e(null)},3e4)})}async function Aet(t){const e=Array.from(t.querySelectorAll("img[src]"));await Promise.all(e.map(async r=>{const n=r.getAttribute("src")||"";if(Z0e(n)&&(r.dataset.originalSrc||(r.dataset.originalSrc=n),r.dataset.hydrating!=="1")){r.dataset.hydrating="1";try{const i=await Q0e(n);i&&r.setAttribute("src",i)}finally{delete r.dataset.hydrating}}}))}async function _et(t,e){const r=Array.from(t.querySelectorAll("pre code.language-mermaid, pre code[class*='mermaid']")),n=Array.from(t.querySelectorAll("pre")).filter(s=>{const o=s.textContent||"";return s.querySelector("code")&&/^(graph|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|mindmap|flowchart)/m.test(o.trim())}),i=new Set([...r.map(s=>s.parentElement).filter(Boolean),...n]);lZ.initialize({startOnLoad:!1,securityLevel:"strict",theme:e==="dark"?"dark":"default"});let a=0;for(const s of i){const o=(s.textContent||"").trim();if(o)try{const l=`mmd-${Date.now()}-${a++}`,{svg:u}=await lZ.render(l,o),h=document.createElement("div");h.className="edgeever-mermaid",h.innerHTML=u,s.replaceWith(h)}catch{}}}const Ret=[{label:"25%",width:25},{label:"50%",width:50},{label:"75%",width:75},{label:"100%",width:100}];function td(t){if(t==null||t==="")return null;const e=typeof t=="number"?t:Number.parseFloat(String(t).replace("%",""));return Number.isFinite(e)?Math.min(100,Math.max(10,Math.round(e))):null}function J0e(t){return Math.min(100,Math.max(10,Math.round(t)))}function ME(t,e){const r=e==null?null:J0e(e);if(r==null){t.style.removeProperty("width"),t.style.removeProperty("max-width"),t.style.removeProperty("--ee-image-width"),delete t.dataset.width,t.classList.remove("has-width");return}const n=`${r}%`;t.dataset.width=String(r),t.classList.add("has-width"),t.style.setProperty("--ee-image-width",n),t.style.setProperty("width",n),t.style.setProperty("max-width",n),t.style.setProperty("margin-left","auto"),t.style.setProperty("margin-right","auto"),t.style.setProperty("box-sizing","border-box"),t.style.setProperty("display","block")}function uZ(t,e){let r=0;const n=a=>{a.preventDefault(),a.stopPropagation(),typeof a.stopImmediatePropagation=="function"&&a.stopImmediatePropagation()},i=a=>{n(a);const s=Date.now();s-r<350||(r=s,e())};t.addEventListener("pointerdown",n),t.addEventListener("mousedown",n),t.addEventListener("touchstart",n,{passive:!1}),t.addEventListener("pointerup",i),t.addEventListener("click",i)}function Let(){return W$e.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>td(e.getAttribute("data-width")??e.getAttribute("width")??e.style.width),renderHTML:e=>{const r=td(e.width);return r?{"data-width":String(r),style:`width: ${r}%`}:{}}}}},addNodeView(){return({editor:t,getPos:e,node:r})=>{let n=r;const i=document.createElement("figure");i.className="edgeever-image-node is-loading",i.contentEditable="false",i.setAttribute("role","img");const a=document.createElement("div");a.className="edgeever-image-loading";const s=document.createElement("span");s.className="edgeever-image-upload-spinner",a.append(s);const o=document.createElement("img");o.draggable=!1,o.hidden=!0;const l=document.createElement("button");l.type="button",l.className="edgeever-image-actions",l.contentEditable="false",l.hidden=!0,l.setAttribute("aria-label","图片操作"),l.textContent="⋯";const u=document.createElement("div");u.className="edgeever-image-size-controls",u.contentEditable="false",u.hidden=!0,u.setAttribute("role","group"),u.setAttribute("aria-label","图片宽度");const h=E=>{const _=e();if(typeof _!="number")return;const M=t.state.doc.nodeAt(_);if(!M||M.type.name!=="image")return;const L=J0e(E);let P=t.state.tr.setNodeMarkup(_,void 0,{...M.attrs,width:L});try{P=P.setSelection(lr.create(P.doc,_))}catch{}t.view.dispatch(P),ME(i,L),f(L)},d=[];for(const E of Ret){const _=document.createElement("button");_.type="button",_.className="edgeever-image-size-button",_.textContent=E.label,_.setAttribute("aria-label",E.label),_.setAttribute("aria-pressed","false"),uZ(_,()=>h(E.width)),d.push({button:_,width:E.width}),u.append(_)}const f=E=>{for(const _ of d){const M=E!=null&&_.width===E;_.button.classList.toggle("is-active",M),_.button.setAttribute("aria-pressed",String(M))}},p=E=>{if(i.classList.toggle("is-loading",E==="loading"),i.classList.toggle("is-failed",E==="failed"),a.hidden=E==="ready",o.hidden=E!=="ready",l.hidden=E!=="ready",E==="failed"){a.replaceChildren();const _=document.createElement("span");_.className="edgeever-image-loading-label",_.textContent="图片加载失败",a.append(_),a.hidden=!1}else E==="loading"&&a.replaceChildren(s)},g=E=>{const _=String(E.src??"");return WA(_)||d0(_)?_:i.dataset.resourceHref||_},m=()=>{const E=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs),_=$V(E,String(n.attrs.alt??"image"));if(_){dl({type:"resourcePress",targetJson:_});return}dl({type:"log",message:`image actions: no resource id for href=${E.slice(0,120)}`})},y=()=>{const E=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs)||o.getAttribute("src")||"";E&&dl({type:"imagePreview",source:E,alt:String(n.attrs.alt??"")})};uZ(l,m);let v=0;const T=E=>{if(E.target instanceof Element&&E.target.closest(".edgeever-image-actions"))return;const _=Date.now();if(_-v<350)return;if(v=_,E.stopPropagation(),Ha==="viewer"||!t.isEditable){E.preventDefault(),y();return}E.preventDefault();const M=e();typeof M=="number"&&t.chain().setNodeSelection(M).run()};o.addEventListener("pointerdown",E=>E.stopPropagation()),o.addEventListener("click",T),o.addEventListener("pointerup",E=>{(E.pointerType==="touch"||E.pointerType==="pen")&&T(E)}),i.append(a,o,l,u);let b=0,w="",C=!1;const S=E=>{const _=String(E.alt??"");o.alt=_;const M=td(E.width);ME(i,M),f(M);const L=String(E.src??""),P=d0(L);P&&(i.dataset.resourceHref=OV(L,P),o.dataset.originalSrc=i.dataset.resourceHref)},k=E=>{b+=1;const _=b,M=String(E.src??"");w=M,S(E),p("loading"),u.hidden=!0;const L=P=>{_===b&&(o.onload=()=>{_===b&&(p("ready"),o.style.cursor=Ha==="viewer"||!t.isEditable?"zoom-in":"pointer",C&&t.isEditable&&Ha==="editor"&&(u.hidden=!1))},o.onerror=()=>{_===b&&p("failed")},o.src=P)};if(!M){p("failed");return}if(M.startsWith("data:")||M.startsWith("edgeever-res:")||M.startsWith("blob:")){L(M);return}if(Z0e(M)){Q0e(M).then(P=>{_===b&&(P?L(P):p("failed"))});return}L(M)};return k(r.attrs),{dom:i,update:E=>{if(E.type.name!=="image")return!1;n=E;const _=String(E.attrs.src??"");return S(E.attrs),_!==w?k(E.attrs):(f(td(E.attrs.width)),ME(i,td(E.attrs.width))),!0},selectNode:()=>{var _,M;C=!0,i.classList.add("is-selected");const E=td((M=(_=t.state.selection.node)==null?void 0:_.attrs)==null?void 0:M.width)??td(i.dataset.width)??td(n.attrs.width);ME(i,E),t.isEditable&&Ha==="editor"&&!o.hidden&&(u.hidden=!1,f(E))},deselectNode:()=>{C=!1,i.classList.remove("is-selected"),u.hidden=!0},destroy:()=>{b+=1}}}}}).configure({inline:!1,allowBase64:!0})}function Met(t){return[z$e.configure({codeBlock:!1}),wet,LDe.configure({languageClassPrefix:"language-"}),Let(),n9e.configure({table:{resizable:!1}}),H$e.configure({placeholder:t}),nBe.configure({markedOptions:{gfm:!0}})]}const Ul=document.getElementById("editor"),rI=document.getElementById("toolbar"),Xr=new pDe({element:Ul,extensions:Met("开始书写…"),editable:!1,content:{type:"doc",content:[{type:"paragraph"}]},onUpdate:({editor:t})=>{KT||Ha!=="editor"||kp(t)},editorProps:{attributes:{class:"edgeever-prose",spellcheck:"true"},handleClick(t,e,r){return hZ(r,"click")},handleDOMEvents:{contextmenu(t,e){return hZ(e,"contextmenu")}}}});function hZ(t,e){const r=t.target;if(!r)return!1;if(r.closest(".edgeever-image-size-controls")||r.closest(".edgeever-image-actions")||r.closest(".edgeever-image-size-button"))return!0;const n=r.closest("a");if(n instanceof HTMLAnchorElement){const a=n.getAttribute("href")||"";if(WA(a)||d0(a)){const s=Cet(a,n.textContent||"");if(s)return t.preventDefault(),t.stopPropagation(),dl({type:"resourcePress",targetJson:s}),!0}}const i=r.closest("img");if(i instanceof HTMLImageElement){if(i.closest("figure.edgeever-image-node")&&e==="click")return!1;const a=i.dataset.originalSrc||i.getAttribute("src")||"",s=i.dataset.originalSrc||(WA(a)||d0(a)?a:"");if(!s&&!d0(a))return Ha==="viewer"&&e==="click"&&a?(t.preventDefault(),dl({type:"imagePreview",source:a,alt:i.getAttribute("alt")||""}),!0):!1;const o=s||a,l=i.getAttribute("alt")||"image";if(e==="contextmenu"){const u=$V(o,l);if(u)return t.preventDefault(),t.stopPropagation(),dl({type:"resourcePress",targetJson:u}),!0}if(Ha==="viewer"&&e==="click")return t.preventDefault(),t.stopPropagation(),dl({type:"imagePreview",source:o,alt:l}),!0}return!1}(()=>{let t=null,e=null;const r=()=>{t&&clearTimeout(t),t=null,e=null};Ul.addEventListener("touchstart",n=>{var a;const i=(a=n.target)==null?void 0:a.closest("img");i instanceof HTMLImageElement&&(e=i,t=setTimeout(()=>{if(!e)return;const s=e.dataset.originalSrc||e.getAttribute("src")||"",o=$V(s,e.getAttribute("alt")||"image");o&&dl({type:"resourcePress",targetJson:o}),r()},480))},{passive:!0}),Ul.addEventListener("touchend",r,{passive:!0}),Ul.addEventListener("touchmove",r,{passive:!0}),Ul.addEventListener("touchcancel",r,{passive:!0})})();function kp(t){var e,r;try{const n=JSON.stringify(t.getJSON()),a=((r=(e=t.storage.markdown)==null?void 0:e.getMarkdown)==null?void 0:r.call(e))??t.getText({blockSeparator:` -`})},getDocument(){return JSON.stringify(Xr.getJSON())},focusEnd(){var t;try{Xr.commands.focus("end")}catch{}try{const e=(t=Xr.view)==null?void 0:t.dom;e&&typeof e.focus=="function"&&e.focus({preventScroll:!0})}catch{}},flush(){kp(Xr)},exec(t){var r;const e={bold:()=>Xr.chain().focus().toggleBold().run(),bulletList:()=>Xr.chain().focus().toggleBulletList().run(),blockquote:()=>Xr.chain().focus().toggleBlockquote().run(),horizontalRule:()=>Xr.chain().focus().setHorizontalRule().run(),heading2:()=>Xr.chain().focus().toggleHeading({level:2}).run(),codeBlock:()=>Xr.chain().focus().toggleCodeBlock().run()};(r=e[t])==null||r.call(e),kp(Xr)},beginImageUpload(t,e){Xr.chain().focus().setImage({src:e,alt:t}).run();const r=Ul.querySelectorAll("img"),n=r[r.length-1];n&&(n.dataset.uploadId=t),kp(Xr)},completeImageUpload(t,e,r){Xr.chain().focus().setImage({src:e,alt:r||t||""}).run();const n=Ul.querySelectorAll("img"),i=n[n.length-1];i&&(i.dataset.originalSrc=e,delete i.dataset.uploadId),kp(Xr)},cancelImageUpload(t){const e=Ul.querySelector(`img[data-upload-id="${t}"]`);e==null||e.remove(),kp(Xr)}};window.EdgeEverEditor=Ret;J0e(!1);dl({type:"ready",startupMs:Math.round(performance.now()-Tet)});class _t extends Error{constructor(e,r){var n="KaTeX parse error: "+e,i,a,s=r&&r.loc;if(s&&s.start<=s.end){var o=s.lexer.input;i=s.start,a=s.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,a).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;a+15t.replace(Let,"-$1").toLowerCase(),Iet={"&":"&",">":">","<":"<",'"':""","'":"'"},Net=/[&><"']/g,fs=t=>String(t).replace(Net,e=>Iet[e]),t3=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?t3(t.body[0]):t:t.type==="font"?t3(t.body):t,Det=new Set(["mathord","textord","atom"]),Ph=t=>Det.has(t3(t).type),Oet=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},HA={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function $et(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function Pet(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return $et(e)}function Bet(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:Pet(n)}class PV{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r of Object.keys(HA)){var n=HA[r];n&&Bet(this,r,e,n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new _t("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var r=Oet(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class rd{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return Oc[Fet[this.id]]}sub(){return Oc[zet[this.id]]}fracNum(){return Oc[Vet[this.id]]}fracDen(){return Oc[Get[this.id]]}cramp(){return Oc[Wet[this.id]]}text(){return Oc[Het[this.id]]}isTight(){return this.size>=2}}var BV=0,qA=1,py=2,hh=3,WC=4,fl=5,Nb=6,Ps=7,Oc=[new rd(BV,0,!1),new rd(qA,0,!0),new rd(py,1,!1),new rd(hh,1,!0),new rd(WC,2,!1),new rd(fl,2,!0),new rd(Nb,3,!1),new rd(Ps,3,!0)],Fet=[WC,fl,WC,fl,Nb,Ps,Nb,Ps],zet=[fl,fl,fl,fl,Ps,Ps,Ps,Ps],Vet=[py,hh,WC,fl,Nb,Ps,Nb,Ps],Get=[hh,hh,fl,fl,Ps,Ps,Ps,Ps],Wet=[qA,qA,hh,hh,fl,fl,Ps,Ps],Het=[BV,qA,py,hh,py,hh,py,hh],Ir={DISPLAY:Oc[BV],TEXT:Oc[py],SCRIPT:Oc[WC],SCRIPTSCRIPT:Oc[Nb]},XO=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function qet(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var r3=[];XO.forEach(t=>t.blocks.forEach(e=>r3.push(...e)));function ege(t){for(var e=0;e=r3[e]&&t<=r3[e+1])return!0;return!1}var ta=t=>t+" "+t,Yg=80,Uet=function(e,r){return"M95,"+(622+e+r)+` +`});dl({type:"change",contentMarkdown:a,contentJson:n})}catch(n){dl({type:"error",message:n instanceof Error?n.message:String(n)})}}function ege(t){if(rI.classList.toggle("editor-mode",t),rI.innerHTML="",!t)return;const e=[{id:"bold",label:"B",run:()=>Xr.chain().focus().toggleBold().run()},{id:"bullet",label:"•",run:()=>Xr.chain().focus().toggleBulletList().run()},{id:"quote",label:"❝",run:()=>Xr.chain().focus().toggleBlockquote().run()},{id:"hr",label:"—",run:()=>Xr.chain().focus().setHorizontalRule().run()},{id:"h2",label:"H2",run:()=>Xr.chain().focus().toggleHeading({level:2}).run()},{id:"code",label:"",run:()=>Xr.chain().focus().toggleCodeBlock().run()}];for(const r of e){const n=document.createElement("button");n.type="button",n.textContent=r.label,n.dataset.action=r.id,n.addEventListener("click",()=>{r.run(),kp(Xr)}),rI.appendChild(n)}}async function dZ(t="light"){await Aet(Ul),Ha==="viewer"&&await _et(Ul,t)}const Iet={configure(t){const e=t.mode==="editor"?"editor":"viewer",r=e!==Ha;Ha=e,Xr.setEditable(Ha==="editor"),ege(Ha==="editor"),document.documentElement.dataset.theme=t.theme||"light",document.body.classList.toggle("viewer-mode",Ha==="viewer"),document.body.classList.toggle("editor-mode",Ha==="editor"),t.placeholder&&Ul.setAttribute("data-placeholder",t.placeholder),Ha==="editor"&&r&&requestAnimationFrame(()=>{try{Xr.commands.focus("end")}catch{}})},setMarkdown(t){var e;KT=!0;try{Xr.commands.setContent(t||"",{contentType:"markdown"})}catch{try{const r=(e=Xr.storage.markdown)==null?void 0:e.manager;if(r)Xr.commands.setContent(r.parse(t||""));else throw new Error("no markdown manager")}catch{Xr.commands.setContent({type:"doc",content:[{type:"paragraph",content:t?[{type:"text",text:t}]:[]}]})}}Xr.setEditable(Ha==="editor"),KT=!1,dZ(document.documentElement.dataset.theme||"light")},setDocumentFromJSON(t){KT=!0;try{const e=JSON.parse(t);Xr.commands.setContent(e)}catch{Xr.commands.setContent({type:"doc",content:[{type:"paragraph"}]})}Xr.setEditable(Ha==="editor"),KT=!1,dZ(document.documentElement.dataset.theme||"light")},resolveResource(t,e){const r=GA.get(t);r&&(GA.delete(t),r(e))},getMarkdown(){var e,r;return((r=(e=Xr.storage.markdown)==null?void 0:e.getMarkdown)==null?void 0:r.call(e))??Xr.getText({blockSeparator:` + +`})},getDocument(){return JSON.stringify(Xr.getJSON())},focusEnd(){var t;try{Xr.commands.focus("end")}catch{}try{const e=(t=Xr.view)==null?void 0:t.dom;e&&typeof e.focus=="function"&&e.focus({preventScroll:!0})}catch{}},flush(){kp(Xr)},exec(t){var r;const e={bold:()=>Xr.chain().focus().toggleBold().run(),bulletList:()=>Xr.chain().focus().toggleBulletList().run(),blockquote:()=>Xr.chain().focus().toggleBlockquote().run(),horizontalRule:()=>Xr.chain().focus().setHorizontalRule().run(),heading2:()=>Xr.chain().focus().toggleHeading({level:2}).run(),codeBlock:()=>Xr.chain().focus().toggleCodeBlock().run()};(r=e[t])==null||r.call(e),kp(Xr)},beginImageUpload(t,e){Xr.chain().focus().setImage({src:e,alt:t}).run();const r=Ul.querySelectorAll("img"),n=r[r.length-1];n&&(n.dataset.uploadId=t),kp(Xr)},completeImageUpload(t,e,r){Xr.chain().focus().setImage({src:e,alt:r||t||""}).run();const n=Ul.querySelectorAll("img"),i=n[n.length-1];i&&(i.dataset.originalSrc=e,delete i.dataset.uploadId),kp(Xr)},cancelImageUpload(t){const e=Ul.querySelector(`img[data-upload-id="${t}"]`);e==null||e.remove(),kp(Xr)}};window.EdgeEverEditor=Iet;ege(!1);dl({type:"ready",startupMs:Math.round(performance.now()-ket)});class _t extends Error{constructor(e,r){var n="KaTeX parse error: "+e,i,a,s=r&&r.loc;if(s&&s.start<=s.end){var o=s.lexer.input;i=s.start,a=s.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,a).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;a+15t.replace(Net,"-$1").toLowerCase(),Oet={"&":"&",">":">","<":"<",'"':""","'":"'"},$et=/[&><"']/g,fs=t=>String(t).replace($et,e=>Oet[e]),t3=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?t3(t.body[0]):t:t.type==="font"?t3(t.body):t,Pet=new Set(["mathord","textord","atom"]),Ph=t=>Pet.has(t3(t).type),Bet=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},HA={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function Fet(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function zet(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return Fet(e)}function Vet(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:zet(n)}class PV{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r of Object.keys(HA)){var n=HA[r];n&&Vet(this,r,e,n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new _t("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var r=Bet(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class rd{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return Oc[Get[this.id]]}sub(){return Oc[Wet[this.id]]}fracNum(){return Oc[Het[this.id]]}fracDen(){return Oc[qet[this.id]]}cramp(){return Oc[Uet[this.id]]}text(){return Oc[Yet[this.id]]}isTight(){return this.size>=2}}var BV=0,qA=1,py=2,hh=3,WC=4,fl=5,Nb=6,Ps=7,Oc=[new rd(BV,0,!1),new rd(qA,0,!0),new rd(py,1,!1),new rd(hh,1,!0),new rd(WC,2,!1),new rd(fl,2,!0),new rd(Nb,3,!1),new rd(Ps,3,!0)],Get=[WC,fl,WC,fl,Nb,Ps,Nb,Ps],Wet=[fl,fl,fl,fl,Ps,Ps,Ps,Ps],Het=[py,hh,WC,fl,Nb,Ps,Nb,Ps],qet=[hh,hh,fl,fl,Ps,Ps,Ps,Ps],Uet=[qA,qA,hh,hh,fl,fl,Ps,Ps],Yet=[BV,qA,py,hh,py,hh,py,hh],Ir={DISPLAY:Oc[BV],TEXT:Oc[py],SCRIPT:Oc[WC],SCRIPTSCRIPT:Oc[Nb]},XO=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function Xet(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var r3=[];XO.forEach(t=>t.blocks.forEach(e=>r3.push(...e)));function tge(t){for(var e=0;e=r3[e]&&t<=r3[e+1])return!0;return!1}var ta=t=>t+" "+t,Yg=80,jet=function(e,r){return"M95,"+(622+e+r)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 @@ -546,7 +548,7 @@ c5.3,-9.3,12,-14,20,-14 H400000v`+(40+e)+`H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},Yet=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119 +M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},Ket=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119 c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 c340,-704.7,510.7,-1060.3,512,-1067 l`+e/2.084+" -"+e+` @@ -556,7 +558,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5, c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},Xet=function(e,r){return"M983 "+(10+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},Zet=function(e,r){return"M983 "+(10+e+r)+` l`+e/3.13+" -"+e+` c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 @@ -565,7 +567,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},jet=function(e,r){return"M424,"+(2398+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},Qet=function(e,r){return"M424,"+(2398+e+r)+` c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 @@ -575,18 +577,18 @@ v`+(40+e)+`H1014.6 s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+r+` -h400000v`+(40+e)+"h-400000z"},Ket=function(e,r){return"M473,"+(2713+e+r)+` +h400000v`+(40+e)+"h-400000z"},Jet=function(e,r){return"M473,"+(2713+e+r)+` c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+` c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},Zet=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},Qet=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+` +606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},ett=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},ttt=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+` H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},Jet=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=Uet(r,Yg);break;case"sqrtSize1":i=Yet(r,Yg);break;case"sqrtSize2":i=Xet(r,Yg);break;case"sqrtSize3":i=jet(r,Yg);break;case"sqrtSize4":i=Ket(r,Yg);break;case"sqrtTall":i=Qet(r,Yg,n)}return i},ett=function(e,r){switch(e){case"⎜":return ta("M291 0 H417 V"+r+" H291z");case"∣":return ta("M145 0 H188 V"+r+" H145z");case"∥":return ta("M145 0 H188 V"+r+" H145z")+ta("M367 0 H410 V"+r+" H367z");case"⎟":return ta("M457 0 H583 V"+r+" H457z");case"⎢":return ta("M319 0 H403 V"+r+" H319z");case"⎥":return ta("M263 0 H347 V"+r+" H263z");case"⎪":return ta("M384 0 H504 V"+r+" H384z");case"⏐":return ta("M312 0 H355 V"+r+" H312z");case"‖":return ta("M257 0 H300 V"+r+" H257z")+ta("M478 0 H521 V"+r+" H478z");default:return""}},dZ={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},rtt=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=jet(r,Yg);break;case"sqrtSize1":i=Ket(r,Yg);break;case"sqrtSize2":i=Zet(r,Yg);break;case"sqrtSize3":i=Qet(r,Yg);break;case"sqrtSize4":i=Jet(r,Yg);break;case"sqrtTall":i=ttt(r,Yg,n)}return i},ntt=function(e,r){switch(e){case"⎜":return ta("M291 0 H417 V"+r+" H291z");case"∣":return ta("M145 0 H188 V"+r+" H145z");case"∥":return ta("M145 0 H188 V"+r+" H145z")+ta("M367 0 H410 V"+r+" H367z");case"⎟":return ta("M457 0 H583 V"+r+" H457z");case"⎢":return ta("M319 0 H403 V"+r+" H319z");case"⎥":return ta("M263 0 H347 V"+r+" H263z");case"⎪":return ta("M384 0 H504 V"+r+" H384z");case"⏐":return ta("M312 0 H355 V"+r+" H312z");case"‖":return ta("M257 0 H300 V"+r+" H257z")+ta("M478 0 H521 V"+r+" H478z");default:return""}},fZ={doubleleftarrow:`M262 157 l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 @@ -757,7 +759,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z` c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},ttt=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 v84 h347 v-84 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},itt=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 v84 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+r+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 @@ -785,48 +787,48 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function rtt(t){return"toText"in t}class wx{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(rtt(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var jO={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},ntt={ex:!0,em:!0,mu:!0},tge=function(e){return typeof e!="string"&&(e=e.unit),e in jO||e in ntt||e==="ex"},fi=function(e,r){var n;if(e.unit in jO)n=jO[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new _t("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},Mt=function(e){return+e.toFixed(4)+"em"},nf=function(e){return e.filter(r=>r).join(" ")},FV=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=Met(n)+":"+i+";")}return r},rge=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},nge=function(e){var r=document.createElement(e);r.className=nf(this.classes),Object.assign(r.style,this.style);for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i/=\x00-\x1f]/,ige=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+fs(nf(this.classes))+'"');var n=FV(this.style);n&&(r+=' style="'+fs(n)+'"');for(var i of Object.keys(this.attributes)){if(itt.test(i))throw new _t("Invalid attribute name '"+i+"'");r+=" "+i+'="'+fs(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class Cx{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,rge.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return nge.call(this,"span")}toMarkup(){return ige.call(this,"span")}}let SR=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,rge.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return nge.call(this,"a")}toMarkup(){return ige.call(this,"a")}};class att{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e=''+fs(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Mt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=nf(this.classes)),Object.keys(this.style).length>0&&(r=r||document.createElement("span"),Object.assign(r.style,this.style)),r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+Mt(this.italic)+";"),n+=FV(this.style),n&&(e=!0,r+=' style="'+fs(n)+'"');var i=fs(this.text);return e?(r+=">",r+=i,r+="",r):i}}class xh{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}}class KO{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var ctt=t=>t instanceof Cx||t instanceof SR||t instanceof wx,Bc={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},IE={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},fZ={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function age(t,e){Bc[t]=e}function zV(t,e,r){if(!Bc[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=Bc[e][n];if(!i&&t[0]in fZ&&(n=fZ[t[0]].charCodeAt(0),i=Bc[e][n]),!i&&r==="text"&&ege(n)&&(i=Bc[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var nI={};function utt(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!nI[e]){var r=nI[e]={cssEmPerMu:IE.quad[e]/18};for(var n in IE)IE.hasOwnProperty(n)&&(r[n]=IE[n][e])}return nI[e]}var li={math:{},text:{}};function U(t,e,r,n,i,a){li[t][i]={font:e,group:r,replace:n},a&&n&&(li[t][n]=li[t][i])}var re="math",Tt="text",ye="main",ze="ams",ui="accent-token",Vt="bin",Qs="close",kx="inner",hr="mathord",Qi="op-token",qo="open",iS="punct",We="rel",Bh="spacing",qe="textord";U(re,ye,We,"≡","\\equiv",!0);U(re,ye,We,"≺","\\prec",!0);U(re,ye,We,"≻","\\succ",!0);U(re,ye,We,"∼","\\sim",!0);U(re,ye,We,"⊥","\\perp");U(re,ye,We,"⪯","\\preceq",!0);U(re,ye,We,"⪰","\\succeq",!0);U(re,ye,We,"≃","\\simeq",!0);U(re,ye,We,"∣","\\mid",!0);U(re,ye,We,"≪","\\ll",!0);U(re,ye,We,"≫","\\gg",!0);U(re,ye,We,"≍","\\asymp",!0);U(re,ye,We,"∥","\\parallel");U(re,ye,We,"⋈","\\bowtie",!0);U(re,ye,We,"⌣","\\smile",!0);U(re,ye,We,"⊑","\\sqsubseteq",!0);U(re,ye,We,"⊒","\\sqsupseteq",!0);U(re,ye,We,"≐","\\doteq",!0);U(re,ye,We,"⌢","\\frown",!0);U(re,ye,We,"∋","\\ni",!0);U(re,ye,We,"∝","\\propto",!0);U(re,ye,We,"⊢","\\vdash",!0);U(re,ye,We,"⊣","\\dashv",!0);U(re,ye,We,"∋","\\owns");U(re,ye,iS,".","\\ldotp");U(re,ye,iS,"⋅","\\cdotp");U(re,ye,iS,"⋅","·");U(Tt,ye,qe,"⋅","·");U(re,ye,qe,"#","\\#");U(Tt,ye,qe,"#","\\#");U(re,ye,qe,"&","\\&");U(Tt,ye,qe,"&","\\&");U(re,ye,qe,"ℵ","\\aleph",!0);U(re,ye,qe,"∀","\\forall",!0);U(re,ye,qe,"ℏ","\\hbar",!0);U(re,ye,qe,"∃","\\exists",!0);U(re,ye,qe,"∇","\\nabla",!0);U(re,ye,qe,"♭","\\flat",!0);U(re,ye,qe,"ℓ","\\ell",!0);U(re,ye,qe,"♮","\\natural",!0);U(re,ye,qe,"♣","\\clubsuit",!0);U(re,ye,qe,"℘","\\wp",!0);U(re,ye,qe,"♯","\\sharp",!0);U(re,ye,qe,"♢","\\diamondsuit",!0);U(re,ye,qe,"ℜ","\\Re",!0);U(re,ye,qe,"♡","\\heartsuit",!0);U(re,ye,qe,"ℑ","\\Im",!0);U(re,ye,qe,"♠","\\spadesuit",!0);U(re,ye,qe,"§","\\S",!0);U(Tt,ye,qe,"§","\\S");U(re,ye,qe,"¶","\\P",!0);U(Tt,ye,qe,"¶","\\P");U(re,ye,qe,"†","\\dag");U(Tt,ye,qe,"†","\\dag");U(Tt,ye,qe,"†","\\textdagger");U(re,ye,qe,"‡","\\ddag");U(Tt,ye,qe,"‡","\\ddag");U(Tt,ye,qe,"‡","\\textdaggerdbl");U(re,ye,Qs,"⎱","\\rmoustache",!0);U(re,ye,qo,"⎰","\\lmoustache",!0);U(re,ye,Qs,"⟯","\\rgroup",!0);U(re,ye,qo,"⟮","\\lgroup",!0);U(re,ye,Vt,"∓","\\mp",!0);U(re,ye,Vt,"⊖","\\ominus",!0);U(re,ye,Vt,"⊎","\\uplus",!0);U(re,ye,Vt,"⊓","\\sqcap",!0);U(re,ye,Vt,"∗","\\ast");U(re,ye,Vt,"⊔","\\sqcup",!0);U(re,ye,Vt,"◯","\\bigcirc",!0);U(re,ye,Vt,"∙","\\bullet",!0);U(re,ye,Vt,"‡","\\ddagger");U(re,ye,Vt,"≀","\\wr",!0);U(re,ye,Vt,"⨿","\\amalg");U(re,ye,Vt,"&","\\And");U(re,ye,We,"⟵","\\longleftarrow",!0);U(re,ye,We,"⇐","\\Leftarrow",!0);U(re,ye,We,"⟸","\\Longleftarrow",!0);U(re,ye,We,"⟶","\\longrightarrow",!0);U(re,ye,We,"⇒","\\Rightarrow",!0);U(re,ye,We,"⟹","\\Longrightarrow",!0);U(re,ye,We,"↔","\\leftrightarrow",!0);U(re,ye,We,"⟷","\\longleftrightarrow",!0);U(re,ye,We,"⇔","\\Leftrightarrow",!0);U(re,ye,We,"⟺","\\Longleftrightarrow",!0);U(re,ye,We,"↦","\\mapsto",!0);U(re,ye,We,"⟼","\\longmapsto",!0);U(re,ye,We,"↗","\\nearrow",!0);U(re,ye,We,"↩","\\hookleftarrow",!0);U(re,ye,We,"↪","\\hookrightarrow",!0);U(re,ye,We,"↘","\\searrow",!0);U(re,ye,We,"↼","\\leftharpoonup",!0);U(re,ye,We,"⇀","\\rightharpoonup",!0);U(re,ye,We,"↙","\\swarrow",!0);U(re,ye,We,"↽","\\leftharpoondown",!0);U(re,ye,We,"⇁","\\rightharpoondown",!0);U(re,ye,We,"↖","\\nwarrow",!0);U(re,ye,We,"⇌","\\rightleftharpoons",!0);U(re,ze,We,"≮","\\nless",!0);U(re,ze,We,"","\\@nleqslant");U(re,ze,We,"","\\@nleqq");U(re,ze,We,"⪇","\\lneq",!0);U(re,ze,We,"≨","\\lneqq",!0);U(re,ze,We,"","\\@lvertneqq");U(re,ze,We,"⋦","\\lnsim",!0);U(re,ze,We,"⪉","\\lnapprox",!0);U(re,ze,We,"⊀","\\nprec",!0);U(re,ze,We,"⋠","\\npreceq",!0);U(re,ze,We,"⋨","\\precnsim",!0);U(re,ze,We,"⪹","\\precnapprox",!0);U(re,ze,We,"≁","\\nsim",!0);U(re,ze,We,"","\\@nshortmid");U(re,ze,We,"∤","\\nmid",!0);U(re,ze,We,"⊬","\\nvdash",!0);U(re,ze,We,"⊭","\\nvDash",!0);U(re,ze,We,"⋪","\\ntriangleleft");U(re,ze,We,"⋬","\\ntrianglelefteq",!0);U(re,ze,We,"⊊","\\subsetneq",!0);U(re,ze,We,"","\\@varsubsetneq");U(re,ze,We,"⫋","\\subsetneqq",!0);U(re,ze,We,"","\\@varsubsetneqq");U(re,ze,We,"≯","\\ngtr",!0);U(re,ze,We,"","\\@ngeqslant");U(re,ze,We,"","\\@ngeqq");U(re,ze,We,"⪈","\\gneq",!0);U(re,ze,We,"≩","\\gneqq",!0);U(re,ze,We,"","\\@gvertneqq");U(re,ze,We,"⋧","\\gnsim",!0);U(re,ze,We,"⪊","\\gnapprox",!0);U(re,ze,We,"⊁","\\nsucc",!0);U(re,ze,We,"⋡","\\nsucceq",!0);U(re,ze,We,"⋩","\\succnsim",!0);U(re,ze,We,"⪺","\\succnapprox",!0);U(re,ze,We,"≆","\\ncong",!0);U(re,ze,We,"","\\@nshortparallel");U(re,ze,We,"∦","\\nparallel",!0);U(re,ze,We,"⊯","\\nVDash",!0);U(re,ze,We,"⋫","\\ntriangleright");U(re,ze,We,"⋭","\\ntrianglerighteq",!0);U(re,ze,We,"","\\@nsupseteqq");U(re,ze,We,"⊋","\\supsetneq",!0);U(re,ze,We,"","\\@varsupsetneq");U(re,ze,We,"⫌","\\supsetneqq",!0);U(re,ze,We,"","\\@varsupsetneqq");U(re,ze,We,"⊮","\\nVdash",!0);U(re,ze,We,"⪵","\\precneqq",!0);U(re,ze,We,"⪶","\\succneqq",!0);U(re,ze,We,"","\\@nsubseteqq");U(re,ze,Vt,"⊴","\\unlhd");U(re,ze,Vt,"⊵","\\unrhd");U(re,ze,We,"↚","\\nleftarrow",!0);U(re,ze,We,"↛","\\nrightarrow",!0);U(re,ze,We,"⇍","\\nLeftarrow",!0);U(re,ze,We,"⇏","\\nRightarrow",!0);U(re,ze,We,"↮","\\nleftrightarrow",!0);U(re,ze,We,"⇎","\\nLeftrightarrow",!0);U(re,ze,We,"△","\\vartriangle");U(re,ze,qe,"ℏ","\\hslash");U(re,ze,qe,"▽","\\triangledown");U(re,ze,qe,"◊","\\lozenge");U(re,ze,qe,"Ⓢ","\\circledS");U(re,ze,qe,"®","\\circledR");U(Tt,ze,qe,"®","\\circledR");U(re,ze,qe,"∡","\\measuredangle",!0);U(re,ze,qe,"∄","\\nexists");U(re,ze,qe,"℧","\\mho");U(re,ze,qe,"Ⅎ","\\Finv",!0);U(re,ze,qe,"⅁","\\Game",!0);U(re,ze,qe,"‵","\\backprime");U(re,ze,qe,"▲","\\blacktriangle");U(re,ze,qe,"▼","\\blacktriangledown");U(re,ze,qe,"■","\\blacksquare");U(re,ze,qe,"⧫","\\blacklozenge");U(re,ze,qe,"★","\\bigstar");U(re,ze,qe,"∢","\\sphericalangle",!0);U(re,ze,qe,"∁","\\complement",!0);U(re,ze,qe,"ð","\\eth",!0);U(Tt,ye,qe,"ð","ð");U(re,ze,qe,"╱","\\diagup");U(re,ze,qe,"╲","\\diagdown");U(re,ze,qe,"□","\\square");U(re,ze,qe,"□","\\Box");U(re,ze,qe,"◊","\\Diamond");U(re,ze,qe,"¥","\\yen",!0);U(Tt,ze,qe,"¥","\\yen",!0);U(re,ze,qe,"✓","\\checkmark",!0);U(Tt,ze,qe,"✓","\\checkmark");U(re,ze,qe,"ℶ","\\beth",!0);U(re,ze,qe,"ℸ","\\daleth",!0);U(re,ze,qe,"ℷ","\\gimel",!0);U(re,ze,qe,"ϝ","\\digamma",!0);U(re,ze,qe,"ϰ","\\varkappa");U(re,ze,qo,"┌","\\@ulcorner",!0);U(re,ze,Qs,"┐","\\@urcorner",!0);U(re,ze,qo,"└","\\@llcorner",!0);U(re,ze,Qs,"┘","\\@lrcorner",!0);U(re,ze,We,"≦","\\leqq",!0);U(re,ze,We,"⩽","\\leqslant",!0);U(re,ze,We,"⪕","\\eqslantless",!0);U(re,ze,We,"≲","\\lesssim",!0);U(re,ze,We,"⪅","\\lessapprox",!0);U(re,ze,We,"≊","\\approxeq",!0);U(re,ze,Vt,"⋖","\\lessdot");U(re,ze,We,"⋘","\\lll",!0);U(re,ze,We,"≶","\\lessgtr",!0);U(re,ze,We,"⋚","\\lesseqgtr",!0);U(re,ze,We,"⪋","\\lesseqqgtr",!0);U(re,ze,We,"≑","\\doteqdot");U(re,ze,We,"≓","\\risingdotseq",!0);U(re,ze,We,"≒","\\fallingdotseq",!0);U(re,ze,We,"∽","\\backsim",!0);U(re,ze,We,"⋍","\\backsimeq",!0);U(re,ze,We,"⫅","\\subseteqq",!0);U(re,ze,We,"⋐","\\Subset",!0);U(re,ze,We,"⊏","\\sqsubset",!0);U(re,ze,We,"≼","\\preccurlyeq",!0);U(re,ze,We,"⋞","\\curlyeqprec",!0);U(re,ze,We,"≾","\\precsim",!0);U(re,ze,We,"⪷","\\precapprox",!0);U(re,ze,We,"⊲","\\vartriangleleft");U(re,ze,We,"⊴","\\trianglelefteq");U(re,ze,We,"⊨","\\vDash",!0);U(re,ze,We,"⊪","\\Vvdash",!0);U(re,ze,We,"⌣","\\smallsmile");U(re,ze,We,"⌢","\\smallfrown");U(re,ze,We,"≏","\\bumpeq",!0);U(re,ze,We,"≎","\\Bumpeq",!0);U(re,ze,We,"≧","\\geqq",!0);U(re,ze,We,"⩾","\\geqslant",!0);U(re,ze,We,"⪖","\\eqslantgtr",!0);U(re,ze,We,"≳","\\gtrsim",!0);U(re,ze,We,"⪆","\\gtrapprox",!0);U(re,ze,Vt,"⋗","\\gtrdot");U(re,ze,We,"⋙","\\ggg",!0);U(re,ze,We,"≷","\\gtrless",!0);U(re,ze,We,"⋛","\\gtreqless",!0);U(re,ze,We,"⪌","\\gtreqqless",!0);U(re,ze,We,"≖","\\eqcirc",!0);U(re,ze,We,"≗","\\circeq",!0);U(re,ze,We,"≜","\\triangleq",!0);U(re,ze,We,"∼","\\thicksim");U(re,ze,We,"≈","\\thickapprox");U(re,ze,We,"⫆","\\supseteqq",!0);U(re,ze,We,"⋑","\\Supset",!0);U(re,ze,We,"⊐","\\sqsupset",!0);U(re,ze,We,"≽","\\succcurlyeq",!0);U(re,ze,We,"⋟","\\curlyeqsucc",!0);U(re,ze,We,"≿","\\succsim",!0);U(re,ze,We,"⪸","\\succapprox",!0);U(re,ze,We,"⊳","\\vartriangleright");U(re,ze,We,"⊵","\\trianglerighteq");U(re,ze,We,"⊩","\\Vdash",!0);U(re,ze,We,"∣","\\shortmid");U(re,ze,We,"∥","\\shortparallel");U(re,ze,We,"≬","\\between",!0);U(re,ze,We,"⋔","\\pitchfork",!0);U(re,ze,We,"∝","\\varpropto");U(re,ze,We,"◀","\\blacktriangleleft");U(re,ze,We,"∴","\\therefore",!0);U(re,ze,We,"∍","\\backepsilon");U(re,ze,We,"▶","\\blacktriangleright");U(re,ze,We,"∵","\\because",!0);U(re,ze,We,"⋘","\\llless");U(re,ze,We,"⋙","\\gggtr");U(re,ze,Vt,"⊲","\\lhd");U(re,ze,Vt,"⊳","\\rhd");U(re,ze,We,"≂","\\eqsim",!0);U(re,ye,We,"⋈","\\Join");U(re,ze,We,"≑","\\Doteq",!0);U(re,ze,Vt,"∔","\\dotplus",!0);U(re,ze,Vt,"∖","\\smallsetminus");U(re,ze,Vt,"⋒","\\Cap",!0);U(re,ze,Vt,"⋓","\\Cup",!0);U(re,ze,Vt,"⩞","\\doublebarwedge",!0);U(re,ze,Vt,"⊟","\\boxminus",!0);U(re,ze,Vt,"⊞","\\boxplus",!0);U(re,ze,Vt,"⋇","\\divideontimes",!0);U(re,ze,Vt,"⋉","\\ltimes",!0);U(re,ze,Vt,"⋊","\\rtimes",!0);U(re,ze,Vt,"⋋","\\leftthreetimes",!0);U(re,ze,Vt,"⋌","\\rightthreetimes",!0);U(re,ze,Vt,"⋏","\\curlywedge",!0);U(re,ze,Vt,"⋎","\\curlyvee",!0);U(re,ze,Vt,"⊝","\\circleddash",!0);U(re,ze,Vt,"⊛","\\circledast",!0);U(re,ze,Vt,"⋅","\\centerdot");U(re,ze,Vt,"⊺","\\intercal",!0);U(re,ze,Vt,"⋒","\\doublecap");U(re,ze,Vt,"⋓","\\doublecup");U(re,ze,Vt,"⊠","\\boxtimes",!0);U(re,ze,We,"⇢","\\dashrightarrow",!0);U(re,ze,We,"⇠","\\dashleftarrow",!0);U(re,ze,We,"⇇","\\leftleftarrows",!0);U(re,ze,We,"⇆","\\leftrightarrows",!0);U(re,ze,We,"⇚","\\Lleftarrow",!0);U(re,ze,We,"↞","\\twoheadleftarrow",!0);U(re,ze,We,"↢","\\leftarrowtail",!0);U(re,ze,We,"↫","\\looparrowleft",!0);U(re,ze,We,"⇋","\\leftrightharpoons",!0);U(re,ze,We,"↶","\\curvearrowleft",!0);U(re,ze,We,"↺","\\circlearrowleft",!0);U(re,ze,We,"↰","\\Lsh",!0);U(re,ze,We,"⇈","\\upuparrows",!0);U(re,ze,We,"↿","\\upharpoonleft",!0);U(re,ze,We,"⇃","\\downharpoonleft",!0);U(re,ye,We,"⊶","\\origof",!0);U(re,ye,We,"⊷","\\imageof",!0);U(re,ze,We,"⊸","\\multimap",!0);U(re,ze,We,"↭","\\leftrightsquigarrow",!0);U(re,ze,We,"⇉","\\rightrightarrows",!0);U(re,ze,We,"⇄","\\rightleftarrows",!0);U(re,ze,We,"↠","\\twoheadrightarrow",!0);U(re,ze,We,"↣","\\rightarrowtail",!0);U(re,ze,We,"↬","\\looparrowright",!0);U(re,ze,We,"↷","\\curvearrowright",!0);U(re,ze,We,"↻","\\circlearrowright",!0);U(re,ze,We,"↱","\\Rsh",!0);U(re,ze,We,"⇊","\\downdownarrows",!0);U(re,ze,We,"↾","\\upharpoonright",!0);U(re,ze,We,"⇂","\\downharpoonright",!0);U(re,ze,We,"⇝","\\rightsquigarrow",!0);U(re,ze,We,"⇝","\\leadsto");U(re,ze,We,"⇛","\\Rrightarrow",!0);U(re,ze,We,"↾","\\restriction");U(re,ye,qe,"‘","`");U(re,ye,qe,"$","\\$");U(Tt,ye,qe,"$","\\$");U(Tt,ye,qe,"$","\\textdollar");U(re,ye,qe,"%","\\%");U(Tt,ye,qe,"%","\\%");U(re,ye,qe,"_","\\_");U(Tt,ye,qe,"_","\\_");U(Tt,ye,qe,"_","\\textunderscore");U(re,ye,qe,"∠","\\angle",!0);U(re,ye,qe,"∞","\\infty",!0);U(re,ye,qe,"′","\\prime");U(re,ye,qe,"△","\\triangle");U(re,ye,qe,"Γ","\\Gamma",!0);U(re,ye,qe,"Δ","\\Delta",!0);U(re,ye,qe,"Θ","\\Theta",!0);U(re,ye,qe,"Λ","\\Lambda",!0);U(re,ye,qe,"Ξ","\\Xi",!0);U(re,ye,qe,"Π","\\Pi",!0);U(re,ye,qe,"Σ","\\Sigma",!0);U(re,ye,qe,"Υ","\\Upsilon",!0);U(re,ye,qe,"Φ","\\Phi",!0);U(re,ye,qe,"Ψ","\\Psi",!0);U(re,ye,qe,"Ω","\\Omega",!0);U(re,ye,qe,"A","Α");U(re,ye,qe,"B","Β");U(re,ye,qe,"E","Ε");U(re,ye,qe,"Z","Ζ");U(re,ye,qe,"H","Η");U(re,ye,qe,"I","Ι");U(re,ye,qe,"K","Κ");U(re,ye,qe,"M","Μ");U(re,ye,qe,"N","Ν");U(re,ye,qe,"O","Ο");U(re,ye,qe,"P","Ρ");U(re,ye,qe,"T","Τ");U(re,ye,qe,"X","Χ");U(re,ye,qe,"¬","\\neg",!0);U(re,ye,qe,"¬","\\lnot");U(re,ye,qe,"⊤","\\top");U(re,ye,qe,"⊥","\\bot");U(re,ye,qe,"∅","\\emptyset");U(re,ze,qe,"∅","\\varnothing");U(re,ye,hr,"α","\\alpha",!0);U(re,ye,hr,"β","\\beta",!0);U(re,ye,hr,"γ","\\gamma",!0);U(re,ye,hr,"δ","\\delta",!0);U(re,ye,hr,"ϵ","\\epsilon",!0);U(re,ye,hr,"ζ","\\zeta",!0);U(re,ye,hr,"η","\\eta",!0);U(re,ye,hr,"θ","\\theta",!0);U(re,ye,hr,"ι","\\iota",!0);U(re,ye,hr,"κ","\\kappa",!0);U(re,ye,hr,"λ","\\lambda",!0);U(re,ye,hr,"μ","\\mu",!0);U(re,ye,hr,"ν","\\nu",!0);U(re,ye,hr,"ξ","\\xi",!0);U(re,ye,hr,"ο","\\omicron",!0);U(re,ye,hr,"π","\\pi",!0);U(re,ye,hr,"ρ","\\rho",!0);U(re,ye,hr,"σ","\\sigma",!0);U(re,ye,hr,"τ","\\tau",!0);U(re,ye,hr,"υ","\\upsilon",!0);U(re,ye,hr,"ϕ","\\phi",!0);U(re,ye,hr,"χ","\\chi",!0);U(re,ye,hr,"ψ","\\psi",!0);U(re,ye,hr,"ω","\\omega",!0);U(re,ye,hr,"ε","\\varepsilon",!0);U(re,ye,hr,"ϑ","\\vartheta",!0);U(re,ye,hr,"ϖ","\\varpi",!0);U(re,ye,hr,"ϱ","\\varrho",!0);U(re,ye,hr,"ς","\\varsigma",!0);U(re,ye,hr,"φ","\\varphi",!0);U(re,ye,Vt,"∗","*",!0);U(re,ye,Vt,"+","+");U(re,ye,Vt,"−","-",!0);U(re,ye,Vt,"⋅","\\cdot",!0);U(re,ye,Vt,"∘","\\circ",!0);U(re,ye,Vt,"÷","\\div",!0);U(re,ye,Vt,"±","\\pm",!0);U(re,ye,Vt,"×","\\times",!0);U(re,ye,Vt,"∩","\\cap",!0);U(re,ye,Vt,"∪","\\cup",!0);U(re,ye,Vt,"∖","\\setminus",!0);U(re,ye,Vt,"∧","\\land");U(re,ye,Vt,"∨","\\lor");U(re,ye,Vt,"∧","\\wedge",!0);U(re,ye,Vt,"∨","\\vee",!0);U(re,ye,qe,"√","\\surd");U(re,ye,qo,"⟨","\\langle",!0);U(re,ye,qo,"∣","\\lvert");U(re,ye,qo,"∥","\\lVert");U(re,ye,Qs,"?","?");U(re,ye,Qs,"!","!");U(re,ye,Qs,"⟩","\\rangle",!0);U(re,ye,Qs,"∣","\\rvert");U(re,ye,Qs,"∥","\\rVert");U(re,ye,We,"=","=");U(re,ye,We,":",":");U(re,ye,We,"≈","\\approx",!0);U(re,ye,We,"≅","\\cong",!0);U(re,ye,We,"≥","\\ge");U(re,ye,We,"≥","\\geq",!0);U(re,ye,We,"←","\\gets");U(re,ye,We,">","\\gt",!0);U(re,ye,We,"∈","\\in",!0);U(re,ye,We,"","\\@not");U(re,ye,We,"⊂","\\subset",!0);U(re,ye,We,"⊃","\\supset",!0);U(re,ye,We,"⊆","\\subseteq",!0);U(re,ye,We,"⊇","\\supseteq",!0);U(re,ze,We,"⊈","\\nsubseteq",!0);U(re,ze,We,"⊉","\\nsupseteq",!0);U(re,ye,We,"⊨","\\models");U(re,ye,We,"←","\\leftarrow",!0);U(re,ye,We,"≤","\\le");U(re,ye,We,"≤","\\leq",!0);U(re,ye,We,"<","\\lt",!0);U(re,ye,We,"→","\\rightarrow",!0);U(re,ye,We,"→","\\to");U(re,ze,We,"≱","\\ngeq",!0);U(re,ze,We,"≰","\\nleq",!0);U(re,ye,Bh," ","\\ ");U(re,ye,Bh," ","\\space");U(re,ye,Bh," ","\\nobreakspace");U(Tt,ye,Bh," ","\\ ");U(Tt,ye,Bh," "," ");U(Tt,ye,Bh," ","\\space");U(Tt,ye,Bh," ","\\nobreakspace");U(re,ye,Bh,"","\\nobreak");U(re,ye,Bh,"","\\allowbreak");U(re,ye,iS,",",",");U(re,ye,iS,";",";");U(re,ze,Vt,"⊼","\\barwedge",!0);U(re,ze,Vt,"⊻","\\veebar",!0);U(re,ye,Vt,"⊙","\\odot",!0);U(re,ye,Vt,"⊕","\\oplus",!0);U(re,ye,Vt,"⊗","\\otimes",!0);U(re,ye,qe,"∂","\\partial",!0);U(re,ye,Vt,"⊘","\\oslash",!0);U(re,ze,Vt,"⊚","\\circledcirc",!0);U(re,ze,Vt,"⊡","\\boxdot",!0);U(re,ye,Vt,"△","\\bigtriangleup");U(re,ye,Vt,"▽","\\bigtriangledown");U(re,ye,Vt,"†","\\dagger");U(re,ye,Vt,"⋄","\\diamond");U(re,ye,Vt,"⋆","\\star");U(re,ye,Vt,"◃","\\triangleleft");U(re,ye,Vt,"▹","\\triangleright");U(re,ye,qo,"{","\\{");U(Tt,ye,qe,"{","\\{");U(Tt,ye,qe,"{","\\textbraceleft");U(re,ye,Qs,"}","\\}");U(Tt,ye,qe,"}","\\}");U(Tt,ye,qe,"}","\\textbraceright");U(re,ye,qo,"{","\\lbrace");U(re,ye,Qs,"}","\\rbrace");U(re,ye,qo,"[","\\lbrack",!0);U(Tt,ye,qe,"[","\\lbrack",!0);U(re,ye,Qs,"]","\\rbrack",!0);U(Tt,ye,qe,"]","\\rbrack",!0);U(re,ye,qo,"(","\\lparen",!0);U(re,ye,Qs,")","\\rparen",!0);U(Tt,ye,qe,"<","\\textless",!0);U(Tt,ye,qe,">","\\textgreater",!0);U(re,ye,qo,"⌊","\\lfloor",!0);U(re,ye,Qs,"⌋","\\rfloor",!0);U(re,ye,qo,"⌈","\\lceil",!0);U(re,ye,Qs,"⌉","\\rceil",!0);U(re,ye,qe,"\\","\\backslash");U(re,ye,qe,"∣","|");U(re,ye,qe,"∣","\\vert");U(Tt,ye,qe,"|","\\textbar",!0);U(re,ye,qe,"∥","\\|");U(re,ye,qe,"∥","\\Vert");U(Tt,ye,qe,"∥","\\textbardbl");U(Tt,ye,qe,"~","\\textasciitilde");U(Tt,ye,qe,"\\","\\textbackslash");U(Tt,ye,qe,"^","\\textasciicircum");U(re,ye,We,"↑","\\uparrow",!0);U(re,ye,We,"⇑","\\Uparrow",!0);U(re,ye,We,"↓","\\downarrow",!0);U(re,ye,We,"⇓","\\Downarrow",!0);U(re,ye,We,"↕","\\updownarrow",!0);U(re,ye,We,"⇕","\\Updownarrow",!0);U(re,ye,Qi,"∐","\\coprod");U(re,ye,Qi,"⋁","\\bigvee");U(re,ye,Qi,"⋀","\\bigwedge");U(re,ye,Qi,"⨄","\\biguplus");U(re,ye,Qi,"⋂","\\bigcap");U(re,ye,Qi,"⋃","\\bigcup");U(re,ye,Qi,"∫","\\int");U(re,ye,Qi,"∫","\\intop");U(re,ye,Qi,"∬","\\iint");U(re,ye,Qi,"∭","\\iiint");U(re,ye,Qi,"∏","\\prod");U(re,ye,Qi,"∑","\\sum");U(re,ye,Qi,"⨂","\\bigotimes");U(re,ye,Qi,"⨁","\\bigoplus");U(re,ye,Qi,"⨀","\\bigodot");U(re,ye,Qi,"∮","\\oint");U(re,ye,Qi,"∯","\\oiint");U(re,ye,Qi,"∰","\\oiiint");U(re,ye,Qi,"⨆","\\bigsqcup");U(re,ye,Qi,"∫","\\smallint");U(Tt,ye,kx,"…","\\textellipsis");U(re,ye,kx,"…","\\mathellipsis");U(Tt,ye,kx,"…","\\ldots",!0);U(re,ye,kx,"…","\\ldots",!0);U(re,ye,kx,"⋯","\\@cdots",!0);U(re,ye,kx,"⋱","\\ddots",!0);U(re,ye,qe,"⋮","\\varvdots");U(Tt,ye,qe,"⋮","\\varvdots");U(re,ye,ui,"ˊ","\\acute");U(re,ye,ui,"ˋ","\\grave");U(re,ye,ui,"¨","\\ddot");U(re,ye,ui,"~","\\tilde");U(re,ye,ui,"ˉ","\\bar");U(re,ye,ui,"˘","\\breve");U(re,ye,ui,"ˇ","\\check");U(re,ye,ui,"^","\\hat");U(re,ye,ui,"⃗","\\vec");U(re,ye,ui,"˙","\\dot");U(re,ye,ui,"˚","\\mathring");U(re,ye,hr,"","\\@imath");U(re,ye,hr,"","\\@jmath");U(re,ye,qe,"ı","ı");U(re,ye,qe,"ȷ","ȷ");U(Tt,ye,qe,"ı","\\i",!0);U(Tt,ye,qe,"ȷ","\\j",!0);U(Tt,ye,qe,"ß","\\ss",!0);U(Tt,ye,qe,"æ","\\ae",!0);U(Tt,ye,qe,"œ","\\oe",!0);U(Tt,ye,qe,"ø","\\o",!0);U(Tt,ye,qe,"Æ","\\AE",!0);U(Tt,ye,qe,"Œ","\\OE",!0);U(Tt,ye,qe,"Ø","\\O",!0);U(Tt,ye,ui,"ˊ","\\'");U(Tt,ye,ui,"ˋ","\\`");U(Tt,ye,ui,"ˆ","\\^");U(Tt,ye,ui,"˜","\\~");U(Tt,ye,ui,"ˉ","\\=");U(Tt,ye,ui,"˘","\\u");U(Tt,ye,ui,"˙","\\.");U(Tt,ye,ui,"¸","\\c");U(Tt,ye,ui,"˚","\\r");U(Tt,ye,ui,"ˇ","\\v");U(Tt,ye,ui,"¨",'\\"');U(Tt,ye,ui,"˝","\\H");U(Tt,ye,ui,"◯","\\textcircled");var sge={"--":!0,"---":!0,"``":!0,"''":!0};U(Tt,ye,qe,"–","--",!0);U(Tt,ye,qe,"–","\\textendash");U(Tt,ye,qe,"—","---",!0);U(Tt,ye,qe,"—","\\textemdash");U(Tt,ye,qe,"‘","`",!0);U(Tt,ye,qe,"‘","\\textquoteleft");U(Tt,ye,qe,"’","'",!0);U(Tt,ye,qe,"’","\\textquoteright");U(Tt,ye,qe,"“","``",!0);U(Tt,ye,qe,"“","\\textquotedblleft");U(Tt,ye,qe,"”","''",!0);U(Tt,ye,qe,"”","\\textquotedblright");U(re,ye,qe,"°","\\degree",!0);U(Tt,ye,qe,"°","\\degree");U(Tt,ye,qe,"°","\\textdegree",!0);U(re,ye,qe,"£","\\pounds");U(re,ye,qe,"£","\\mathsterling",!0);U(Tt,ye,qe,"£","\\pounds");U(Tt,ye,qe,"£","\\textsterling",!0);U(re,ze,qe,"✠","\\maltese");U(Tt,ze,qe,"✠","\\maltese");var pZ='0123456789/@."';for(var iI=0;iI{var e=t.charCodeAt(0),r=t.charCodeAt(1),n=(e-55296)*1024+(r-56320)+65536;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return kZ[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return dtt[a]}else{if(n===120485||n===120486)return kZ[0];if(120486{if(nf(t.classes)!==nf(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n of Object.keys(t.style))if(t.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(t.style[i]!==e.style[i])return!1;return!0},oge=t=>{for(var e=0;er&&(r=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},St=function(e,r,n,i){var a=new Cx(e,r,n,i);return GV(a),a},sf=(t,e,r,n)=>new Cx(t,e,r,n),Db=function(e,r,n){var i=St([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Mt(i.height),i.maxFontSize=1,i},mtt=function(e,r,n,i){var a=new SR(e,r,n,i);return GV(a),a},Fh=function(e){var r=new wx(e);return GV(r),r},Ob=function(e,r){return e instanceof wx?St([],[e],r):e},ytt=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,s=1;s{var r=St(["mspace"],[],e),n=fi(t,e);return r.style.marginRight=Mt(n),r},OE=(t,e,r)=>{var n,i;switch(t){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=t}return e==="textbf"&&r==="textit"?i="BoldItalic":e==="textbf"?i="Bold":r==="textit"?i="Italic":i="Regular",n+"-"+i},r$={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},cge={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},uge=function(e,r){var[n,i,a]=cge[e],s=new af(n),o=new xh([s],{width:Mt(i),height:Mt(a),style:"width:"+Mt(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=sf(["overlay"],[o],r);return l.height=a,l.style.height=Mt(a),l.style.width=Mt(i),l},di={number:3,unit:"mu"},Yf={number:4,unit:"mu"},Ru={number:5,unit:"mu"},vtt={mord:{mop:di,mbin:Yf,mrel:Ru,minner:di},mop:{mord:di,mop:di,mrel:Ru,minner:di},mbin:{mord:Yf,mop:Yf,mopen:Yf,minner:Yf},mrel:{mord:Ru,mop:Ru,mopen:Ru,minner:Ru},mopen:{},mclose:{mop:di,mbin:Yf,mrel:Ru,minner:di},mpunct:{mord:di,mop:di,mrel:Ru,mopen:di,mclose:di,mpunct:di,minner:di},minner:{mord:di,mop:di,mbin:Yf,mrel:Ru,mopen:di,mpunct:di,minner:di}},btt={mord:{mop:di},mop:{mord:di,mop:di},mbin:{},mrel:{},mopen:{},mclose:{mop:di},mpunct:{},minner:{mop:di}},hge={},YA={},XA={};function Pt(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var y=m.classes[0],v=g.classes[0];y==="mbin"&&Ttt.has(v)?m.classes[0]="mord":v==="mbin"&&xtt.has(y)&&(g.classes[0]="mord")},{node:d},f,p),n$(a,(g,m)=>{var y,v,T=a$(m),b=a$(g),w=T&&b?g.hasClass("mtight")?(y=btt[T])==null?void 0:y[b]:(v=vtt[T])==null?void 0:v[b]:null;if(w)return lge(w,u)},{node:d},f,p),a},n$=function(e,r,n,i,a){i&&e.push(i);for(var s=0;sf=>{e.splice(d+1,0,f),s++})(s)}i&&e.pop()},dge=function(e){return e instanceof wx||e instanceof SR||e instanceof Cx&&e.hasClass("enclosing")?e:null},i$=function(e,r){var n=dge(e);if(n){var i=n.children;if(i.length){if(r==="right")return i$(i[i.length-1],"right");if(r==="left")return i$(i[0],"left")}}return e},a$=function(e,r){if(!e)return null;r&&(e=i$(e,r));var n=e.classes[0];return Ctt[n]||null},HC=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return St(r.concat(n))},vn=function(e,r,n){if(!e)return St();if(YA[e.type]){var i=YA[e.type](e,r);if(n&&r.size!==n.size){i=St(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new _t("Got group of unknown type: '"+e.type+"'")};function $E(t,e){var r=St(["base"],t,e),n=St(["strut"]);return n.style.height=Mt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Mt(-r.depth)),r.children.unshift(n),r}function s$(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=la(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push($E(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push($E(s,e));var u;r?(u=$E(la(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=St(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=Mt(h.height+h.depth),h.depth&&(d.style.verticalAlign=Mt(-h.depth))}return h}function fge(t){return new wx(t)}class Lt{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=nf(this.classes));for(var n=0;n0&&(e+=' class ="'+fs(nf(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Yi{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return fs(this.toText())}toText(){return this.text}}class pge{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Mt(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var ktt=new Set(["\\imath","\\jmath"]),Stt=new Set(["mrow","mtable"]),xl=function(e,r,n){return li[r][e]&&li[r][e].replace&&e.charCodeAt(0)!==55349&&!(sge.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=li[r][e].replace),new Yi(e)},WV=function(e){return e.length===1?e[0]:new Lt("mrow",e)},Ett={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},HV=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var r=e.font;if(!r||r==="mathnormal")return null;var n=t.mode,i=Ett[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(ktt.has(a))return null;if(li[n][a]){var s=li[n][a].replace;s&&(a=s)}var o=r$[r].fontName;return zV(a,o,n)?r$[r].variant:null};function lI(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Yi&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof Yi&&r.text===","}else return!1}var Uo=function(e,r,n){if(e.length===1){var i=Dn(e[0],r);return n&&i instanceof Lt&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||lI(s))){var u=l.children[0];u instanceof Lt&&u.type==="mn"&&(u.children=[...s.children,...u.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var h=s.children[0];if(h instanceof Yi&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Yi&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},of=function(e,r,n){return WV(Uo(e,r,n))},Dn=function(e,r){if(!e)return new Lt("mrow");if(XA[e.type])return XA[e.type](e,r);throw new _t("Got group of unknown type: '"+e.type+"'")};function SZ(t,e,r,n,i){var a=Uo(t,r),s;a.length===1&&a[0]instanceof Lt&&Stt.has(a[0].type)?s=a[0]:s=new Lt("mrow",a);var o=new Lt("annotation",[new Yi(e)]);o.setAttribute("encoding","application/x-tex");var l=new Lt("semantics",[s,o]),u=new Lt("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return St([h],[u])}var Att=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],EZ=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],AZ=function(e,r){return r.size<2?e:Att[e-1][r.size-1]};class Hu{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Hu.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=EZ[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(r,e),new Hu(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:AZ(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:EZ[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=AZ(Hu.BASESIZE,e);return this.size===r&&this.textSize===Hu.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Hu.BASESIZE?["sizing","reset-size"+this.size,"size"+Hu.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=utt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Hu.BASESIZE=6;var gge=function(e){return new Hu({style:e.displayMode?Ir.DISPLAY:Ir.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},mge=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=St(n,[e])}return e},_tt=function(e,r,n){var i=gge(n),a;if(n.output==="mathml")return SZ(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=s$(e,i);a=St(["katex"],[s])}else{var o=SZ(e,r,i,n.displayMode,!1),l=s$(e,i);a=St(["katex"],[o,l])}return mge(a,n)},Rtt=function(e,r,n){var i=gge(n),a=s$(e,i),s=St(["katex"],[a]);return mge(s,n)},Ltt={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},_R=function(e){var r=new Lt("mo",[new Yi(Ltt[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},Mtt={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Itt=new Set(["widehat","widecheck","widetilde","utilde"]),RR=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(Itt.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,h,d,f;if(u>5)l==="widehat"||l==="widecheck"?(h=420,o=2364,f=.42,d=l+"4"):(h=312,o=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(o=[0,600,1033,2339,2340][p],h=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],d="tilde"+p)}var g=new af(d),m=new xh([g],{width:"100%",height:Mt(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:sf([],[m],r),minWidth:0,height:f}}else{var y=[],v=Mtt[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[T,b,w]=v,C=w/1e3,S=T.length,k,E;if(S===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');k=["hide-tail"],E=[v[3]]}else if(S===2)k=["halfarrow-left","halfarrow-right"],E=["xMinYMin","xMaxYMin"];else if(S===3)k=["brace-left","brace-center","brace-right"],E=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+S+" children.");for(var _=0;_0&&(i.style.minWidth=Mt(a)),i},Ntt=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=St(["stretchy",r],[],a),r==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new KO({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new KO({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new xh(u,{width:"100%",height:Mt(o)});s=sf([],[h],a)}return s.height=o,s.style.height=Mt(o),s},Dtt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Ott={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function $tt(t){return t in Dtt}function Pr(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function LR(t){var e=MR(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function MR(t){return t&&(t.type==="atom"||Ott.hasOwnProperty(t.type))?t:null}var yge=t=>{if(t instanceof zo)return t;if(ctt(t)&&t.children.length===1)return yge(t.children[0])},qV=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=Pr(t.base,"accent"),r=n.base,t.base=r,i=ltt(vn(t,e)),t.base=n):(n=Pr(t,"accent"),r=n.base);var a=vn(r,e.havingCrampedStyle()),s=n.isShifty&&Ph(r),o=0;if(s){var l,u;o=(l=(u=yge(a))==null?void 0:u.skew)!=null?l:0}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=RR(n,e),f=yn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Mt(2*o)+")",marginLeft:Mt(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=uge("vec",e),g=cge.vec[1]):(p=AR({mode:n.mode,text:n.label},e,"textord"),p=ott(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=St(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var y=o;m||(y-=g/2),f.style.left=Mt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=yn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var v=St(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},vge=(t,e)=>{var r=t.isStretchy?_R(t.label):new Lt("mo",[xl(t.label,t.mode)]),n=new Lt("mover",[Dn(t.base,e),r]);return n.setAttribute("accent","true"),n},Ptt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Pt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=jA(e[0]),n=!Ptt.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:qV,mathmlBuilder:vge});Pt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:qV,mathmlBuilder:vge});Pt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=vn(t.base,e),n=RR(t,e),i=t.label==="\\utilde"?.12:0,a=yn({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return St(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=_R(t.label),n=new Lt("munder",[Dn(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var PE=t=>{var e=new Lt("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Pt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=Ob(vn(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;t.below&&(n=e.havingStyle(r.sub()),s=Ob(vn(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=RR(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*o.height+.111;h=yn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:s,shift:d}]})}else h=yn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return St(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=_R(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=PE(Dn(t.body,e));if(t.below){var a=PE(Dn(t.below,e));n=new Lt("munderover",[r,a,i])}else n=new Lt("mover",[r,i])}else if(t.below){var s=PE(Dn(t.below,e));n=new Lt("munder",[r,s])}else n=PE(),n=new Lt("mover",[r,n]);return n}});function bge(t,e){var r=la(t.body,e,!0);return St([t.mclass],r,e)}function xge(t,e){var r,n=Uo(t.body,e);return t.mclass==="minner"?r=new Lt("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new Lt("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new Lt("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}Pt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:Ui(i),isCharacterBox:Ph(i)}},htmlBuilder:bge,mathmlBuilder:xge});var IR=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Pt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:IR(e[0]),body:Ui(e[1]),isCharacterBox:Ph(e[1])}}});Pt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],s;n!=="\\stackrel"?s=IR(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Ui(i)},l={type:"supsub",mode:a.mode,base:o,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:s,body:[l],isCharacterBox:Ph(l)}},htmlBuilder:bge,mathmlBuilder:xge});Pt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:IR(e[0]),body:Ui(e[0])}},htmlBuilder(t,e){var r=la(t.body,e,!0),n=St([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=Uo(t.body,e),n=new Lt("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var Btt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},_Z=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),RZ=t=>t.type==="textord"&&t.text==="@",Ftt=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function ztt(t,e,r){var n=Btt[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=r.callFunction("\\Big",[a],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Vtt(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new _t("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;aAV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',s[l]);var g=ztt(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=_Z()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Pt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=Ob(vn(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Mt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new Lt("mrow",[Dn(t.label,e)]);return r=new Lt("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new Lt("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});Pt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=Ob(vn(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new Lt("mrow",[Dn(t.fragment,e)])}});Pt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=Pr(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new _t("\\@char with invalid code point "+a);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var Tge=(t,e)=>{var r=la(t.body,e.withColor(t.color),!1);return Fh(r)},wge=(t,e)=>{var r=Uo(t.body,e.withColor(t.color)),n=new Lt("mstyle",r);return n.setAttribute("mathcolor",t.color),n};Pt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=Pr(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Ui(i)}},htmlBuilder:Tge,mathmlBuilder:wge});Pt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=Pr(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:Tge,mathmlBuilder:wge});Pt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&Pr(i,"size").value}},htmlBuilder(t,e){var r=St(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Mt(fi(t.size,e)))),r},mathmlBuilder(t,e){var r=new Lt("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Mt(fi(t.size,e)))),r}});var o$={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Cge=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new _t("Expected a control sequence",t);return e},Gtt=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},kge=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};Pt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(o$[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=o$[n.text]),Pr(e.parseFunction(),"internal");throw new _t("Invalid token after macro prefix",n)}});Pt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new _t("Expected a control sequence",n);for(var a=0,s,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),o[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new _t('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new _t('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new _t("Expected a macro definition");o[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return s&&l.unshift(s),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},r===o$[r]),{type:"internal",mode:e.mode}}});Pt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=Cge(e.gullet.popToken());e.gullet.consumeSpaces();var i=Gtt(e);return kge(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});Pt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=Cge(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return kge(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var ZT=function(e,r,n){var i=li.math[e]&&li.math[e].replace,a=zV(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},UV=function(e,r,n,i){var a=n.havingBaseStyle(r),s=St(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},Sge=function(e,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Mt(a),e.height-=a,e.depth+=a},Wtt=function(e,r,n,i,a,s){var o=Ls(e,"Main-Regular",a,i),l=UV(o,r,i,s);return Sge(l,i,r),l},Htt=function(e,r,n,i){return Ls(e,"Size"+r+"-Regular",n,i)},Ege=function(e,r,n,i,a,s){var o=Htt(e,r,a,i),l=UV(St(["delimsizing","size"+r],[o],i),Ir.TEXT,i,s);return n&&Sge(l,i,Ir.TEXT),l},cI=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=St(["delimsizinginner",i],[St([],[Ls(e,r,n)])]);return{type:"elem",elem:a}},uI=function(e,r,n){var i=Bc["Size4-Regular"][e.charCodeAt(0)]?Bc["Size4-Regular"][e.charCodeAt(0)][4]:Bc["Size1-Regular"][e.charCodeAt(0)][4],a=new af("inner",ett(e,Math.round(1e3*r))),s=new xh([a],{width:Mt(i),height:Mt(r),style:"width:"+Mt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=sf([],[s],n);return o.height=r,o.style.height=Mt(r),o.style.width=Mt(i),{type:"elem",elem:o}},l$=.008,BE={type:"kern",size:-1*l$},qtt=new Set(["|","\\lvert","\\rvert","\\vert"]),Utt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),Age=function(e,r,n,i,a,s){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):qtt.has(e)?(u="∣",d="vert",f=333):Utt.has(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=ZT(o,p,a),m=g.height+g.depth,y=ZT(u,p,a),v=y.height+y.depth,T=ZT(h,p,a),b=T.height+T.depth,w=0,C=1;if(l!==null){var S=ZT(l,p,a);w=S.height+S.depth,C=2}var k=m+b+w,E=Math.max(0,Math.ceil((r-k)/(C*v))),_=k+E*C*v,M=i.fontMetrics().axisHeight;n&&(M*=i.sizeMultiplier);var L=_/2-M,P=[];if(d.length>0){var D=_-m-b,R=Math.round(_*1e3),I=ttt(d,Math.round(D*1e3)),$=new af(d,I),O=Mt(f/1e3),N=Mt(R/1e3),F=new xh([$],{width:O,height:N,viewBox:"0 0 "+f+" "+R}),z=sf([],[F],i);z.height=R/1e3,z.style.width=O,z.style.height=N,P.push({type:"elem",elem:z})}else{if(P.push(cI(h,p,a)),P.push(BE),l===null){var V=_-m-b+2*l$;P.push(uI(u,V,i))}else{var B=(_-m-b-w)/2+2*l$;P.push(uI(u,B,i)),P.push(BE),P.push(cI(l,p,a)),P.push(BE),P.push(uI(u,B,i))}P.push(BE),P.push(cI(o,p,a))}var G=i.havingBaseStyle(Ir.TEXT),H=yn({positionType:"bottom",positionData:L,children:P});return UV(St(["delimsizing","mult"],[H],G),Ir.TEXT,i,s)},hI=80,dI=.08,fI=function(e,r,n,i,a){var s=Jet(e,i,n),o=new af(e,s),l=new xh([o],{width:"400em",height:Mt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return sf(["hide-tail"],[l],a)},Ytt=function(e,r){var n=r.havingBaseSizing(),i=Ige("\\surd",e*n.sizeMultiplier,Mge,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l,u,h,d;return i.type==="small"?(h=1e3+1e3*s+hI,e<1?a=1:e<1.4&&(a=.7),l=(1+s+dI)/a,u=(1+s)/a,o=fI("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+hI)*Gw[i.size],u=(Gw[i.size]+s)/a,l=(Gw[i.size]+s+dI)/a,o=fI("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+dI,u=e+s,h=Math.floor(1e3*e+s)+hI,o=fI("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=Mt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},_ge=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),Xtt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),Rge=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Gw=[0,1.2,1.8,2.4,3],Lge=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),_ge.has(e)||Rge.has(e))return Ege(e,r,!1,n,i,a);if(Xtt.has(e))return Age(e,Gw[r],!1,n,i,a);throw new _t("Illegal delimiter: '"+e+"'")},jtt=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Ktt=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"stack"}],Mge=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Ztt=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var r=e.type;throw new Error("Add support for delim type '"+r+"' here.")},Ige=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;sr)return o}return n[n.length-1]},c$=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;Rge.has(e)?o=jtt:_ge.has(e)?o=Mge:o=Ktt;var l=Ige(e,r,o,i);return l.type==="small"?Wtt(e,l.style,n,i,a,s):l.type==="large"?Ege(e,l.size,n,i,a,s):Age(e,r,n,i,a,s)},pI=function(e,r,n,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return c$(e,d,!0,i,a,s)},LZ={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Qtt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function MZ(t){return"isMiddle"in t}function NR(t,e){var r=MR(t);if(r&&Qtt.has(r.text))return r;throw r?new _t("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new _t("Invalid delimiter type '"+t.type+"'",t)}Pt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=NR(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:LZ[t.funcName].size,mclass:LZ[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?St([t.mclass]):Lge(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(xl(t.delim,t.mode));var r=new Lt("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Mt(Gw[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function IZ(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Pt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new _t("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:NR(e[0],t).text,color:r}}});Pt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=NR(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=Pr(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{IZ(t);for(var r=la(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{IZ(t);var r=Uo(t.body,e);if(t.left!=="."){var n=new Lt("mo",[xl(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new Lt("mo",[xl(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return WV(r)}});Pt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=NR(e[0],t);if(!t.parser.leftrightDepth)throw new _t("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=HC(e,[]):(r=Lge(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?xl("|","text"):xl(t.delim,t.mode),n=new Lt("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var DR=(t,e)=>{var r=Ob(vn(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s,o=Ph(t.body);if(n==="sout")a=St(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=fi({number:.6,unit:"pt"},e),u=fi({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=Mt(d/2+l);var f=Math.floor(1e3*d*i),p=Zet(f),g=new xh([new af("phase",p)],{width:"400em",height:Mt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=sf(["hide-tail"],[g],e),a.style.height=Mt(d),s=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m,y,v=0;/box/.test(n)?(v=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:v),y=m):n==="angl"?(v=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*v,y=Math.max(0,.25-r.depth)):(m=o?.2:0,y=m),a=Ntt(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=Mt(v)):n==="angl"&&v!==.049&&(a.style.borderTopWidth=Mt(v),a.style.borderRightWidth=Mt(v)),s=r.depth+y,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var T;if(t.backgroundColor)T=yn({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]});else{var b=/cancel|phase/.test(n)?["svg-align"]:[];T=yn({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:b}]})}return/cancel/.test(n)&&(T.height=r.height,T.depth=r.depth),/cancel/.test(n)&&!o?St(["mord","cancel-lap"],[T],e):St(["mord"],[T],e)},OR=(t,e)=>{var r,n=new Lt(t.label.includes("colorbox")?"mpadded":"menclose",[Dn(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+Mt(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};Pt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Pr(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:DR,mathmlBuilder:OR});Pt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Pr(e[0],"color-token").color,s=Pr(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:DR,mathmlBuilder:OR});Pt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}});Pt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:DR,mathmlBuilder:OR});Pt({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t;r.mode==="math"&&r.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:DR,mathmlBuilder:OR});Pt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var Nge={};function lu(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=t.parser.settings;if(!e.displayMode)throw new _t("{"+t.envName+"} can be used only in display mode.")},Jtt=new Set(["gather","gather*"]);function YV(t){if(!t.includes("ed"))return!t.includes("*")}function Cf(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!s){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)s=1;else if(s=parseFloat(p),!s||s<0)throw new _t("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],T=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){T&&(t.gullet.macros.get("\\df@tag")?(T.push(t.subparse([new $o("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):T.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(NZ(t));;){var C=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var S={type:"ordgroup",mode:t.mode,body:C};r&&(S={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[S]}),g.push(S);var k=t.fetch().text;if(k==="&"){if(d&&g.length===d){if(u||o)throw new _t("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(k==="\\end"){w(),g.length===1&&S.type==="styling"&&S.body.length===1&&S.body[0].type==="ordgroup"&&S.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),v.length0&&(b+=.25),u.push({pos:b,isDashed:Te[ae]})}for(w(s[0]),n=0;n0&&(L+=T,kTe))for(n=0;n=o)){var K=void 0;if(i>0||e.hskipBeforeAndAfter){var Q,te;K=(Q=(te=G)==null?void 0:te.pregap)!=null?Q:f,K!==0&&(I=St(["arraycolsep"],[]),I.style.width=Mt(K),R.push(I))}var J=[];for(n=0;n0){for(var fe=Db("hline",r,h),Pe=Db("hdashline",r,h),ve=[{type:"elem",elem:be,shift:0}];u.length>0;){var Ce=u.pop(),Ve=Ce.pos-P;Ce.isDashed?ve.push({type:"elem",elem:Pe,shift:Ve}):ve.push({type:"elem",elem:fe,shift:Ve})}be=yn({positionType:"individualShift",children:ve})}if(O.length===0)return St(["mord"],[be],r);var se=yn({positionType:"individualShift",children:O}),de=St(["tag"],[se],r);return Fh([be,de])},ert={c:"center ",l:"left ",r:"right "},uu=function(e,r){for(var n=[],i=new Lt("mtd",[],["mtr-glue"]),a=new Lt("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,m="",y=!1,v=0,T=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",T-=1);for(var b=v;b0?"left ":"",f+=_[_.length-1].length>0?"right ":"";for(var M=1;M<_.length-1;M++)E+=_[M].length===0?"none ":_[M][0]?"dashed ":"solid ";return/[sd]/.test(E)&&h.setAttribute("rowlines",E.trim()),f!==""&&(h=new Lt("menclose",[h]),h.setAttribute("notation",f.trim())),e.arraystretch&&e.arraystretch<1&&(h=new Lt("mstyle",[h]),h.setAttribute("scriptlevel","1")),h},Oge=function(e,r){e.envName.includes("ed")||$R(e);var n=[],i=e.envName.includes("at")?"alignat":"align",a=e.envName==="split",s=Cf(e.parser,{cols:n,addJot:!0,autoTag:a?void 0:YV(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:e.parser.settings.leqno},"display"),o=0,l=0,u={type:"ordgroup",mode:e.mode,body:[]};if(r[0]&&r[0].type==="ordgroup"){for(var h="",d=0;d0&&p&&(y=1),n[g]={type:"align",align:m,pregap:y,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};lu({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=MR(e[0]),n=r?[e[0]]:Pr(e[0],"ordgroup").body,i=n.map(function(s){var o=LR(s),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new _t("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Cf(t.parser,a,XV(t.envName))},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,!"lcr".includes(r))throw new _t("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=Cf(t.parser,n,XV(t.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=Cf(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=MR(e[0]),n=r?[e[0]]:Pr(e[0],"ordgroup").body,i=n.map(function(o){var l=LR(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new _t("Unknown column alignment: "+u,o)});if(i.length>1)throw new _t("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=Cf(t.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new _t("{subarray} can contain only one column");return s},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=Cf(t.parser,e,XV(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Oge,htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){Jtt.has(t.envName)&&$R(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:YV(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Cf(t.parser,e,"display")},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Oge,htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){$R(t);var e={autoTag:YV(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Cf(t.parser,e,"display")},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["CD"],props:{numArgs:0},handler(t){return $R(t),Vtt(t.parser)},htmlBuilder:cu,mathmlBuilder:uu});we("\\nonumber","\\gdef\\@eqnsw{0}");we("\\notag","\\nonumber");Pt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new _t(t.funcName+" valid only within array environment")}});var DZ=Nge;Pt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new _t("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return vn(t.body,n)},Pge=(t,e)=>{var r=t.font,n=e.withFont(r);return Dn(t.body,n)},OZ={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Pt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=jA(e[0]),a=n;return a in OZ&&(a=OZ[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:$ge,mathmlBuilder:Pge});Pt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"mclass",mode:r.mode,mclass:IR(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:Ph(n)}}});Pt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:s}}},htmlBuilder:$ge,mathmlBuilder:Pge});var trt=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=vn(t.numer,a,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var y;if(h){var T=e.fontMetrics().axisHeight;p-s.depth-(T+.5*d){var r=new Lt("mfrac",[Dn(t.numer,e),Dn(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=fi(t.barSize,e);r.setAttribute("linethickness",Mt(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var a=new Lt("mo",[new Yi(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var s=new Lt("mo",[new Yi(t.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return WV(i)}return r},Bge=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};Pt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1],s,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=n==="\\cfrac",h=null;return u||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),Bge({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:trt,mathmlBuilder:rrt});Pt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var $Z=["display","text","script","scriptscript"],PZ=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};Pt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],a=jA(e[0]),s=a.type==="atom"&&a.family==="open"?PZ(a.text):null,o=jA(e[1]),l=o.type==="atom"&&o.family==="close"?PZ(o.text):null,u=Pr(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f=null,p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=Pr(p.body[0],"textord");f=$Z[Number(g.text)]}}else p=Pr(p,"textord"),f=$Z[Number(p.text)];return Bge({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},f)}});Pt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Pr(e[0],"size").value,token:i}}});Pt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=Pr(e[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var s=e[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null}}});var Fge=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?vn(t.sup,e.havingStyle(r.sup()),e):vn(t.sub,e.havingStyle(r.sub()),e),i=Pr(t.base,"horizBrace")):i=Pr(t,"horizBrace");var a=vn(i.base,e.havingBaseStyle(Ir.DISPLAY)),s=RR(i,e),o;if(i.isOver?o=yn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=yn({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=St(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=yn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=yn({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return St(["minner",i.isOver?"mover":"munder"],[o],e)},nrt=(t,e)=>{var r=_R(t.label);return new Lt(t.isOver?"mover":"munder",[Dn(t.base,e),r])};Pt({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:Fge,mathmlBuilder:nrt});Pt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=Pr(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Ui(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=la(t.body,e,!1);return mtt(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=of(t.body,e);return r instanceof Lt||(r=new Lt("mrow",[r])),r.setAttribute("href",t.href),r}});Pt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=Pr(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:r,funcName:n,token:i}=t,a=Pr(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),h=0;h{var r=la(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=St(n,r,e);for(var a in t.attributes)a!=="class"&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i},mathmlBuilder:(t,e)=>of(t.body,e)});Pt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:Ui(e[0]),mathml:Ui(e[1])}},htmlBuilder:(t,e)=>{var r=la(t.html,e,!1);return Fh(r)},mathmlBuilder:(t,e)=>of(t.mathml,e)});var gI=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new _t("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!tge(n))throw new _t("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Pt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(r[0])for(var l=Pr(r[0],"raw").string,u=l.split(","),h=0;h{var r=fi(t.height,e),n=0;t.totalheight.number>0&&(n=fi(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=fi(t.width,e));var a={height:Mt(r+n)};i>0&&(a.width=Mt(i)),n>0&&(a.verticalAlign=Mt(-n));var s=new att(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new Lt("mglyph",[]);r.setAttribute("alt",t.alt);var n=fi(t.height,e),i=0;if(t.totalheight.number>0&&(i=fi(t.totalheight,e)-n,r.setAttribute("valign",Mt(-i))),r.setAttribute("height",Mt(n+i)),t.width.number>0){var a=fi(t.width,e);r.setAttribute("width",Mt(a))}return r.setAttribute("src",t.src),r}});Pt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=Pr(e[0],"size");if(r.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return lge(t.dimension,e)},mathmlBuilder(t,e){var r=fi(t.dimension,e);return new pge(r)}});Pt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=St([],[vn(t.body,e)]),r=St(["inner"],[r],e)):r=St(["inner"],[vn(t.body,e)]);var n=St(["fix"],[]),i=St([t.alignment],[r,n],e),a=St(["strut"]);return a.style.height=Mt(i.height+i.depth),i.depth&&(a.style.verticalAlign=Mt(-i.depth)),i.children.unshift(a),i=St(["thinbox"],[i],e),St(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new Lt("mpadded",[Dn(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}});Pt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:s}}});Pt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new _t("Mismatched "+t.funcName)}});var BZ=(t,e)=>{switch(e.style.size){case Ir.DISPLAY.size:return t.display;case Ir.TEXT.size:return t.text;case Ir.SCRIPT.size:return t.script;case Ir.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Pt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:Ui(e[0]),text:Ui(e[1]),script:Ui(e[2]),scriptscript:Ui(e[3])}},htmlBuilder:(t,e)=>{var r=BZ(t,e),n=la(r,e,!1);return Fh(n)},mathmlBuilder:(t,e)=>{var r=BZ(t,e);return of(r,e)}});var zge=(t,e,r,n,i,a,s)=>{t=St([],[t]);var o=r&&Ph(r),l,u;if(e){var h=vn(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=vn(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+s;f=yn({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Mt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Mt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-s;f=yn({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Mt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+s;f=yn({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Mt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var y=[f];if(l&&a!==0&&!o){var v=St(["mspace"],[],n);v.style.marginRight=Mt(a),y.unshift(v)}return St(["mop","op-limits"],y,n)},Vge=new Set(["\\smallint"]),Sx=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Pr(t.base,"op"),i=!0):a=Pr(t,"op");var s=e.style,o=!1;s.size===Ir.DISPLAY.size&&a.symbol&&!Vge.has(a.name)&&(o=!0);var l,u;if(a.symbol){var h=o?"Size2-Regular":"Size1-Regular",d="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(d=a.name.slice(1),a.name=d==="oiint"?"\\iint":"\\iiint"),l=Ls(a.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=uge(d+"Size"+(o?"2":"1"),e);l=yn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),a.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=la(a.body,e,!0);p.length===1&&p[0]instanceof zo?(l=p[0],l.classes[0]="mop"):l=St(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new Lt("mo",[xl(t.name,t.mode)]),Vge.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new Lt("mo",Uo(t.body,e));else{r=new Lt("mi",[new Yi(t.name.slice(1))]);var n=new Lt("mo",[xl("⁡","text")]);t.parentIsSupSub?r=new Lt("mrow",[r,n]):r=fge([r,n])}return r},irt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Pt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=irt[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Sx,mathmlBuilder:aS});Pt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Ui(n)}},htmlBuilder:Sx,mathmlBuilder:aS});var art={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Pt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:Sx,mathmlBuilder:aS});Pt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:Sx,mathmlBuilder:aS});Pt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=art[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:Sx,mathmlBuilder:aS});var Gge=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Pr(t.base,"operatorname"),i=!0):a=Pr(t,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var f="text"in d?d.text:void 0;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=la(o,e.withFont("mathrm"),!0),u=0;u{for(var r=Uo(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new Yi(o)]}var l=new Lt("mi",r);l.setAttribute("mathvariant","normal");var u=new Lt("mo",[xl("⁡","text")]);return t.parentIsSupSub?new Lt("mrow",[l,u]):fge([l,u])};Pt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:Ui(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Gge,mathmlBuilder:srt});we("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");og({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Fh(la(t.body,e,!1)):St(["mord"],la(t.body,e,!0),e)},mathmlBuilder(t,e){return of(t.body,e,!0)}});Pt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=vn(t.body,e.havingCrampedStyle()),n=Db("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=yn({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return St(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new Lt("mo",[new Yi("‾")]);r.setAttribute("stretchy","true");var n=new Lt("mover",[Dn(t.body,e),r]);return n.setAttribute("accent","true"),n}});Pt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:Ui(n)}},htmlBuilder:(t,e)=>{var r=la(t.body,e.withPhantom(),!1);return Fh(r)},mathmlBuilder:(t,e)=>{var r=Uo(t.body,e);return new Lt("mphantom",r)}});we("\\hphantom","\\smash{\\phantom{#1}}");Pt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=St(["inner"],[vn(t.body,e.withPhantom())]),n=St(["fix"],[]);return St(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=Uo(Ui(t.body),e),n=new Lt("mphantom",r),i=new Lt("mpadded",[n]);return i.setAttribute("width","0px"),i}});Pt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=Pr(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=vn(t.body,e),n=fi(t.dy,e);return yn({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Lt("mpadded",[Dn(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});Pt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});Pt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=Pr(e[0],"size"),s=Pr(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&Pr(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=St(["mord","rule"],[],e),n=fi(t.width,e),i=fi(t.height,e),a=t.shift?fi(t.shift,e):0;return r.style.borderRightWidth=Mt(n),r.style.borderTopWidth=Mt(i),r.style.bottom=Mt(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=fi(t.width,e),n=fi(t.height,e),i=t.shift?fi(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new Lt("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",Mt(r)),s.setAttribute("height",Mt(n));var o=new Lt("mpadded",[s]);return i>=0?o.setAttribute("height",Mt(i)):(o.setAttribute("height",Mt(i)),o.setAttribute("depth",Mt(-i))),o.setAttribute("voffset",Mt(i)),o}});function Wge(t,e,r){for(var n=la(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return Wge(t.body,r,e)};Pt({type:"sizing",names:FZ,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:FZ.indexOf(n)+1,body:a}},htmlBuilder:ort,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=Uo(t.body,r),i=new Lt("mstyle",n);return i.setAttribute("mathsize",Mt(r.sizeMultiplier)),i}});Pt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&Pr(r[0],"ordgroup");if(s)for(var o,l=0;l{var r=St([],[vn(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0),t.smashDepth&&(r.depth=0),t.smashHeight&&t.smashDepth)return St(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new Lt("mpadded",[Dn(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});Pt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=vn(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=Ob(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+s&&(s=(s+d-r.height-r.depth)/2);var f=l.height-r.height-s-u;r.style.paddingLeft=Mt(h);var p=yn({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]});if(t.index){var g=e.havingStyle(Ir.SCRIPTSCRIPT),m=vn(t.index,g,e),y=.6*(p.height-p.depth),v=yn({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]}),T=St(["root"],[v]);return St(["mord","sqrt"],[T,p],e)}else return St(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new Lt("mroot",[Dn(r,e),Dn(n,e)]):new Lt("msqrt",[Dn(r,e)])}});var u$={display:Ir.DISPLAY,text:Ir.TEXT,script:Ir.SCRIPT,scriptscript:Ir.SCRIPTSCRIPT};function lrt(t){return t in u$}Pt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);if(!lrt(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=u$[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),Wge(t.body,n,e)},mathmlBuilder(t,e){var r=u$[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=Uo(t.body,n),a=new Lt("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[t.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var crt=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Ir.DISPLAY.size||n.alwaysHandleSupSub);return i?Sx:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Ir.DISPLAY.size||n.limits);return a?Gge:null}else{if(n.type==="accent")return Ph(n.base)?qV:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?Fge:null}else return null}else return null};og({type:"supsub",htmlBuilder(t,e){var r=crt(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=vn(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&Ph(n);if(i){var p=e.havingStyle(e.style.sup());o=vn(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=vn(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Ir.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=Mt(.5/u.ptPerEm/y),T=null;if(l){var b=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(s instanceof zo||b){var w;T=Mt(-((w=s.italic)!=null?w:0))}}var C;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var S=u.defaultRuleThickness,k=4*S;if(h-o.depth-(l.height-d)0&&(h+=E,d-=E)}var _=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:T},{type:"elem",elem:o,shift:-h,marginRight:v}];C=yn({positionType:"individualShift",children:_})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var M=[{type:"elem",elem:l,marginLeft:T,marginRight:v}];C=yn({positionType:"shift",positionData:d,children:M})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),C=yn({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var L=a$(s,"right")||"mord";return St([L],[s,St(["msupsub"],[C])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var a=[Dn(t.base,e)];t.sub&&a.push(Dn(t.sub,e)),t.sup&&a.push(Dn(t.sup,e));var s;if(r)s=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===Ir.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Ir.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Ir.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Ir.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===Ir.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Ir.DISPLAY)?s="mover":s="msup"}return new Lt(s,a)}});og({type:"atom",htmlBuilder(t,e){return VV(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new Lt("mo",[xl(t.text,t.mode)]);if(t.family==="bin"){var n=HV(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var Hge={mi:"italic",mn:"normal",mtext:"normal"};og({type:"mathord",htmlBuilder(t,e){return AR(t,e,"mathord")},mathmlBuilder(t,e){var r=new Lt("mi",[xl(t.text,t.mode,e)]),n=HV(t,e)||"italic";return n!==Hge[r.type]&&r.setAttribute("mathvariant",n),r}});og({type:"textord",htmlBuilder(t,e){return AR(t,e,"textord")},mathmlBuilder(t,e){var r=xl(t.text,t.mode,e),n=HV(t,e)||"normal",i;return t.mode==="text"?i=new Lt("mtext",[r]):/[0-9]/.test(t.text)?i=new Lt("mn",[r]):t.text==="\\prime"?i=new Lt("mo",[r]):i=new Lt("mi",[r]),n!==Hge[i.type]&&i.setAttribute("mathvariant",n),i}});var mI={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},yI={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};og({type:"spacing",htmlBuilder(t,e){if(yI.hasOwnProperty(t.text)){var r=yI[t.text].className||"";if(t.mode==="text"){var n=AR(t,e,"textord");return n.classes.push(r),n}else return St(["mspace",r],[VV(t.text,t.mode,e)],e)}else{if(mI.hasOwnProperty(t.text))return St(["mspace",mI[t.text]],[],e);throw new _t('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(yI.hasOwnProperty(t.text))r=new Lt("mtext",[new Yi(" ")]);else{if(mI.hasOwnProperty(t.text))return new Lt("mspace");throw new _t('Unknown type of space "'+t.text+'"')}return r}});var zZ=()=>{var t=new Lt("mtd",[]);return t.setAttribute("width","50%"),t};og({type:"tag",mathmlBuilder(t,e){var r=new Lt("mtable",[new Lt("mtr",[zZ(),new Lt("mtd",[of(t.body,e)]),zZ(),new Lt("mtd",[of(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var VZ={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},GZ={"\\textbf":"textbf","\\textmd":"textmd"},urt={"\\textit":"textit","\\textup":"textup"},WZ=(t,e)=>{var r=t.font;if(r){if(VZ[r])return e.withTextFontFamily(VZ[r]);if(GZ[r])return e.withTextFontWeight(GZ[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(urt[r])};Pt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:Ui(i),font:n}},htmlBuilder(t,e){var r=WZ(t,e),n=la(t.body,r,!0);return St(["mord","text"],n,r)},mathmlBuilder(t,e){var r=WZ(t,e);return of(t.body,r)}});Pt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=vn(t.body,e),n=Db("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=yn({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return St(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new Lt("mo",[new Yi("‾")]);r.setAttribute("stretchy","true");var n=new Lt("munder",[Dn(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});Pt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=vn(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return yn({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Lt("mpadded",[Dn(t.body,e)],["vcenter"]);return new Lt("mrow",[r])}});Pt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new _t("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=HZ(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),Md=hge,qge=`[ \r - ]`,hrt="\\\\[a-zA-Z@]+",drt="\\\\[^\uD800-\uDFFF]",frt="("+hrt+")"+qge+"*",prt=`\\\\( +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function att(t){return"toText"in t}class wx{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(att(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var jO={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},stt={ex:!0,em:!0,mu:!0},rge=function(e){return typeof e!="string"&&(e=e.unit),e in jO||e in stt||e==="ex"},fi=function(e,r){var n;if(e.unit in jO)n=jO[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new _t("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},Mt=function(e){return+e.toFixed(4)+"em"},nf=function(e){return e.filter(r=>r).join(" ")},FV=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=Det(n)+":"+i+";")}return r},nge=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},ige=function(e){var r=document.createElement(e);r.className=nf(this.classes),Object.assign(r.style,this.style);for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i/=\x00-\x1f]/,age=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+fs(nf(this.classes))+'"');var n=FV(this.style);n&&(r+=' style="'+fs(n)+'"');for(var i of Object.keys(this.attributes)){if(ott.test(i))throw new _t("Invalid attribute name '"+i+"'");r+=" "+i+'="'+fs(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class Cx{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,nge.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return ige.call(this,"span")}toMarkup(){return age.call(this,"span")}}let SR=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,nge.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return ige.call(this,"a")}toMarkup(){return age.call(this,"a")}};class ltt{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e=''+fs(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Mt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=nf(this.classes)),Object.keys(this.style).length>0&&(r=r||document.createElement("span"),Object.assign(r.style,this.style)),r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+Mt(this.italic)+";"),n+=FV(this.style),n&&(e=!0,r+=' style="'+fs(n)+'"');var i=fs(this.text);return e?(r+=">",r+=i,r+="",r):i}}class xh{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}}class KO{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var dtt=t=>t instanceof Cx||t instanceof SR||t instanceof wx,Bc={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},IE={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},pZ={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function sge(t,e){Bc[t]=e}function zV(t,e,r){if(!Bc[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=Bc[e][n];if(!i&&t[0]in pZ&&(n=pZ[t[0]].charCodeAt(0),i=Bc[e][n]),!i&&r==="text"&&tge(n)&&(i=Bc[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var nI={};function ftt(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!nI[e]){var r=nI[e]={cssEmPerMu:IE.quad[e]/18};for(var n in IE)IE.hasOwnProperty(n)&&(r[n]=IE[n][e])}return nI[e]}var li={math:{},text:{}};function U(t,e,r,n,i,a){li[t][i]={font:e,group:r,replace:n},a&&n&&(li[t][n]=li[t][i])}var re="math",Tt="text",ye="main",ze="ams",ui="accent-token",Vt="bin",Qs="close",kx="inner",hr="mathord",Qi="op-token",qo="open",iS="punct",We="rel",Bh="spacing",qe="textord";U(re,ye,We,"≡","\\equiv",!0);U(re,ye,We,"≺","\\prec",!0);U(re,ye,We,"≻","\\succ",!0);U(re,ye,We,"∼","\\sim",!0);U(re,ye,We,"⊥","\\perp");U(re,ye,We,"⪯","\\preceq",!0);U(re,ye,We,"⪰","\\succeq",!0);U(re,ye,We,"≃","\\simeq",!0);U(re,ye,We,"∣","\\mid",!0);U(re,ye,We,"≪","\\ll",!0);U(re,ye,We,"≫","\\gg",!0);U(re,ye,We,"≍","\\asymp",!0);U(re,ye,We,"∥","\\parallel");U(re,ye,We,"⋈","\\bowtie",!0);U(re,ye,We,"⌣","\\smile",!0);U(re,ye,We,"⊑","\\sqsubseteq",!0);U(re,ye,We,"⊒","\\sqsupseteq",!0);U(re,ye,We,"≐","\\doteq",!0);U(re,ye,We,"⌢","\\frown",!0);U(re,ye,We,"∋","\\ni",!0);U(re,ye,We,"∝","\\propto",!0);U(re,ye,We,"⊢","\\vdash",!0);U(re,ye,We,"⊣","\\dashv",!0);U(re,ye,We,"∋","\\owns");U(re,ye,iS,".","\\ldotp");U(re,ye,iS,"⋅","\\cdotp");U(re,ye,iS,"⋅","·");U(Tt,ye,qe,"⋅","·");U(re,ye,qe,"#","\\#");U(Tt,ye,qe,"#","\\#");U(re,ye,qe,"&","\\&");U(Tt,ye,qe,"&","\\&");U(re,ye,qe,"ℵ","\\aleph",!0);U(re,ye,qe,"∀","\\forall",!0);U(re,ye,qe,"ℏ","\\hbar",!0);U(re,ye,qe,"∃","\\exists",!0);U(re,ye,qe,"∇","\\nabla",!0);U(re,ye,qe,"♭","\\flat",!0);U(re,ye,qe,"ℓ","\\ell",!0);U(re,ye,qe,"♮","\\natural",!0);U(re,ye,qe,"♣","\\clubsuit",!0);U(re,ye,qe,"℘","\\wp",!0);U(re,ye,qe,"♯","\\sharp",!0);U(re,ye,qe,"♢","\\diamondsuit",!0);U(re,ye,qe,"ℜ","\\Re",!0);U(re,ye,qe,"♡","\\heartsuit",!0);U(re,ye,qe,"ℑ","\\Im",!0);U(re,ye,qe,"♠","\\spadesuit",!0);U(re,ye,qe,"§","\\S",!0);U(Tt,ye,qe,"§","\\S");U(re,ye,qe,"¶","\\P",!0);U(Tt,ye,qe,"¶","\\P");U(re,ye,qe,"†","\\dag");U(Tt,ye,qe,"†","\\dag");U(Tt,ye,qe,"†","\\textdagger");U(re,ye,qe,"‡","\\ddag");U(Tt,ye,qe,"‡","\\ddag");U(Tt,ye,qe,"‡","\\textdaggerdbl");U(re,ye,Qs,"⎱","\\rmoustache",!0);U(re,ye,qo,"⎰","\\lmoustache",!0);U(re,ye,Qs,"⟯","\\rgroup",!0);U(re,ye,qo,"⟮","\\lgroup",!0);U(re,ye,Vt,"∓","\\mp",!0);U(re,ye,Vt,"⊖","\\ominus",!0);U(re,ye,Vt,"⊎","\\uplus",!0);U(re,ye,Vt,"⊓","\\sqcap",!0);U(re,ye,Vt,"∗","\\ast");U(re,ye,Vt,"⊔","\\sqcup",!0);U(re,ye,Vt,"◯","\\bigcirc",!0);U(re,ye,Vt,"∙","\\bullet",!0);U(re,ye,Vt,"‡","\\ddagger");U(re,ye,Vt,"≀","\\wr",!0);U(re,ye,Vt,"⨿","\\amalg");U(re,ye,Vt,"&","\\And");U(re,ye,We,"⟵","\\longleftarrow",!0);U(re,ye,We,"⇐","\\Leftarrow",!0);U(re,ye,We,"⟸","\\Longleftarrow",!0);U(re,ye,We,"⟶","\\longrightarrow",!0);U(re,ye,We,"⇒","\\Rightarrow",!0);U(re,ye,We,"⟹","\\Longrightarrow",!0);U(re,ye,We,"↔","\\leftrightarrow",!0);U(re,ye,We,"⟷","\\longleftrightarrow",!0);U(re,ye,We,"⇔","\\Leftrightarrow",!0);U(re,ye,We,"⟺","\\Longleftrightarrow",!0);U(re,ye,We,"↦","\\mapsto",!0);U(re,ye,We,"⟼","\\longmapsto",!0);U(re,ye,We,"↗","\\nearrow",!0);U(re,ye,We,"↩","\\hookleftarrow",!0);U(re,ye,We,"↪","\\hookrightarrow",!0);U(re,ye,We,"↘","\\searrow",!0);U(re,ye,We,"↼","\\leftharpoonup",!0);U(re,ye,We,"⇀","\\rightharpoonup",!0);U(re,ye,We,"↙","\\swarrow",!0);U(re,ye,We,"↽","\\leftharpoondown",!0);U(re,ye,We,"⇁","\\rightharpoondown",!0);U(re,ye,We,"↖","\\nwarrow",!0);U(re,ye,We,"⇌","\\rightleftharpoons",!0);U(re,ze,We,"≮","\\nless",!0);U(re,ze,We,"","\\@nleqslant");U(re,ze,We,"","\\@nleqq");U(re,ze,We,"⪇","\\lneq",!0);U(re,ze,We,"≨","\\lneqq",!0);U(re,ze,We,"","\\@lvertneqq");U(re,ze,We,"⋦","\\lnsim",!0);U(re,ze,We,"⪉","\\lnapprox",!0);U(re,ze,We,"⊀","\\nprec",!0);U(re,ze,We,"⋠","\\npreceq",!0);U(re,ze,We,"⋨","\\precnsim",!0);U(re,ze,We,"⪹","\\precnapprox",!0);U(re,ze,We,"≁","\\nsim",!0);U(re,ze,We,"","\\@nshortmid");U(re,ze,We,"∤","\\nmid",!0);U(re,ze,We,"⊬","\\nvdash",!0);U(re,ze,We,"⊭","\\nvDash",!0);U(re,ze,We,"⋪","\\ntriangleleft");U(re,ze,We,"⋬","\\ntrianglelefteq",!0);U(re,ze,We,"⊊","\\subsetneq",!0);U(re,ze,We,"","\\@varsubsetneq");U(re,ze,We,"⫋","\\subsetneqq",!0);U(re,ze,We,"","\\@varsubsetneqq");U(re,ze,We,"≯","\\ngtr",!0);U(re,ze,We,"","\\@ngeqslant");U(re,ze,We,"","\\@ngeqq");U(re,ze,We,"⪈","\\gneq",!0);U(re,ze,We,"≩","\\gneqq",!0);U(re,ze,We,"","\\@gvertneqq");U(re,ze,We,"⋧","\\gnsim",!0);U(re,ze,We,"⪊","\\gnapprox",!0);U(re,ze,We,"⊁","\\nsucc",!0);U(re,ze,We,"⋡","\\nsucceq",!0);U(re,ze,We,"⋩","\\succnsim",!0);U(re,ze,We,"⪺","\\succnapprox",!0);U(re,ze,We,"≆","\\ncong",!0);U(re,ze,We,"","\\@nshortparallel");U(re,ze,We,"∦","\\nparallel",!0);U(re,ze,We,"⊯","\\nVDash",!0);U(re,ze,We,"⋫","\\ntriangleright");U(re,ze,We,"⋭","\\ntrianglerighteq",!0);U(re,ze,We,"","\\@nsupseteqq");U(re,ze,We,"⊋","\\supsetneq",!0);U(re,ze,We,"","\\@varsupsetneq");U(re,ze,We,"⫌","\\supsetneqq",!0);U(re,ze,We,"","\\@varsupsetneqq");U(re,ze,We,"⊮","\\nVdash",!0);U(re,ze,We,"⪵","\\precneqq",!0);U(re,ze,We,"⪶","\\succneqq",!0);U(re,ze,We,"","\\@nsubseteqq");U(re,ze,Vt,"⊴","\\unlhd");U(re,ze,Vt,"⊵","\\unrhd");U(re,ze,We,"↚","\\nleftarrow",!0);U(re,ze,We,"↛","\\nrightarrow",!0);U(re,ze,We,"⇍","\\nLeftarrow",!0);U(re,ze,We,"⇏","\\nRightarrow",!0);U(re,ze,We,"↮","\\nleftrightarrow",!0);U(re,ze,We,"⇎","\\nLeftrightarrow",!0);U(re,ze,We,"△","\\vartriangle");U(re,ze,qe,"ℏ","\\hslash");U(re,ze,qe,"▽","\\triangledown");U(re,ze,qe,"◊","\\lozenge");U(re,ze,qe,"Ⓢ","\\circledS");U(re,ze,qe,"®","\\circledR");U(Tt,ze,qe,"®","\\circledR");U(re,ze,qe,"∡","\\measuredangle",!0);U(re,ze,qe,"∄","\\nexists");U(re,ze,qe,"℧","\\mho");U(re,ze,qe,"Ⅎ","\\Finv",!0);U(re,ze,qe,"⅁","\\Game",!0);U(re,ze,qe,"‵","\\backprime");U(re,ze,qe,"▲","\\blacktriangle");U(re,ze,qe,"▼","\\blacktriangledown");U(re,ze,qe,"■","\\blacksquare");U(re,ze,qe,"⧫","\\blacklozenge");U(re,ze,qe,"★","\\bigstar");U(re,ze,qe,"∢","\\sphericalangle",!0);U(re,ze,qe,"∁","\\complement",!0);U(re,ze,qe,"ð","\\eth",!0);U(Tt,ye,qe,"ð","ð");U(re,ze,qe,"╱","\\diagup");U(re,ze,qe,"╲","\\diagdown");U(re,ze,qe,"□","\\square");U(re,ze,qe,"□","\\Box");U(re,ze,qe,"◊","\\Diamond");U(re,ze,qe,"¥","\\yen",!0);U(Tt,ze,qe,"¥","\\yen",!0);U(re,ze,qe,"✓","\\checkmark",!0);U(Tt,ze,qe,"✓","\\checkmark");U(re,ze,qe,"ℶ","\\beth",!0);U(re,ze,qe,"ℸ","\\daleth",!0);U(re,ze,qe,"ℷ","\\gimel",!0);U(re,ze,qe,"ϝ","\\digamma",!0);U(re,ze,qe,"ϰ","\\varkappa");U(re,ze,qo,"┌","\\@ulcorner",!0);U(re,ze,Qs,"┐","\\@urcorner",!0);U(re,ze,qo,"└","\\@llcorner",!0);U(re,ze,Qs,"┘","\\@lrcorner",!0);U(re,ze,We,"≦","\\leqq",!0);U(re,ze,We,"⩽","\\leqslant",!0);U(re,ze,We,"⪕","\\eqslantless",!0);U(re,ze,We,"≲","\\lesssim",!0);U(re,ze,We,"⪅","\\lessapprox",!0);U(re,ze,We,"≊","\\approxeq",!0);U(re,ze,Vt,"⋖","\\lessdot");U(re,ze,We,"⋘","\\lll",!0);U(re,ze,We,"≶","\\lessgtr",!0);U(re,ze,We,"⋚","\\lesseqgtr",!0);U(re,ze,We,"⪋","\\lesseqqgtr",!0);U(re,ze,We,"≑","\\doteqdot");U(re,ze,We,"≓","\\risingdotseq",!0);U(re,ze,We,"≒","\\fallingdotseq",!0);U(re,ze,We,"∽","\\backsim",!0);U(re,ze,We,"⋍","\\backsimeq",!0);U(re,ze,We,"⫅","\\subseteqq",!0);U(re,ze,We,"⋐","\\Subset",!0);U(re,ze,We,"⊏","\\sqsubset",!0);U(re,ze,We,"≼","\\preccurlyeq",!0);U(re,ze,We,"⋞","\\curlyeqprec",!0);U(re,ze,We,"≾","\\precsim",!0);U(re,ze,We,"⪷","\\precapprox",!0);U(re,ze,We,"⊲","\\vartriangleleft");U(re,ze,We,"⊴","\\trianglelefteq");U(re,ze,We,"⊨","\\vDash",!0);U(re,ze,We,"⊪","\\Vvdash",!0);U(re,ze,We,"⌣","\\smallsmile");U(re,ze,We,"⌢","\\smallfrown");U(re,ze,We,"≏","\\bumpeq",!0);U(re,ze,We,"≎","\\Bumpeq",!0);U(re,ze,We,"≧","\\geqq",!0);U(re,ze,We,"⩾","\\geqslant",!0);U(re,ze,We,"⪖","\\eqslantgtr",!0);U(re,ze,We,"≳","\\gtrsim",!0);U(re,ze,We,"⪆","\\gtrapprox",!0);U(re,ze,Vt,"⋗","\\gtrdot");U(re,ze,We,"⋙","\\ggg",!0);U(re,ze,We,"≷","\\gtrless",!0);U(re,ze,We,"⋛","\\gtreqless",!0);U(re,ze,We,"⪌","\\gtreqqless",!0);U(re,ze,We,"≖","\\eqcirc",!0);U(re,ze,We,"≗","\\circeq",!0);U(re,ze,We,"≜","\\triangleq",!0);U(re,ze,We,"∼","\\thicksim");U(re,ze,We,"≈","\\thickapprox");U(re,ze,We,"⫆","\\supseteqq",!0);U(re,ze,We,"⋑","\\Supset",!0);U(re,ze,We,"⊐","\\sqsupset",!0);U(re,ze,We,"≽","\\succcurlyeq",!0);U(re,ze,We,"⋟","\\curlyeqsucc",!0);U(re,ze,We,"≿","\\succsim",!0);U(re,ze,We,"⪸","\\succapprox",!0);U(re,ze,We,"⊳","\\vartriangleright");U(re,ze,We,"⊵","\\trianglerighteq");U(re,ze,We,"⊩","\\Vdash",!0);U(re,ze,We,"∣","\\shortmid");U(re,ze,We,"∥","\\shortparallel");U(re,ze,We,"≬","\\between",!0);U(re,ze,We,"⋔","\\pitchfork",!0);U(re,ze,We,"∝","\\varpropto");U(re,ze,We,"◀","\\blacktriangleleft");U(re,ze,We,"∴","\\therefore",!0);U(re,ze,We,"∍","\\backepsilon");U(re,ze,We,"▶","\\blacktriangleright");U(re,ze,We,"∵","\\because",!0);U(re,ze,We,"⋘","\\llless");U(re,ze,We,"⋙","\\gggtr");U(re,ze,Vt,"⊲","\\lhd");U(re,ze,Vt,"⊳","\\rhd");U(re,ze,We,"≂","\\eqsim",!0);U(re,ye,We,"⋈","\\Join");U(re,ze,We,"≑","\\Doteq",!0);U(re,ze,Vt,"∔","\\dotplus",!0);U(re,ze,Vt,"∖","\\smallsetminus");U(re,ze,Vt,"⋒","\\Cap",!0);U(re,ze,Vt,"⋓","\\Cup",!0);U(re,ze,Vt,"⩞","\\doublebarwedge",!0);U(re,ze,Vt,"⊟","\\boxminus",!0);U(re,ze,Vt,"⊞","\\boxplus",!0);U(re,ze,Vt,"⋇","\\divideontimes",!0);U(re,ze,Vt,"⋉","\\ltimes",!0);U(re,ze,Vt,"⋊","\\rtimes",!0);U(re,ze,Vt,"⋋","\\leftthreetimes",!0);U(re,ze,Vt,"⋌","\\rightthreetimes",!0);U(re,ze,Vt,"⋏","\\curlywedge",!0);U(re,ze,Vt,"⋎","\\curlyvee",!0);U(re,ze,Vt,"⊝","\\circleddash",!0);U(re,ze,Vt,"⊛","\\circledast",!0);U(re,ze,Vt,"⋅","\\centerdot");U(re,ze,Vt,"⊺","\\intercal",!0);U(re,ze,Vt,"⋒","\\doublecap");U(re,ze,Vt,"⋓","\\doublecup");U(re,ze,Vt,"⊠","\\boxtimes",!0);U(re,ze,We,"⇢","\\dashrightarrow",!0);U(re,ze,We,"⇠","\\dashleftarrow",!0);U(re,ze,We,"⇇","\\leftleftarrows",!0);U(re,ze,We,"⇆","\\leftrightarrows",!0);U(re,ze,We,"⇚","\\Lleftarrow",!0);U(re,ze,We,"↞","\\twoheadleftarrow",!0);U(re,ze,We,"↢","\\leftarrowtail",!0);U(re,ze,We,"↫","\\looparrowleft",!0);U(re,ze,We,"⇋","\\leftrightharpoons",!0);U(re,ze,We,"↶","\\curvearrowleft",!0);U(re,ze,We,"↺","\\circlearrowleft",!0);U(re,ze,We,"↰","\\Lsh",!0);U(re,ze,We,"⇈","\\upuparrows",!0);U(re,ze,We,"↿","\\upharpoonleft",!0);U(re,ze,We,"⇃","\\downharpoonleft",!0);U(re,ye,We,"⊶","\\origof",!0);U(re,ye,We,"⊷","\\imageof",!0);U(re,ze,We,"⊸","\\multimap",!0);U(re,ze,We,"↭","\\leftrightsquigarrow",!0);U(re,ze,We,"⇉","\\rightrightarrows",!0);U(re,ze,We,"⇄","\\rightleftarrows",!0);U(re,ze,We,"↠","\\twoheadrightarrow",!0);U(re,ze,We,"↣","\\rightarrowtail",!0);U(re,ze,We,"↬","\\looparrowright",!0);U(re,ze,We,"↷","\\curvearrowright",!0);U(re,ze,We,"↻","\\circlearrowright",!0);U(re,ze,We,"↱","\\Rsh",!0);U(re,ze,We,"⇊","\\downdownarrows",!0);U(re,ze,We,"↾","\\upharpoonright",!0);U(re,ze,We,"⇂","\\downharpoonright",!0);U(re,ze,We,"⇝","\\rightsquigarrow",!0);U(re,ze,We,"⇝","\\leadsto");U(re,ze,We,"⇛","\\Rrightarrow",!0);U(re,ze,We,"↾","\\restriction");U(re,ye,qe,"‘","`");U(re,ye,qe,"$","\\$");U(Tt,ye,qe,"$","\\$");U(Tt,ye,qe,"$","\\textdollar");U(re,ye,qe,"%","\\%");U(Tt,ye,qe,"%","\\%");U(re,ye,qe,"_","\\_");U(Tt,ye,qe,"_","\\_");U(Tt,ye,qe,"_","\\textunderscore");U(re,ye,qe,"∠","\\angle",!0);U(re,ye,qe,"∞","\\infty",!0);U(re,ye,qe,"′","\\prime");U(re,ye,qe,"△","\\triangle");U(re,ye,qe,"Γ","\\Gamma",!0);U(re,ye,qe,"Δ","\\Delta",!0);U(re,ye,qe,"Θ","\\Theta",!0);U(re,ye,qe,"Λ","\\Lambda",!0);U(re,ye,qe,"Ξ","\\Xi",!0);U(re,ye,qe,"Π","\\Pi",!0);U(re,ye,qe,"Σ","\\Sigma",!0);U(re,ye,qe,"Υ","\\Upsilon",!0);U(re,ye,qe,"Φ","\\Phi",!0);U(re,ye,qe,"Ψ","\\Psi",!0);U(re,ye,qe,"Ω","\\Omega",!0);U(re,ye,qe,"A","Α");U(re,ye,qe,"B","Β");U(re,ye,qe,"E","Ε");U(re,ye,qe,"Z","Ζ");U(re,ye,qe,"H","Η");U(re,ye,qe,"I","Ι");U(re,ye,qe,"K","Κ");U(re,ye,qe,"M","Μ");U(re,ye,qe,"N","Ν");U(re,ye,qe,"O","Ο");U(re,ye,qe,"P","Ρ");U(re,ye,qe,"T","Τ");U(re,ye,qe,"X","Χ");U(re,ye,qe,"¬","\\neg",!0);U(re,ye,qe,"¬","\\lnot");U(re,ye,qe,"⊤","\\top");U(re,ye,qe,"⊥","\\bot");U(re,ye,qe,"∅","\\emptyset");U(re,ze,qe,"∅","\\varnothing");U(re,ye,hr,"α","\\alpha",!0);U(re,ye,hr,"β","\\beta",!0);U(re,ye,hr,"γ","\\gamma",!0);U(re,ye,hr,"δ","\\delta",!0);U(re,ye,hr,"ϵ","\\epsilon",!0);U(re,ye,hr,"ζ","\\zeta",!0);U(re,ye,hr,"η","\\eta",!0);U(re,ye,hr,"θ","\\theta",!0);U(re,ye,hr,"ι","\\iota",!0);U(re,ye,hr,"κ","\\kappa",!0);U(re,ye,hr,"λ","\\lambda",!0);U(re,ye,hr,"μ","\\mu",!0);U(re,ye,hr,"ν","\\nu",!0);U(re,ye,hr,"ξ","\\xi",!0);U(re,ye,hr,"ο","\\omicron",!0);U(re,ye,hr,"π","\\pi",!0);U(re,ye,hr,"ρ","\\rho",!0);U(re,ye,hr,"σ","\\sigma",!0);U(re,ye,hr,"τ","\\tau",!0);U(re,ye,hr,"υ","\\upsilon",!0);U(re,ye,hr,"ϕ","\\phi",!0);U(re,ye,hr,"χ","\\chi",!0);U(re,ye,hr,"ψ","\\psi",!0);U(re,ye,hr,"ω","\\omega",!0);U(re,ye,hr,"ε","\\varepsilon",!0);U(re,ye,hr,"ϑ","\\vartheta",!0);U(re,ye,hr,"ϖ","\\varpi",!0);U(re,ye,hr,"ϱ","\\varrho",!0);U(re,ye,hr,"ς","\\varsigma",!0);U(re,ye,hr,"φ","\\varphi",!0);U(re,ye,Vt,"∗","*",!0);U(re,ye,Vt,"+","+");U(re,ye,Vt,"−","-",!0);U(re,ye,Vt,"⋅","\\cdot",!0);U(re,ye,Vt,"∘","\\circ",!0);U(re,ye,Vt,"÷","\\div",!0);U(re,ye,Vt,"±","\\pm",!0);U(re,ye,Vt,"×","\\times",!0);U(re,ye,Vt,"∩","\\cap",!0);U(re,ye,Vt,"∪","\\cup",!0);U(re,ye,Vt,"∖","\\setminus",!0);U(re,ye,Vt,"∧","\\land");U(re,ye,Vt,"∨","\\lor");U(re,ye,Vt,"∧","\\wedge",!0);U(re,ye,Vt,"∨","\\vee",!0);U(re,ye,qe,"√","\\surd");U(re,ye,qo,"⟨","\\langle",!0);U(re,ye,qo,"∣","\\lvert");U(re,ye,qo,"∥","\\lVert");U(re,ye,Qs,"?","?");U(re,ye,Qs,"!","!");U(re,ye,Qs,"⟩","\\rangle",!0);U(re,ye,Qs,"∣","\\rvert");U(re,ye,Qs,"∥","\\rVert");U(re,ye,We,"=","=");U(re,ye,We,":",":");U(re,ye,We,"≈","\\approx",!0);U(re,ye,We,"≅","\\cong",!0);U(re,ye,We,"≥","\\ge");U(re,ye,We,"≥","\\geq",!0);U(re,ye,We,"←","\\gets");U(re,ye,We,">","\\gt",!0);U(re,ye,We,"∈","\\in",!0);U(re,ye,We,"","\\@not");U(re,ye,We,"⊂","\\subset",!0);U(re,ye,We,"⊃","\\supset",!0);U(re,ye,We,"⊆","\\subseteq",!0);U(re,ye,We,"⊇","\\supseteq",!0);U(re,ze,We,"⊈","\\nsubseteq",!0);U(re,ze,We,"⊉","\\nsupseteq",!0);U(re,ye,We,"⊨","\\models");U(re,ye,We,"←","\\leftarrow",!0);U(re,ye,We,"≤","\\le");U(re,ye,We,"≤","\\leq",!0);U(re,ye,We,"<","\\lt",!0);U(re,ye,We,"→","\\rightarrow",!0);U(re,ye,We,"→","\\to");U(re,ze,We,"≱","\\ngeq",!0);U(re,ze,We,"≰","\\nleq",!0);U(re,ye,Bh," ","\\ ");U(re,ye,Bh," ","\\space");U(re,ye,Bh," ","\\nobreakspace");U(Tt,ye,Bh," ","\\ ");U(Tt,ye,Bh," "," ");U(Tt,ye,Bh," ","\\space");U(Tt,ye,Bh," ","\\nobreakspace");U(re,ye,Bh,"","\\nobreak");U(re,ye,Bh,"","\\allowbreak");U(re,ye,iS,",",",");U(re,ye,iS,";",";");U(re,ze,Vt,"⊼","\\barwedge",!0);U(re,ze,Vt,"⊻","\\veebar",!0);U(re,ye,Vt,"⊙","\\odot",!0);U(re,ye,Vt,"⊕","\\oplus",!0);U(re,ye,Vt,"⊗","\\otimes",!0);U(re,ye,qe,"∂","\\partial",!0);U(re,ye,Vt,"⊘","\\oslash",!0);U(re,ze,Vt,"⊚","\\circledcirc",!0);U(re,ze,Vt,"⊡","\\boxdot",!0);U(re,ye,Vt,"△","\\bigtriangleup");U(re,ye,Vt,"▽","\\bigtriangledown");U(re,ye,Vt,"†","\\dagger");U(re,ye,Vt,"⋄","\\diamond");U(re,ye,Vt,"⋆","\\star");U(re,ye,Vt,"◃","\\triangleleft");U(re,ye,Vt,"▹","\\triangleright");U(re,ye,qo,"{","\\{");U(Tt,ye,qe,"{","\\{");U(Tt,ye,qe,"{","\\textbraceleft");U(re,ye,Qs,"}","\\}");U(Tt,ye,qe,"}","\\}");U(Tt,ye,qe,"}","\\textbraceright");U(re,ye,qo,"{","\\lbrace");U(re,ye,Qs,"}","\\rbrace");U(re,ye,qo,"[","\\lbrack",!0);U(Tt,ye,qe,"[","\\lbrack",!0);U(re,ye,Qs,"]","\\rbrack",!0);U(Tt,ye,qe,"]","\\rbrack",!0);U(re,ye,qo,"(","\\lparen",!0);U(re,ye,Qs,")","\\rparen",!0);U(Tt,ye,qe,"<","\\textless",!0);U(Tt,ye,qe,">","\\textgreater",!0);U(re,ye,qo,"⌊","\\lfloor",!0);U(re,ye,Qs,"⌋","\\rfloor",!0);U(re,ye,qo,"⌈","\\lceil",!0);U(re,ye,Qs,"⌉","\\rceil",!0);U(re,ye,qe,"\\","\\backslash");U(re,ye,qe,"∣","|");U(re,ye,qe,"∣","\\vert");U(Tt,ye,qe,"|","\\textbar",!0);U(re,ye,qe,"∥","\\|");U(re,ye,qe,"∥","\\Vert");U(Tt,ye,qe,"∥","\\textbardbl");U(Tt,ye,qe,"~","\\textasciitilde");U(Tt,ye,qe,"\\","\\textbackslash");U(Tt,ye,qe,"^","\\textasciicircum");U(re,ye,We,"↑","\\uparrow",!0);U(re,ye,We,"⇑","\\Uparrow",!0);U(re,ye,We,"↓","\\downarrow",!0);U(re,ye,We,"⇓","\\Downarrow",!0);U(re,ye,We,"↕","\\updownarrow",!0);U(re,ye,We,"⇕","\\Updownarrow",!0);U(re,ye,Qi,"∐","\\coprod");U(re,ye,Qi,"⋁","\\bigvee");U(re,ye,Qi,"⋀","\\bigwedge");U(re,ye,Qi,"⨄","\\biguplus");U(re,ye,Qi,"⋂","\\bigcap");U(re,ye,Qi,"⋃","\\bigcup");U(re,ye,Qi,"∫","\\int");U(re,ye,Qi,"∫","\\intop");U(re,ye,Qi,"∬","\\iint");U(re,ye,Qi,"∭","\\iiint");U(re,ye,Qi,"∏","\\prod");U(re,ye,Qi,"∑","\\sum");U(re,ye,Qi,"⨂","\\bigotimes");U(re,ye,Qi,"⨁","\\bigoplus");U(re,ye,Qi,"⨀","\\bigodot");U(re,ye,Qi,"∮","\\oint");U(re,ye,Qi,"∯","\\oiint");U(re,ye,Qi,"∰","\\oiiint");U(re,ye,Qi,"⨆","\\bigsqcup");U(re,ye,Qi,"∫","\\smallint");U(Tt,ye,kx,"…","\\textellipsis");U(re,ye,kx,"…","\\mathellipsis");U(Tt,ye,kx,"…","\\ldots",!0);U(re,ye,kx,"…","\\ldots",!0);U(re,ye,kx,"⋯","\\@cdots",!0);U(re,ye,kx,"⋱","\\ddots",!0);U(re,ye,qe,"⋮","\\varvdots");U(Tt,ye,qe,"⋮","\\varvdots");U(re,ye,ui,"ˊ","\\acute");U(re,ye,ui,"ˋ","\\grave");U(re,ye,ui,"¨","\\ddot");U(re,ye,ui,"~","\\tilde");U(re,ye,ui,"ˉ","\\bar");U(re,ye,ui,"˘","\\breve");U(re,ye,ui,"ˇ","\\check");U(re,ye,ui,"^","\\hat");U(re,ye,ui,"⃗","\\vec");U(re,ye,ui,"˙","\\dot");U(re,ye,ui,"˚","\\mathring");U(re,ye,hr,"","\\@imath");U(re,ye,hr,"","\\@jmath");U(re,ye,qe,"ı","ı");U(re,ye,qe,"ȷ","ȷ");U(Tt,ye,qe,"ı","\\i",!0);U(Tt,ye,qe,"ȷ","\\j",!0);U(Tt,ye,qe,"ß","\\ss",!0);U(Tt,ye,qe,"æ","\\ae",!0);U(Tt,ye,qe,"œ","\\oe",!0);U(Tt,ye,qe,"ø","\\o",!0);U(Tt,ye,qe,"Æ","\\AE",!0);U(Tt,ye,qe,"Œ","\\OE",!0);U(Tt,ye,qe,"Ø","\\O",!0);U(Tt,ye,ui,"ˊ","\\'");U(Tt,ye,ui,"ˋ","\\`");U(Tt,ye,ui,"ˆ","\\^");U(Tt,ye,ui,"˜","\\~");U(Tt,ye,ui,"ˉ","\\=");U(Tt,ye,ui,"˘","\\u");U(Tt,ye,ui,"˙","\\.");U(Tt,ye,ui,"¸","\\c");U(Tt,ye,ui,"˚","\\r");U(Tt,ye,ui,"ˇ","\\v");U(Tt,ye,ui,"¨",'\\"');U(Tt,ye,ui,"˝","\\H");U(Tt,ye,ui,"◯","\\textcircled");var oge={"--":!0,"---":!0,"``":!0,"''":!0};U(Tt,ye,qe,"–","--",!0);U(Tt,ye,qe,"–","\\textendash");U(Tt,ye,qe,"—","---",!0);U(Tt,ye,qe,"—","\\textemdash");U(Tt,ye,qe,"‘","`",!0);U(Tt,ye,qe,"‘","\\textquoteleft");U(Tt,ye,qe,"’","'",!0);U(Tt,ye,qe,"’","\\textquoteright");U(Tt,ye,qe,"“","``",!0);U(Tt,ye,qe,"“","\\textquotedblleft");U(Tt,ye,qe,"”","''",!0);U(Tt,ye,qe,"”","\\textquotedblright");U(re,ye,qe,"°","\\degree",!0);U(Tt,ye,qe,"°","\\degree");U(Tt,ye,qe,"°","\\textdegree",!0);U(re,ye,qe,"£","\\pounds");U(re,ye,qe,"£","\\mathsterling",!0);U(Tt,ye,qe,"£","\\pounds");U(Tt,ye,qe,"£","\\textsterling",!0);U(re,ze,qe,"✠","\\maltese");U(Tt,ze,qe,"✠","\\maltese");var gZ='0123456789/@."';for(var iI=0;iI{var e=t.charCodeAt(0),r=t.charCodeAt(1),n=(e-55296)*1024+(r-56320)+65536;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return SZ[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return gtt[a]}else{if(n===120485||n===120486)return SZ[0];if(120486{if(nf(t.classes)!==nf(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n of Object.keys(t.style))if(t.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(t.style[i]!==e.style[i])return!1;return!0},lge=t=>{for(var e=0;er&&(r=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},St=function(e,r,n,i){var a=new Cx(e,r,n,i);return GV(a),a},sf=(t,e,r,n)=>new Cx(t,e,r,n),Db=function(e,r,n){var i=St([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Mt(i.height),i.maxFontSize=1,i},btt=function(e,r,n,i){var a=new SR(e,r,n,i);return GV(a),a},Fh=function(e){var r=new wx(e);return GV(r),r},Ob=function(e,r){return e instanceof wx?St([],[e],r):e},xtt=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,s=1;s{var r=St(["mspace"],[],e),n=fi(t,e);return r.style.marginRight=Mt(n),r},OE=(t,e,r)=>{var n,i;switch(t){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=t}return e==="textbf"&&r==="textit"?i="BoldItalic":e==="textbf"?i="Bold":r==="textit"?i="Italic":i="Regular",n+"-"+i},r$={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},uge={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},hge=function(e,r){var[n,i,a]=uge[e],s=new af(n),o=new xh([s],{width:Mt(i),height:Mt(a),style:"width:"+Mt(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=sf(["overlay"],[o],r);return l.height=a,l.style.height=Mt(a),l.style.width=Mt(i),l},di={number:3,unit:"mu"},Yf={number:4,unit:"mu"},Ru={number:5,unit:"mu"},Ttt={mord:{mop:di,mbin:Yf,mrel:Ru,minner:di},mop:{mord:di,mop:di,mrel:Ru,minner:di},mbin:{mord:Yf,mop:Yf,mopen:Yf,minner:Yf},mrel:{mord:Ru,mop:Ru,mopen:Ru,minner:Ru},mopen:{},mclose:{mop:di,mbin:Yf,mrel:Ru,minner:di},mpunct:{mord:di,mop:di,mrel:Ru,mopen:di,mclose:di,mpunct:di,minner:di},minner:{mord:di,mop:di,mbin:Yf,mrel:Ru,mopen:di,mpunct:di,minner:di}},wtt={mord:{mop:di},mop:{mord:di,mop:di},mbin:{},mrel:{},mopen:{},mclose:{mop:di},mpunct:{},minner:{mop:di}},dge={},YA={},XA={};function Pt(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var y=m.classes[0],v=g.classes[0];y==="mbin"&&ktt.has(v)?m.classes[0]="mord":v==="mbin"&&Ctt.has(y)&&(g.classes[0]="mord")},{node:d},f,p),n$(a,(g,m)=>{var y,v,T=a$(m),b=a$(g),w=T&&b?g.hasClass("mtight")?(y=wtt[T])==null?void 0:y[b]:(v=Ttt[T])==null?void 0:v[b]:null;if(w)return cge(w,u)},{node:d},f,p),a},n$=function(e,r,n,i,a){i&&e.push(i);for(var s=0;sf=>{e.splice(d+1,0,f),s++})(s)}i&&e.pop()},fge=function(e){return e instanceof wx||e instanceof SR||e instanceof Cx&&e.hasClass("enclosing")?e:null},i$=function(e,r){var n=fge(e);if(n){var i=n.children;if(i.length){if(r==="right")return i$(i[i.length-1],"right");if(r==="left")return i$(i[0],"left")}}return e},a$=function(e,r){if(!e)return null;r&&(e=i$(e,r));var n=e.classes[0];return Ett[n]||null},HC=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return St(r.concat(n))},vn=function(e,r,n){if(!e)return St();if(YA[e.type]){var i=YA[e.type](e,r);if(n&&r.size!==n.size){i=St(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new _t("Got group of unknown type: '"+e.type+"'")};function $E(t,e){var r=St(["base"],t,e),n=St(["strut"]);return n.style.height=Mt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Mt(-r.depth)),r.children.unshift(n),r}function s$(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=la(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push($E(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push($E(s,e));var u;r?(u=$E(la(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=St(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=Mt(h.height+h.depth),h.depth&&(d.style.verticalAlign=Mt(-h.depth))}return h}function pge(t){return new wx(t)}class Lt{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=nf(this.classes));for(var n=0;n0&&(e+=' class ="'+fs(nf(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Yi{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return fs(this.toText())}toText(){return this.text}}class gge{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Mt(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var Att=new Set(["\\imath","\\jmath"]),_tt=new Set(["mrow","mtable"]),xl=function(e,r,n){return li[r][e]&&li[r][e].replace&&e.charCodeAt(0)!==55349&&!(oge.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=li[r][e].replace),new Yi(e)},WV=function(e){return e.length===1?e[0]:new Lt("mrow",e)},Rtt={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},HV=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var r=e.font;if(!r||r==="mathnormal")return null;var n=t.mode,i=Rtt[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(Att.has(a))return null;if(li[n][a]){var s=li[n][a].replace;s&&(a=s)}var o=r$[r].fontName;return zV(a,o,n)?r$[r].variant:null};function lI(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Yi&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof Yi&&r.text===","}else return!1}var Uo=function(e,r,n){if(e.length===1){var i=Dn(e[0],r);return n&&i instanceof Lt&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||lI(s))){var u=l.children[0];u instanceof Lt&&u.type==="mn"&&(u.children=[...s.children,...u.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var h=s.children[0];if(h instanceof Yi&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Yi&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},of=function(e,r,n){return WV(Uo(e,r,n))},Dn=function(e,r){if(!e)return new Lt("mrow");if(XA[e.type])return XA[e.type](e,r);throw new _t("Got group of unknown type: '"+e.type+"'")};function EZ(t,e,r,n,i){var a=Uo(t,r),s;a.length===1&&a[0]instanceof Lt&&_tt.has(a[0].type)?s=a[0]:s=new Lt("mrow",a);var o=new Lt("annotation",[new Yi(e)]);o.setAttribute("encoding","application/x-tex");var l=new Lt("semantics",[s,o]),u=new Lt("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return St([h],[u])}var Ltt=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],AZ=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],_Z=function(e,r){return r.size<2?e:Ltt[e-1][r.size-1]};class Hu{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Hu.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=AZ[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(r,e),new Hu(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:_Z(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:AZ[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=_Z(Hu.BASESIZE,e);return this.size===r&&this.textSize===Hu.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Hu.BASESIZE?["sizing","reset-size"+this.size,"size"+Hu.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=ftt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Hu.BASESIZE=6;var mge=function(e){return new Hu({style:e.displayMode?Ir.DISPLAY:Ir.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},yge=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=St(n,[e])}return e},Mtt=function(e,r,n){var i=mge(n),a;if(n.output==="mathml")return EZ(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=s$(e,i);a=St(["katex"],[s])}else{var o=EZ(e,r,i,n.displayMode,!1),l=s$(e,i);a=St(["katex"],[o,l])}return yge(a,n)},Itt=function(e,r,n){var i=mge(n),a=s$(e,i),s=St(["katex"],[a]);return yge(s,n)},Ntt={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},_R=function(e){var r=new Lt("mo",[new Yi(Ntt[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},Dtt={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Ott=new Set(["widehat","widecheck","widetilde","utilde"]),RR=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(Ott.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,h,d,f;if(u>5)l==="widehat"||l==="widecheck"?(h=420,o=2364,f=.42,d=l+"4"):(h=312,o=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(o=[0,600,1033,2339,2340][p],h=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],d="tilde"+p)}var g=new af(d),m=new xh([g],{width:"100%",height:Mt(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:sf([],[m],r),minWidth:0,height:f}}else{var y=[],v=Dtt[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[T,b,w]=v,C=w/1e3,S=T.length,k,E;if(S===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');k=["hide-tail"],E=[v[3]]}else if(S===2)k=["halfarrow-left","halfarrow-right"],E=["xMinYMin","xMaxYMin"];else if(S===3)k=["brace-left","brace-center","brace-right"],E=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+S+" children.");for(var _=0;_0&&(i.style.minWidth=Mt(a)),i},$tt=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=St(["stretchy",r],[],a),r==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new KO({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new KO({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new xh(u,{width:"100%",height:Mt(o)});s=sf([],[h],a)}return s.height=o,s.style.height=Mt(o),s},Ptt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Btt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Ftt(t){return t in Ptt}function Pr(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function LR(t){var e=MR(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function MR(t){return t&&(t.type==="atom"||Btt.hasOwnProperty(t.type))?t:null}var vge=t=>{if(t instanceof zo)return t;if(dtt(t)&&t.children.length===1)return vge(t.children[0])},qV=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=Pr(t.base,"accent"),r=n.base,t.base=r,i=htt(vn(t,e)),t.base=n):(n=Pr(t,"accent"),r=n.base);var a=vn(r,e.havingCrampedStyle()),s=n.isShifty&&Ph(r),o=0;if(s){var l,u;o=(l=(u=vge(a))==null?void 0:u.skew)!=null?l:0}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=RR(n,e),f=yn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Mt(2*o)+")",marginLeft:Mt(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=hge("vec",e),g=uge.vec[1]):(p=AR({mode:n.mode,text:n.label},e,"textord"),p=utt(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=St(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var y=o;m||(y-=g/2),f.style.left=Mt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=yn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var v=St(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},bge=(t,e)=>{var r=t.isStretchy?_R(t.label):new Lt("mo",[xl(t.label,t.mode)]),n=new Lt("mover",[Dn(t.base,e),r]);return n.setAttribute("accent","true"),n},ztt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Pt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=jA(e[0]),n=!ztt.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:qV,mathmlBuilder:bge});Pt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:qV,mathmlBuilder:bge});Pt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=vn(t.base,e),n=RR(t,e),i=t.label==="\\utilde"?.12:0,a=yn({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return St(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=_R(t.label),n=new Lt("munder",[Dn(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var PE=t=>{var e=new Lt("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Pt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=Ob(vn(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;t.below&&(n=e.havingStyle(r.sub()),s=Ob(vn(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=RR(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*o.height+.111;h=yn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:s,shift:d}]})}else h=yn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return St(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=_R(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=PE(Dn(t.body,e));if(t.below){var a=PE(Dn(t.below,e));n=new Lt("munderover",[r,a,i])}else n=new Lt("mover",[r,i])}else if(t.below){var s=PE(Dn(t.below,e));n=new Lt("munder",[r,s])}else n=PE(),n=new Lt("mover",[r,n]);return n}});function xge(t,e){var r=la(t.body,e,!0);return St([t.mclass],r,e)}function Tge(t,e){var r,n=Uo(t.body,e);return t.mclass==="minner"?r=new Lt("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new Lt("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new Lt("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}Pt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:Ui(i),isCharacterBox:Ph(i)}},htmlBuilder:xge,mathmlBuilder:Tge});var IR=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Pt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:IR(e[0]),body:Ui(e[1]),isCharacterBox:Ph(e[1])}}});Pt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],s;n!=="\\stackrel"?s=IR(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Ui(i)},l={type:"supsub",mode:a.mode,base:o,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:s,body:[l],isCharacterBox:Ph(l)}},htmlBuilder:xge,mathmlBuilder:Tge});Pt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:IR(e[0]),body:Ui(e[0])}},htmlBuilder(t,e){var r=la(t.body,e,!0),n=St([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=Uo(t.body,e),n=new Lt("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var Vtt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},RZ=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),LZ=t=>t.type==="textord"&&t.text==="@",Gtt=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function Wtt(t,e,r){var n=Vtt[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=r.callFunction("\\Big",[a],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Htt(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new _t("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;aAV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',s[l]);var g=Wtt(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=RZ()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Pt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=Ob(vn(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Mt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new Lt("mrow",[Dn(t.label,e)]);return r=new Lt("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new Lt("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});Pt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=Ob(vn(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new Lt("mrow",[Dn(t.fragment,e)])}});Pt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=Pr(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new _t("\\@char with invalid code point "+a);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var wge=(t,e)=>{var r=la(t.body,e.withColor(t.color),!1);return Fh(r)},Cge=(t,e)=>{var r=Uo(t.body,e.withColor(t.color)),n=new Lt("mstyle",r);return n.setAttribute("mathcolor",t.color),n};Pt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=Pr(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Ui(i)}},htmlBuilder:wge,mathmlBuilder:Cge});Pt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=Pr(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:wge,mathmlBuilder:Cge});Pt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&Pr(i,"size").value}},htmlBuilder(t,e){var r=St(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Mt(fi(t.size,e)))),r},mathmlBuilder(t,e){var r=new Lt("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Mt(fi(t.size,e)))),r}});var o$={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},kge=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new _t("Expected a control sequence",t);return e},qtt=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},Sge=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};Pt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(o$[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=o$[n.text]),Pr(e.parseFunction(),"internal");throw new _t("Invalid token after macro prefix",n)}});Pt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new _t("Expected a control sequence",n);for(var a=0,s,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),o[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new _t('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new _t('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new _t("Expected a macro definition");o[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return s&&l.unshift(s),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},r===o$[r]),{type:"internal",mode:e.mode}}});Pt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=kge(e.gullet.popToken());e.gullet.consumeSpaces();var i=qtt(e);return Sge(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});Pt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=kge(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return Sge(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var ZT=function(e,r,n){var i=li.math[e]&&li.math[e].replace,a=zV(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},UV=function(e,r,n,i){var a=n.havingBaseStyle(r),s=St(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},Ege=function(e,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Mt(a),e.height-=a,e.depth+=a},Utt=function(e,r,n,i,a,s){var o=Ls(e,"Main-Regular",a,i),l=UV(o,r,i,s);return Ege(l,i,r),l},Ytt=function(e,r,n,i){return Ls(e,"Size"+r+"-Regular",n,i)},Age=function(e,r,n,i,a,s){var o=Ytt(e,r,a,i),l=UV(St(["delimsizing","size"+r],[o],i),Ir.TEXT,i,s);return n&&Ege(l,i,Ir.TEXT),l},cI=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=St(["delimsizinginner",i],[St([],[Ls(e,r,n)])]);return{type:"elem",elem:a}},uI=function(e,r,n){var i=Bc["Size4-Regular"][e.charCodeAt(0)]?Bc["Size4-Regular"][e.charCodeAt(0)][4]:Bc["Size1-Regular"][e.charCodeAt(0)][4],a=new af("inner",ntt(e,Math.round(1e3*r))),s=new xh([a],{width:Mt(i),height:Mt(r),style:"width:"+Mt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=sf([],[s],n);return o.height=r,o.style.height=Mt(r),o.style.width=Mt(i),{type:"elem",elem:o}},l$=.008,BE={type:"kern",size:-1*l$},Xtt=new Set(["|","\\lvert","\\rvert","\\vert"]),jtt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),_ge=function(e,r,n,i,a,s){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):Xtt.has(e)?(u="∣",d="vert",f=333):jtt.has(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=ZT(o,p,a),m=g.height+g.depth,y=ZT(u,p,a),v=y.height+y.depth,T=ZT(h,p,a),b=T.height+T.depth,w=0,C=1;if(l!==null){var S=ZT(l,p,a);w=S.height+S.depth,C=2}var k=m+b+w,E=Math.max(0,Math.ceil((r-k)/(C*v))),_=k+E*C*v,M=i.fontMetrics().axisHeight;n&&(M*=i.sizeMultiplier);var L=_/2-M,P=[];if(d.length>0){var D=_-m-b,R=Math.round(_*1e3),I=itt(d,Math.round(D*1e3)),$=new af(d,I),O=Mt(f/1e3),N=Mt(R/1e3),F=new xh([$],{width:O,height:N,viewBox:"0 0 "+f+" "+R}),z=sf([],[F],i);z.height=R/1e3,z.style.width=O,z.style.height=N,P.push({type:"elem",elem:z})}else{if(P.push(cI(h,p,a)),P.push(BE),l===null){var V=_-m-b+2*l$;P.push(uI(u,V,i))}else{var B=(_-m-b-w)/2+2*l$;P.push(uI(u,B,i)),P.push(BE),P.push(cI(l,p,a)),P.push(BE),P.push(uI(u,B,i))}P.push(BE),P.push(cI(o,p,a))}var G=i.havingBaseStyle(Ir.TEXT),H=yn({positionType:"bottom",positionData:L,children:P});return UV(St(["delimsizing","mult"],[H],G),Ir.TEXT,i,s)},hI=80,dI=.08,fI=function(e,r,n,i,a){var s=rtt(e,i,n),o=new af(e,s),l=new xh([o],{width:"400em",height:Mt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return sf(["hide-tail"],[l],a)},Ktt=function(e,r){var n=r.havingBaseSizing(),i=Nge("\\surd",e*n.sizeMultiplier,Ige,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l,u,h,d;return i.type==="small"?(h=1e3+1e3*s+hI,e<1?a=1:e<1.4&&(a=.7),l=(1+s+dI)/a,u=(1+s)/a,o=fI("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+hI)*Gw[i.size],u=(Gw[i.size]+s)/a,l=(Gw[i.size]+s+dI)/a,o=fI("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+dI,u=e+s,h=Math.floor(1e3*e+s)+hI,o=fI("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=Mt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},Rge=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),Ztt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),Lge=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Gw=[0,1.2,1.8,2.4,3],Mge=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),Rge.has(e)||Lge.has(e))return Age(e,r,!1,n,i,a);if(Ztt.has(e))return _ge(e,Gw[r],!1,n,i,a);throw new _t("Illegal delimiter: '"+e+"'")},Qtt=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Jtt=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"stack"}],Ige=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],ert=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var r=e.type;throw new Error("Add support for delim type '"+r+"' here.")},Nge=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;sr)return o}return n[n.length-1]},c$=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;Lge.has(e)?o=Qtt:Rge.has(e)?o=Ige:o=Jtt;var l=Nge(e,r,o,i);return l.type==="small"?Utt(e,l.style,n,i,a,s):l.type==="large"?Age(e,l.size,n,i,a,s):_ge(e,r,n,i,a,s)},pI=function(e,r,n,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return c$(e,d,!0,i,a,s)},MZ={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},trt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function IZ(t){return"isMiddle"in t}function NR(t,e){var r=MR(t);if(r&&trt.has(r.text))return r;throw r?new _t("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new _t("Invalid delimiter type '"+t.type+"'",t)}Pt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=NR(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:MZ[t.funcName].size,mclass:MZ[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?St([t.mclass]):Mge(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(xl(t.delim,t.mode));var r=new Lt("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Mt(Gw[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function NZ(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Pt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new _t("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:NR(e[0],t).text,color:r}}});Pt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=NR(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=Pr(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{NZ(t);for(var r=la(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{NZ(t);var r=Uo(t.body,e);if(t.left!=="."){var n=new Lt("mo",[xl(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new Lt("mo",[xl(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return WV(r)}});Pt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=NR(e[0],t);if(!t.parser.leftrightDepth)throw new _t("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=HC(e,[]):(r=Mge(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?xl("|","text"):xl(t.delim,t.mode),n=new Lt("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var DR=(t,e)=>{var r=Ob(vn(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s,o=Ph(t.body);if(n==="sout")a=St(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=fi({number:.6,unit:"pt"},e),u=fi({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=Mt(d/2+l);var f=Math.floor(1e3*d*i),p=ett(f),g=new xh([new af("phase",p)],{width:"400em",height:Mt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=sf(["hide-tail"],[g],e),a.style.height=Mt(d),s=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m,y,v=0;/box/.test(n)?(v=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:v),y=m):n==="angl"?(v=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*v,y=Math.max(0,.25-r.depth)):(m=o?.2:0,y=m),a=$tt(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=Mt(v)):n==="angl"&&v!==.049&&(a.style.borderTopWidth=Mt(v),a.style.borderRightWidth=Mt(v)),s=r.depth+y,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var T;if(t.backgroundColor)T=yn({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]});else{var b=/cancel|phase/.test(n)?["svg-align"]:[];T=yn({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:b}]})}return/cancel/.test(n)&&(T.height=r.height,T.depth=r.depth),/cancel/.test(n)&&!o?St(["mord","cancel-lap"],[T],e):St(["mord"],[T],e)},OR=(t,e)=>{var r,n=new Lt(t.label.includes("colorbox")?"mpadded":"menclose",[Dn(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+Mt(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};Pt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Pr(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:DR,mathmlBuilder:OR});Pt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Pr(e[0],"color-token").color,s=Pr(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:DR,mathmlBuilder:OR});Pt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}});Pt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:DR,mathmlBuilder:OR});Pt({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t;r.mode==="math"&&r.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:DR,mathmlBuilder:OR});Pt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var Dge={};function lu(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=t.parser.settings;if(!e.displayMode)throw new _t("{"+t.envName+"} can be used only in display mode.")},rrt=new Set(["gather","gather*"]);function YV(t){if(!t.includes("ed"))return!t.includes("*")}function Cf(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!s){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)s=1;else if(s=parseFloat(p),!s||s<0)throw new _t("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],T=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){T&&(t.gullet.macros.get("\\df@tag")?(T.push(t.subparse([new $o("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):T.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(DZ(t));;){var C=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var S={type:"ordgroup",mode:t.mode,body:C};r&&(S={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[S]}),g.push(S);var k=t.fetch().text;if(k==="&"){if(d&&g.length===d){if(u||o)throw new _t("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(k==="\\end"){w(),g.length===1&&S.type==="styling"&&S.body.length===1&&S.body[0].type==="ordgroup"&&S.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),v.length0&&(b+=.25),u.push({pos:b,isDashed:Te[ae]})}for(w(s[0]),n=0;n0&&(L+=T,kTe))for(n=0;n=o)){var K=void 0;if(i>0||e.hskipBeforeAndAfter){var Q,te;K=(Q=(te=G)==null?void 0:te.pregap)!=null?Q:f,K!==0&&(I=St(["arraycolsep"],[]),I.style.width=Mt(K),R.push(I))}var J=[];for(n=0;n0){for(var fe=Db("hline",r,h),Pe=Db("hdashline",r,h),ve=[{type:"elem",elem:be,shift:0}];u.length>0;){var Ce=u.pop(),Ve=Ce.pos-P;Ce.isDashed?ve.push({type:"elem",elem:Pe,shift:Ve}):ve.push({type:"elem",elem:fe,shift:Ve})}be=yn({positionType:"individualShift",children:ve})}if(O.length===0)return St(["mord"],[be],r);var se=yn({positionType:"individualShift",children:O}),de=St(["tag"],[se],r);return Fh([be,de])},nrt={c:"center ",l:"left ",r:"right "},uu=function(e,r){for(var n=[],i=new Lt("mtd",[],["mtr-glue"]),a=new Lt("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,m="",y=!1,v=0,T=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",T-=1);for(var b=v;b0?"left ":"",f+=_[_.length-1].length>0?"right ":"";for(var M=1;M<_.length-1;M++)E+=_[M].length===0?"none ":_[M][0]?"dashed ":"solid ";return/[sd]/.test(E)&&h.setAttribute("rowlines",E.trim()),f!==""&&(h=new Lt("menclose",[h]),h.setAttribute("notation",f.trim())),e.arraystretch&&e.arraystretch<1&&(h=new Lt("mstyle",[h]),h.setAttribute("scriptlevel","1")),h},$ge=function(e,r){e.envName.includes("ed")||$R(e);var n=[],i=e.envName.includes("at")?"alignat":"align",a=e.envName==="split",s=Cf(e.parser,{cols:n,addJot:!0,autoTag:a?void 0:YV(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:e.parser.settings.leqno},"display"),o=0,l=0,u={type:"ordgroup",mode:e.mode,body:[]};if(r[0]&&r[0].type==="ordgroup"){for(var h="",d=0;d0&&p&&(y=1),n[g]={type:"align",align:m,pregap:y,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};lu({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=MR(e[0]),n=r?[e[0]]:Pr(e[0],"ordgroup").body,i=n.map(function(s){var o=LR(s),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new _t("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Cf(t.parser,a,XV(t.envName))},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,!"lcr".includes(r))throw new _t("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=Cf(t.parser,n,XV(t.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=Cf(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=MR(e[0]),n=r?[e[0]]:Pr(e[0],"ordgroup").body,i=n.map(function(o){var l=LR(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new _t("Unknown column alignment: "+u,o)});if(i.length>1)throw new _t("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=Cf(t.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new _t("{subarray} can contain only one column");return s},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=Cf(t.parser,e,XV(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:$ge,htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){rrt.has(t.envName)&&$R(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:YV(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Cf(t.parser,e,"display")},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:$ge,htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){$R(t);var e={autoTag:YV(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Cf(t.parser,e,"display")},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["CD"],props:{numArgs:0},handler(t){return $R(t),Htt(t.parser)},htmlBuilder:cu,mathmlBuilder:uu});we("\\nonumber","\\gdef\\@eqnsw{0}");we("\\notag","\\nonumber");Pt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new _t(t.funcName+" valid only within array environment")}});var OZ=Dge;Pt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new _t("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return vn(t.body,n)},Bge=(t,e)=>{var r=t.font,n=e.withFont(r);return Dn(t.body,n)},$Z={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Pt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=jA(e[0]),a=n;return a in $Z&&(a=$Z[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:Pge,mathmlBuilder:Bge});Pt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"mclass",mode:r.mode,mclass:IR(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:Ph(n)}}});Pt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:s}}},htmlBuilder:Pge,mathmlBuilder:Bge});var irt=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=vn(t.numer,a,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var y;if(h){var T=e.fontMetrics().axisHeight;p-s.depth-(T+.5*d){var r=new Lt("mfrac",[Dn(t.numer,e),Dn(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=fi(t.barSize,e);r.setAttribute("linethickness",Mt(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var a=new Lt("mo",[new Yi(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var s=new Lt("mo",[new Yi(t.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return WV(i)}return r},Fge=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};Pt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1],s,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=n==="\\cfrac",h=null;return u||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),Fge({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:irt,mathmlBuilder:art});Pt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var PZ=["display","text","script","scriptscript"],BZ=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};Pt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],a=jA(e[0]),s=a.type==="atom"&&a.family==="open"?BZ(a.text):null,o=jA(e[1]),l=o.type==="atom"&&o.family==="close"?BZ(o.text):null,u=Pr(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f=null,p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=Pr(p.body[0],"textord");f=PZ[Number(g.text)]}}else p=Pr(p,"textord"),f=PZ[Number(p.text)];return Fge({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},f)}});Pt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Pr(e[0],"size").value,token:i}}});Pt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=Pr(e[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var s=e[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null}}});var zge=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?vn(t.sup,e.havingStyle(r.sup()),e):vn(t.sub,e.havingStyle(r.sub()),e),i=Pr(t.base,"horizBrace")):i=Pr(t,"horizBrace");var a=vn(i.base,e.havingBaseStyle(Ir.DISPLAY)),s=RR(i,e),o;if(i.isOver?o=yn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=yn({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=St(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=yn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=yn({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return St(["minner",i.isOver?"mover":"munder"],[o],e)},srt=(t,e)=>{var r=_R(t.label);return new Lt(t.isOver?"mover":"munder",[Dn(t.base,e),r])};Pt({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:zge,mathmlBuilder:srt});Pt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=Pr(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Ui(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=la(t.body,e,!1);return btt(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=of(t.body,e);return r instanceof Lt||(r=new Lt("mrow",[r])),r.setAttribute("href",t.href),r}});Pt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=Pr(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:r,funcName:n,token:i}=t,a=Pr(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),h=0;h{var r=la(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=St(n,r,e);for(var a in t.attributes)a!=="class"&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i},mathmlBuilder:(t,e)=>of(t.body,e)});Pt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:Ui(e[0]),mathml:Ui(e[1])}},htmlBuilder:(t,e)=>{var r=la(t.html,e,!1);return Fh(r)},mathmlBuilder:(t,e)=>of(t.mathml,e)});var gI=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new _t("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!rge(n))throw new _t("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Pt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(r[0])for(var l=Pr(r[0],"raw").string,u=l.split(","),h=0;h{var r=fi(t.height,e),n=0;t.totalheight.number>0&&(n=fi(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=fi(t.width,e));var a={height:Mt(r+n)};i>0&&(a.width=Mt(i)),n>0&&(a.verticalAlign=Mt(-n));var s=new ltt(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new Lt("mglyph",[]);r.setAttribute("alt",t.alt);var n=fi(t.height,e),i=0;if(t.totalheight.number>0&&(i=fi(t.totalheight,e)-n,r.setAttribute("valign",Mt(-i))),r.setAttribute("height",Mt(n+i)),t.width.number>0){var a=fi(t.width,e);r.setAttribute("width",Mt(a))}return r.setAttribute("src",t.src),r}});Pt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=Pr(e[0],"size");if(r.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return cge(t.dimension,e)},mathmlBuilder(t,e){var r=fi(t.dimension,e);return new gge(r)}});Pt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=St([],[vn(t.body,e)]),r=St(["inner"],[r],e)):r=St(["inner"],[vn(t.body,e)]);var n=St(["fix"],[]),i=St([t.alignment],[r,n],e),a=St(["strut"]);return a.style.height=Mt(i.height+i.depth),i.depth&&(a.style.verticalAlign=Mt(-i.depth)),i.children.unshift(a),i=St(["thinbox"],[i],e),St(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new Lt("mpadded",[Dn(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}});Pt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:s}}});Pt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new _t("Mismatched "+t.funcName)}});var FZ=(t,e)=>{switch(e.style.size){case Ir.DISPLAY.size:return t.display;case Ir.TEXT.size:return t.text;case Ir.SCRIPT.size:return t.script;case Ir.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Pt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:Ui(e[0]),text:Ui(e[1]),script:Ui(e[2]),scriptscript:Ui(e[3])}},htmlBuilder:(t,e)=>{var r=FZ(t,e),n=la(r,e,!1);return Fh(n)},mathmlBuilder:(t,e)=>{var r=FZ(t,e);return of(r,e)}});var Vge=(t,e,r,n,i,a,s)=>{t=St([],[t]);var o=r&&Ph(r),l,u;if(e){var h=vn(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=vn(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+s;f=yn({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Mt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Mt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-s;f=yn({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Mt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+s;f=yn({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Mt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var y=[f];if(l&&a!==0&&!o){var v=St(["mspace"],[],n);v.style.marginRight=Mt(a),y.unshift(v)}return St(["mop","op-limits"],y,n)},Gge=new Set(["\\smallint"]),Sx=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Pr(t.base,"op"),i=!0):a=Pr(t,"op");var s=e.style,o=!1;s.size===Ir.DISPLAY.size&&a.symbol&&!Gge.has(a.name)&&(o=!0);var l,u;if(a.symbol){var h=o?"Size2-Regular":"Size1-Regular",d="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(d=a.name.slice(1),a.name=d==="oiint"?"\\iint":"\\iiint"),l=Ls(a.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=hge(d+"Size"+(o?"2":"1"),e);l=yn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),a.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=la(a.body,e,!0);p.length===1&&p[0]instanceof zo?(l=p[0],l.classes[0]="mop"):l=St(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new Lt("mo",[xl(t.name,t.mode)]),Gge.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new Lt("mo",Uo(t.body,e));else{r=new Lt("mi",[new Yi(t.name.slice(1))]);var n=new Lt("mo",[xl("⁡","text")]);t.parentIsSupSub?r=new Lt("mrow",[r,n]):r=pge([r,n])}return r},ort={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Pt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=ort[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Sx,mathmlBuilder:aS});Pt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Ui(n)}},htmlBuilder:Sx,mathmlBuilder:aS});var lrt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Pt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:Sx,mathmlBuilder:aS});Pt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:Sx,mathmlBuilder:aS});Pt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=lrt[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:Sx,mathmlBuilder:aS});var Wge=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Pr(t.base,"operatorname"),i=!0):a=Pr(t,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var f="text"in d?d.text:void 0;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=la(o,e.withFont("mathrm"),!0),u=0;u{for(var r=Uo(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new Yi(o)]}var l=new Lt("mi",r);l.setAttribute("mathvariant","normal");var u=new Lt("mo",[xl("⁡","text")]);return t.parentIsSupSub?new Lt("mrow",[l,u]):pge([l,u])};Pt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:Ui(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Wge,mathmlBuilder:crt});we("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");og({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Fh(la(t.body,e,!1)):St(["mord"],la(t.body,e,!0),e)},mathmlBuilder(t,e){return of(t.body,e,!0)}});Pt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=vn(t.body,e.havingCrampedStyle()),n=Db("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=yn({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return St(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new Lt("mo",[new Yi("‾")]);r.setAttribute("stretchy","true");var n=new Lt("mover",[Dn(t.body,e),r]);return n.setAttribute("accent","true"),n}});Pt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:Ui(n)}},htmlBuilder:(t,e)=>{var r=la(t.body,e.withPhantom(),!1);return Fh(r)},mathmlBuilder:(t,e)=>{var r=Uo(t.body,e);return new Lt("mphantom",r)}});we("\\hphantom","\\smash{\\phantom{#1}}");Pt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=St(["inner"],[vn(t.body,e.withPhantom())]),n=St(["fix"],[]);return St(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=Uo(Ui(t.body),e),n=new Lt("mphantom",r),i=new Lt("mpadded",[n]);return i.setAttribute("width","0px"),i}});Pt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=Pr(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=vn(t.body,e),n=fi(t.dy,e);return yn({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Lt("mpadded",[Dn(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});Pt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});Pt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=Pr(e[0],"size"),s=Pr(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&Pr(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=St(["mord","rule"],[],e),n=fi(t.width,e),i=fi(t.height,e),a=t.shift?fi(t.shift,e):0;return r.style.borderRightWidth=Mt(n),r.style.borderTopWidth=Mt(i),r.style.bottom=Mt(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=fi(t.width,e),n=fi(t.height,e),i=t.shift?fi(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new Lt("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",Mt(r)),s.setAttribute("height",Mt(n));var o=new Lt("mpadded",[s]);return i>=0?o.setAttribute("height",Mt(i)):(o.setAttribute("height",Mt(i)),o.setAttribute("depth",Mt(-i))),o.setAttribute("voffset",Mt(i)),o}});function Hge(t,e,r){for(var n=la(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return Hge(t.body,r,e)};Pt({type:"sizing",names:zZ,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:zZ.indexOf(n)+1,body:a}},htmlBuilder:urt,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=Uo(t.body,r),i=new Lt("mstyle",n);return i.setAttribute("mathsize",Mt(r.sizeMultiplier)),i}});Pt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&Pr(r[0],"ordgroup");if(s)for(var o,l=0;l{var r=St([],[vn(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0),t.smashDepth&&(r.depth=0),t.smashHeight&&t.smashDepth)return St(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new Lt("mpadded",[Dn(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});Pt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=vn(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=Ob(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+s&&(s=(s+d-r.height-r.depth)/2);var f=l.height-r.height-s-u;r.style.paddingLeft=Mt(h);var p=yn({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]});if(t.index){var g=e.havingStyle(Ir.SCRIPTSCRIPT),m=vn(t.index,g,e),y=.6*(p.height-p.depth),v=yn({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]}),T=St(["root"],[v]);return St(["mord","sqrt"],[T,p],e)}else return St(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new Lt("mroot",[Dn(r,e),Dn(n,e)]):new Lt("msqrt",[Dn(r,e)])}});var u$={display:Ir.DISPLAY,text:Ir.TEXT,script:Ir.SCRIPT,scriptscript:Ir.SCRIPTSCRIPT};function hrt(t){return t in u$}Pt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);if(!hrt(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=u$[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),Hge(t.body,n,e)},mathmlBuilder(t,e){var r=u$[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=Uo(t.body,n),a=new Lt("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[t.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var drt=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Ir.DISPLAY.size||n.alwaysHandleSupSub);return i?Sx:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Ir.DISPLAY.size||n.limits);return a?Wge:null}else{if(n.type==="accent")return Ph(n.base)?qV:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?zge:null}else return null}else return null};og({type:"supsub",htmlBuilder(t,e){var r=drt(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=vn(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&Ph(n);if(i){var p=e.havingStyle(e.style.sup());o=vn(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=vn(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Ir.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=Mt(.5/u.ptPerEm/y),T=null;if(l){var b=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(s instanceof zo||b){var w;T=Mt(-((w=s.italic)!=null?w:0))}}var C;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var S=u.defaultRuleThickness,k=4*S;if(h-o.depth-(l.height-d)0&&(h+=E,d-=E)}var _=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:T},{type:"elem",elem:o,shift:-h,marginRight:v}];C=yn({positionType:"individualShift",children:_})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var M=[{type:"elem",elem:l,marginLeft:T,marginRight:v}];C=yn({positionType:"shift",positionData:d,children:M})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),C=yn({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var L=a$(s,"right")||"mord";return St([L],[s,St(["msupsub"],[C])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var a=[Dn(t.base,e)];t.sub&&a.push(Dn(t.sub,e)),t.sup&&a.push(Dn(t.sup,e));var s;if(r)s=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===Ir.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Ir.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Ir.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Ir.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===Ir.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Ir.DISPLAY)?s="mover":s="msup"}return new Lt(s,a)}});og({type:"atom",htmlBuilder(t,e){return VV(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new Lt("mo",[xl(t.text,t.mode)]);if(t.family==="bin"){var n=HV(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var qge={mi:"italic",mn:"normal",mtext:"normal"};og({type:"mathord",htmlBuilder(t,e){return AR(t,e,"mathord")},mathmlBuilder(t,e){var r=new Lt("mi",[xl(t.text,t.mode,e)]),n=HV(t,e)||"italic";return n!==qge[r.type]&&r.setAttribute("mathvariant",n),r}});og({type:"textord",htmlBuilder(t,e){return AR(t,e,"textord")},mathmlBuilder(t,e){var r=xl(t.text,t.mode,e),n=HV(t,e)||"normal",i;return t.mode==="text"?i=new Lt("mtext",[r]):/[0-9]/.test(t.text)?i=new Lt("mn",[r]):t.text==="\\prime"?i=new Lt("mo",[r]):i=new Lt("mi",[r]),n!==qge[i.type]&&i.setAttribute("mathvariant",n),i}});var mI={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},yI={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};og({type:"spacing",htmlBuilder(t,e){if(yI.hasOwnProperty(t.text)){var r=yI[t.text].className||"";if(t.mode==="text"){var n=AR(t,e,"textord");return n.classes.push(r),n}else return St(["mspace",r],[VV(t.text,t.mode,e)],e)}else{if(mI.hasOwnProperty(t.text))return St(["mspace",mI[t.text]],[],e);throw new _t('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(yI.hasOwnProperty(t.text))r=new Lt("mtext",[new Yi(" ")]);else{if(mI.hasOwnProperty(t.text))return new Lt("mspace");throw new _t('Unknown type of space "'+t.text+'"')}return r}});var VZ=()=>{var t=new Lt("mtd",[]);return t.setAttribute("width","50%"),t};og({type:"tag",mathmlBuilder(t,e){var r=new Lt("mtable",[new Lt("mtr",[VZ(),new Lt("mtd",[of(t.body,e)]),VZ(),new Lt("mtd",[of(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var GZ={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},WZ={"\\textbf":"textbf","\\textmd":"textmd"},frt={"\\textit":"textit","\\textup":"textup"},HZ=(t,e)=>{var r=t.font;if(r){if(GZ[r])return e.withTextFontFamily(GZ[r]);if(WZ[r])return e.withTextFontWeight(WZ[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(frt[r])};Pt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:Ui(i),font:n}},htmlBuilder(t,e){var r=HZ(t,e),n=la(t.body,r,!0);return St(["mord","text"],n,r)},mathmlBuilder(t,e){var r=HZ(t,e);return of(t.body,r)}});Pt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=vn(t.body,e),n=Db("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=yn({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return St(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new Lt("mo",[new Yi("‾")]);r.setAttribute("stretchy","true");var n=new Lt("munder",[Dn(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});Pt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=vn(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return yn({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Lt("mpadded",[Dn(t.body,e)],["vcenter"]);return new Lt("mrow",[r])}});Pt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new _t("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=qZ(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),Md=dge,Uge=`[ \r + ]`,prt="\\\\[a-zA-Z@]+",grt="\\\\[^\uD800-\uDFFF]",mrt="("+prt+")"+Uge+"*",yrt=`\\\\( |[ \r ]+ -?)[ \r ]*`,h$="[̀-ͯ]",grt=new RegExp(h$+"+$"),mrt="("+qge+"+)|"+(prt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(h$+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(h$+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+frt)+("|"+drt+")");let qZ=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(mrt,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new $o("EOF",new co(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new _t("Unexpected character: '"+e[r]+"'",new $o(e[r],new co(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(` -`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new $o(i,new co(this,r,this.tokenRegex.lastIndex))}};class yrt{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new _t("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var vrt=Dge;we("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});we("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});we("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});we("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});we("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});we("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");we("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var UZ={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};we("\\char",function(t){var e=t.popToken(),r,n=0;if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new _t("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=UZ[e.text],n==null||n>=r)throw new _t("Invalid base-"+r+" digit "+e.text);for(var i;(i=UZ[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new _t("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new _t("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new _t("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new _t("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};we("\\newcommand",t=>jV(t,!1,!0,!1));we("\\renewcommand",t=>jV(t,!0,!1,!1));we("\\providecommand",t=>jV(t,!0,!0,!0));we("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});we("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});we("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),Md[r],li.math[r],li.text[r]),""});we("\\bgroup","{");we("\\egroup","}");we("~","\\nobreakspace");we("\\lq","`");we("\\rq","'");we("\\aa","\\r a");we("\\AA","\\r A");we("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");we("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");we("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");we("ℬ","\\mathscr{B}");we("ℰ","\\mathscr{E}");we("ℱ","\\mathscr{F}");we("ℋ","\\mathscr{H}");we("ℐ","\\mathscr{I}");we("ℒ","\\mathscr{L}");we("ℳ","\\mathscr{M}");we("ℛ","\\mathscr{R}");we("ℭ","\\mathfrak{C}");we("ℌ","\\mathfrak{H}");we("ℨ","\\mathfrak{Z}");we("\\Bbbk","\\Bbb{k}");we("\\llap","\\mathllap{\\textrm{#1}}");we("\\rlap","\\mathrlap{\\textrm{#1}}");we("\\clap","\\mathclap{\\textrm{#1}}");we("\\mathstrut","\\vphantom{(}");we("\\underbar","\\underline{\\text{#1}}");we("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');we("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");we("\\ne","\\neq");we("≠","\\neq");we("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");we("∉","\\notin");we("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");we("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");we("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");we("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");we("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");we("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");we("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");we("⟂","\\perp");we("‼","\\mathclose{!\\mkern-0.8mu!}");we("∌","\\notni");we("⌜","\\ulcorner");we("⌝","\\urcorner");we("⌞","\\llcorner");we("⌟","\\lrcorner");we("©","\\copyright");we("®","\\textregistered");we("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');we("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');we("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');we("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');we("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");we("⋮","\\vdots");we("\\varGamma","\\mathit{\\Gamma}");we("\\varDelta","\\mathit{\\Delta}");we("\\varTheta","\\mathit{\\Theta}");we("\\varLambda","\\mathit{\\Lambda}");we("\\varXi","\\mathit{\\Xi}");we("\\varPi","\\mathit{\\Pi}");we("\\varSigma","\\mathit{\\Sigma}");we("\\varUpsilon","\\mathit{\\Upsilon}");we("\\varPhi","\\mathit{\\Phi}");we("\\varPsi","\\mathit{\\Psi}");we("\\varOmega","\\mathit{\\Omega}");we("\\substack","\\begin{subarray}{c}#1\\end{subarray}");we("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");we("\\boxed","\\fbox{$\\displaystyle{#1}$}");we("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");we("\\implies","\\DOTSB\\;\\Longrightarrow\\;");we("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");we("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");we("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var YZ={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},brt=new Set(["bin","rel"]);we("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in YZ?e=YZ[r]:(r.slice(0,4)==="\\not"||r in li.math&&brt.has(li.math[r].group))&&(e="\\dotsb"),e});var KV={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};we("\\dotso",function(t){var e=t.future().text;return e in KV?"\\ldots\\,":"\\ldots"});we("\\dotsc",function(t){var e=t.future().text;return e in KV&&e!==","?"\\ldots\\,":"\\ldots"});we("\\cdots",function(t){var e=t.future().text;return e in KV?"\\@cdots\\,":"\\@cdots"});we("\\dotsb","\\cdots");we("\\dotsm","\\cdots");we("\\dotsi","\\!\\cdots");we("\\dotsx","\\ldots\\,");we("\\DOTSI","\\relax");we("\\DOTSB","\\relax");we("\\DOTSX","\\relax");we("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");we("\\,","\\tmspace+{3mu}{.1667em}");we("\\thinspace","\\,");we("\\>","\\mskip{4mu}");we("\\:","\\tmspace+{4mu}{.2222em}");we("\\medspace","\\:");we("\\;","\\tmspace+{5mu}{.2777em}");we("\\thickspace","\\;");we("\\!","\\tmspace-{3mu}{.1667em}");we("\\negthinspace","\\!");we("\\negmedspace","\\tmspace-{4mu}{.2222em}");we("\\negthickspace","\\tmspace-{5mu}{.277em}");we("\\enspace","\\kern.5em ");we("\\enskip","\\hskip.5em\\relax");we("\\quad","\\hskip1em\\relax");we("\\qquad","\\hskip2em\\relax");we("\\tag","\\@ifstar\\tag@literal\\tag@paren");we("\\tag@paren","\\tag@literal{({#1})}");we("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new _t("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});we("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");we("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");we("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");we("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");we("\\newline","\\\\\\relax");we("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Uge=Mt(Bc["Main-Regular"][84][1]-.7*Bc["Main-Regular"][65][1]);we("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Uge+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");we("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Uge+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");we("\\hspace","\\@ifstar\\@hspacer\\@hspace");we("\\@hspace","\\hskip #1\\relax");we("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");we("\\ordinarycolon",":");we("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");we("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');we("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');we("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');we("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');we("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');we("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');we("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');we("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');we("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');we("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');we("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');we("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');we("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');we("∷","\\dblcolon");we("∹","\\eqcolon");we("≔","\\coloneqq");we("≕","\\eqqcolon");we("⩴","\\Coloneqq");we("\\ratio","\\vcentcolon");we("\\coloncolon","\\dblcolon");we("\\colonequals","\\coloneqq");we("\\coloncolonequals","\\Coloneqq");we("\\equalscolon","\\eqqcolon");we("\\equalscoloncolon","\\Eqqcolon");we("\\colonminus","\\coloneq");we("\\coloncolonminus","\\Coloneq");we("\\minuscolon","\\eqcolon");we("\\minuscoloncolon","\\Eqcolon");we("\\coloncolonapprox","\\Colonapprox");we("\\coloncolonsim","\\Colonsim");we("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");we("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");we("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");we("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");we("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");we("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");we("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");we("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");we("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");we("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");we("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");we("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");we("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");we("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");we("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");we("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");we("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");we("\\nleqq","\\html@mathml{\\@nleqq}{≰}");we("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");we("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");we("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");we("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");we("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");we("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");we("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");we("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");we("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");we("\\imath","\\html@mathml{\\@imath}{ı}");we("\\jmath","\\html@mathml{\\@jmath}{ȷ}");we("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");we("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");we("⟦","\\llbracket");we("⟧","\\rrbracket");we("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");we("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");we("⦃","\\lBrace");we("⦄","\\rBrace");we("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");we("⦵","\\minuso");we("\\darr","\\downarrow");we("\\dArr","\\Downarrow");we("\\Darr","\\Downarrow");we("\\lang","\\langle");we("\\rang","\\rangle");we("\\uarr","\\uparrow");we("\\uArr","\\Uparrow");we("\\Uarr","\\Uparrow");we("\\N","\\mathbb{N}");we("\\R","\\mathbb{R}");we("\\Z","\\mathbb{Z}");we("\\alef","\\aleph");we("\\alefsym","\\aleph");we("\\Alpha","\\mathrm{A}");we("\\Beta","\\mathrm{B}");we("\\bull","\\bullet");we("\\Chi","\\mathrm{X}");we("\\clubs","\\clubsuit");we("\\cnums","\\mathbb{C}");we("\\Complex","\\mathbb{C}");we("\\Dagger","\\ddagger");we("\\diamonds","\\diamondsuit");we("\\empty","\\emptyset");we("\\Epsilon","\\mathrm{E}");we("\\Eta","\\mathrm{H}");we("\\exist","\\exists");we("\\harr","\\leftrightarrow");we("\\hArr","\\Leftrightarrow");we("\\Harr","\\Leftrightarrow");we("\\hearts","\\heartsuit");we("\\image","\\Im");we("\\infin","\\infty");we("\\Iota","\\mathrm{I}");we("\\isin","\\in");we("\\Kappa","\\mathrm{K}");we("\\larr","\\leftarrow");we("\\lArr","\\Leftarrow");we("\\Larr","\\Leftarrow");we("\\lrarr","\\leftrightarrow");we("\\lrArr","\\Leftrightarrow");we("\\Lrarr","\\Leftrightarrow");we("\\Mu","\\mathrm{M}");we("\\natnums","\\mathbb{N}");we("\\Nu","\\mathrm{N}");we("\\Omicron","\\mathrm{O}");we("\\plusmn","\\pm");we("\\rarr","\\rightarrow");we("\\rArr","\\Rightarrow");we("\\Rarr","\\Rightarrow");we("\\real","\\Re");we("\\reals","\\mathbb{R}");we("\\Reals","\\mathbb{R}");we("\\Rho","\\mathrm{P}");we("\\sdot","\\cdot");we("\\sect","\\S");we("\\spades","\\spadesuit");we("\\sub","\\subset");we("\\sube","\\subseteq");we("\\supe","\\supseteq");we("\\Tau","\\mathrm{T}");we("\\thetasym","\\vartheta");we("\\weierp","\\wp");we("\\Zeta","\\mathrm{Z}");we("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");we("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");we("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");we("\\bra","\\mathinner{\\langle{#1}|}");we("\\ket","\\mathinner{|{#1}\\rangle}");we("\\braket","\\mathinner{\\langle{#1}\\rangle}");we("\\Bra","\\left\\langle#1\\right|");we("\\Ket","\\left|#1\\right\\rangle");var Yge=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",s),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...a,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};we("\\bra@ket",Yge(!1));we("\\bra@set",Yge(!0));we("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");we("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");we("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");we("\\angln","{\\angl n}");we("\\blue","\\textcolor{##6495ed}{#1}");we("\\orange","\\textcolor{##ffa500}{#1}");we("\\pink","\\textcolor{##ff00af}{#1}");we("\\red","\\textcolor{##df0030}{#1}");we("\\green","\\textcolor{##28ae7b}{#1}");we("\\gray","\\textcolor{gray}{#1}");we("\\purple","\\textcolor{##9d38bd}{#1}");we("\\blueA","\\textcolor{##ccfaff}{#1}");we("\\blueB","\\textcolor{##80f6ff}{#1}");we("\\blueC","\\textcolor{##63d9ea}{#1}");we("\\blueD","\\textcolor{##11accd}{#1}");we("\\blueE","\\textcolor{##0c7f99}{#1}");we("\\tealA","\\textcolor{##94fff5}{#1}");we("\\tealB","\\textcolor{##26edd5}{#1}");we("\\tealC","\\textcolor{##01d1c1}{#1}");we("\\tealD","\\textcolor{##01a995}{#1}");we("\\tealE","\\textcolor{##208170}{#1}");we("\\greenA","\\textcolor{##b6ffb0}{#1}");we("\\greenB","\\textcolor{##8af281}{#1}");we("\\greenC","\\textcolor{##74cf70}{#1}");we("\\greenD","\\textcolor{##1fab54}{#1}");we("\\greenE","\\textcolor{##0d923f}{#1}");we("\\goldA","\\textcolor{##ffd0a9}{#1}");we("\\goldB","\\textcolor{##ffbb71}{#1}");we("\\goldC","\\textcolor{##ff9c39}{#1}");we("\\goldD","\\textcolor{##e07d10}{#1}");we("\\goldE","\\textcolor{##a75a05}{#1}");we("\\redA","\\textcolor{##fca9a9}{#1}");we("\\redB","\\textcolor{##ff8482}{#1}");we("\\redC","\\textcolor{##f9685d}{#1}");we("\\redD","\\textcolor{##e84d39}{#1}");we("\\redE","\\textcolor{##bc2612}{#1}");we("\\maroonA","\\textcolor{##ffbde0}{#1}");we("\\maroonB","\\textcolor{##ff92c6}{#1}");we("\\maroonC","\\textcolor{##ed5fa6}{#1}");we("\\maroonD","\\textcolor{##ca337c}{#1}");we("\\maroonE","\\textcolor{##9e034e}{#1}");we("\\purpleA","\\textcolor{##ddd7ff}{#1}");we("\\purpleB","\\textcolor{##c6b9fc}{#1}");we("\\purpleC","\\textcolor{##aa87ff}{#1}");we("\\purpleD","\\textcolor{##7854ab}{#1}");we("\\purpleE","\\textcolor{##543b78}{#1}");we("\\mintA","\\textcolor{##f5f9e8}{#1}");we("\\mintB","\\textcolor{##edf2df}{#1}");we("\\mintC","\\textcolor{##e0e5cc}{#1}");we("\\grayA","\\textcolor{##f6f7f7}{#1}");we("\\grayB","\\textcolor{##f0f1f2}{#1}");we("\\grayC","\\textcolor{##e3e5e6}{#1}");we("\\grayD","\\textcolor{##d6d8da}{#1}");we("\\grayE","\\textcolor{##babec2}{#1}");we("\\grayF","\\textcolor{##888d93}{#1}");we("\\grayG","\\textcolor{##626569}{#1}");we("\\grayH","\\textcolor{##3b3e40}{#1}");we("\\grayI","\\textcolor{##21242c}{#1}");we("\\kaBlue","\\textcolor{##314453}{#1}");we("\\kaGreen","\\textcolor{##71B307}{#1}");var Xge={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class xrt{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new yrt(vrt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new qZ(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new $o("EOF",n.loc)),this.pushTokens(i),new $o("",co.range(r,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new _t("Extra }",a)}else if(a.text==="EOF")throw new _t("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[o]==="{")&&a.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(s!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new _t("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new _t("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new _t("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new _t("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new _t("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new $o(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var s=i.replace(/##/g,"");s.includes("#"+(a+1));)++a;for(var o=new qZ(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||Md.hasOwnProperty(e)||li.math.hasOwnProperty(e)||li.text.hasOwnProperty(e)||Xge.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Md.hasOwnProperty(e)&&!Md[e].primitive}}var XZ=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,FE=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),vI={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},jZ={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let jge=class Kge{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new xrt(e,r,this.mode),this.settings=r,this.leftrightDepth=0,this.nextToken=null}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new _t("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new $o("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(Kge.endOfExpression.has(i.text)||r&&i.text===r||e&&Md[i.text]&&Md[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=128)this.settings.strict&&(ege(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:co.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h0){if(++e>=cnt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ym(t){return function(){return t}}var KA=(function(){try{var t=hg(Object,"defineProperty");return t({},"",{}),t}catch{}})(),fnt=KA?function(t,e){return KA(t,"toString",{configurable:!0,enumerable:!1,value:Ym(e),writable:!0})}:cg,ome=dnt(fnt);function lme(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var vnt=9007199254740991,bnt=/^(?:0|[1-9]\d*)$/;function BR(t,e){var r=typeof t;return e=e??vnt,!!e&&(r=="number"||r!="symbol"&&bnt.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=wnt}function kf(t){return t!=null&&JV(t.length)&&!qC(t)}function UC(t,e,r){if(!Vo(r))return!1;var n=typeof e;return(n=="number"?kf(r)&&BR(e,r.length):n=="string"&&e in r)?Ex(r[e],t):!1}function Cnt(t){return VR(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&UC(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function Iit(t,e){var r=this.__data__,n=qR(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function zh(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Pst?new jC:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&UC(e[0],e[1],i)&&(n=1);++r-1?i[a?e[s]:s]:void 0}}var Eot=Math.max;function Aot(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Wrt(r);return i<0&&(i=Eot(n+i,0)),cme(t,Sf(e),i)}var dG=Sot(Aot);function Fme(t,e){var r=-1,n=kf(t)?Array(t.length):[];return jR(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function Xi(t,e){var r=Zi(t)?gy:Fme;return r(t,Sf(e))}function _ot(t,e){return t==null?t:cG(t,hG(e),dg)}function Rot(t,e){return t&&uG(t,hG(e))}function Lot(t,e){return t>e}var Mot=Object.prototype,Iot=Mot.hasOwnProperty;function Not(t,e){return t!=null&&Iot.call(t,e)}function zme(t,e){return t!=null&&Dme(t,e,Not)}function Dot(t,e){return gy(e,function(r){return t[r]})}function dh(t){return t==null?[]:Dot(t,Lo(t))}var Oot="[object Map]",$ot="[object Set]",Pot=Object.prototype,Bot=Pot.hasOwnProperty;function EQ(t){if(t==null)return!0;if(kf(t)&&(Zi(t)||typeof t=="string"||typeof t.splice=="function"||Pb(t)||HR(t)||$b(t)))return!t.length;var e=ol(t);if(e==Oot||e==$ot)return!t.size;if(GR(t))return!mme(t).length;for(var r in t)if(Bot.call(t,r))return!1;return!0}function Di(t){return t===void 0}function Vme(t,e){return te||a&&s&&l&&!o&&!u||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function Hot(t,e,r){e.length?e=gy(e,function(a){return Zi(a)?function(s){return XR(s,a.length===1?a[0]:a)}:a}):e=[cg];var n=-1;e=gy(e,WR(Sf));var i=Fme(t,function(a,s,o){var l=gy(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return Vot(i,function(a,s){return Wot(a,s,r)})}function qot(t,e){return zot(t,e,function(r,n){return Ome(t,n)})}var JA=Yit(function(t,e){return t==null?{}:qot(t,e)}),Uot=Math.ceil,Yot=Math.max;function Xot(t,e,r,n){for(var i=-1,a=Yot(Uot((e-t)/(r||1)),0),s=Array(a);a--;)s[++i]=t,t+=r;return s}function jot(t){return function(e,r,n){return n&&typeof n!="number"&&UC(e,r,n)&&(r=n=void 0),e=n3(e),r===void 0?(r=e,e=0):r=n3(r),n=n===void 0?e1&&UC(t,e[0],e[1])?e=[]:r>2&&UC(e[0],e[1],e[2])&&(e=[e[0]]),Hot(t,nG(e),[])}),Zot=1/0,Qot=my&&1/oG(new my([,-0]))[1]==Zot?function(t){return new my(t)}:lnt,Jot=200;function elt(t,e,r){var n=-1,i=ynt,a=t.length,s=!0,o=[],l=o;if(a>=Jot){var u=Qot(t);if(u)return oG(u);s=!1,i=Lme,l=new jC}else l=o;e:for(;++n1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Xf,this._children[e]={},this._children[Xf][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],ft(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),ft(Lo(this._in[e]),r),delete this._in[e],delete this._preds[e],ft(Lo(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Di(r))r=Xf;else{r+="";for(var n=r;!Di(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==Xf)return r}}children(e){if(Di(e)&&(e=Xf),this._isCompound){var r=this._children[e];if(r)return Lo(r)}else{if(e===Xf)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Lo(r)}successors(e){var r=this._sucs[e];if(r)return Lo(r)}neighbors(e){var r=this.predecessors(e);if(r)return tlt(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;ft(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),ft(this._edgeObjs,function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function a(s){var o=n.parent(s);return o===void 0||r.hasNode(o)?(i[s]=o,o):o in i?i[o]:a(o)}return this._isCompound&&ft(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return qC(e)||(e=Ym(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return dh(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return lS(e,function(a,s){return i.length>1?n.setEdge(a,s,r):n.setEdge(a,s),s}),this}setEdge(){var e,r,n,i,a=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,Di(n)||(n=""+n);var o=QT(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!Di(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=slt(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,_Q(this._preds[r],e),_Q(this._sucs[e],r),this._in[r][o]=l,this._out[e][o]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?wI(this._isDirected,arguments[0]):QT(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?wI(this._isDirected,arguments[0]):QT(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?wI(this._isDirected,arguments[0]):QT(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],RQ(this._preds[r],e),RQ(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=dh(n);return r?eh(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=dh(n);return r?eh(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}ms.prototype._nodeCount=0;ms.prototype._edgeCount=0;function _Q(t,e){t[e]?t[e]++:t[e]=1}function RQ(t,e){--t[e]||delete t[e]}function QT(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+AQ+a+AQ+(Di(n)?alt:n)}function slt(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function wI(t,e){return QT(t,e.v,e.w,e.name)}function fh(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:olt(t),edges:llt(t)};return Di(t.graph())||(e.value=_st(t.graph())),e}function olt(t){return Xi(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Di(r)||(i.value=r),Di(n)||(i.parent=n),i})}function llt(t){return Xi(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Di(e.name)||(n.name=e.name),Di(r)||(n.value=r),n})}var Lr=new Map,Id=new Map,Gme=new Map,Wme=x(()=>{Id.clear(),Gme.clear(),Lr.clear()},"clear"),F0=x((t,e)=>{const r=Id.get(e)||[];return le.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),clt=x((t,e)=>{const r=Id.get(e)||[];return le.info("Descendants of ",e," is ",r),le.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||F0(t.v,e)||F0(t.w,e)||r.includes(t.w):(le.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),b$=x((t,e,r,n)=>{le.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),le.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)b$(a,e,r,n);else{const s=e.node(a);le.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(le.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(le.debug("Setting parent",a,t),r.setParent(a,t)):(le.info("In copy ",t,"root",n,"data",e.node(t),n),le.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);le.debug("Copying Edges",o),o.forEach(l=>{le.info("Edge",l);const u=e.edge(l.v,l.w,l.name);le.info("Edge data",u,n);try{if(clt(l,n)){const h=Id.get(n)||[],d=h.includes(l.v)||F0(l.v,n)||l.v===n,f=h.includes(l.w)||F0(l.w,n)||l.w===n;if(d&&f)le.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),le.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const p=d?n:l.v,g=f?n:l.w;le.info("Rebinding cross-boundary edge as ",p,g,u,l.name),e.setEdge(p,g,u,l.name)}}else le.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){le.error(h)}})}le.debug("Removing node",a),e.removeNode(a)})},"copy"),Hme=x((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)Gme.set(i,t),n=[...n,...Hme(i,e)];return n},"extractDescendants"),ult=x((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),s=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>s.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),zb=x((t,e,r)=>{const n=e.children(t);if(le.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=zb(a,e,r),o=ult(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),LQ=x(t=>!Lr.has(t)||!Lr.get(t).externalConnections?t:Lr.has(t)?Lr.get(t).id:t,"getAnchorId"),hlt=x((t,e)=>{var r;if(!t||e>10){le.debug("Opting out, no graph ");return}else le.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(le.warn("Cluster identified",n," Replacement id in edges: ",zb(n,t,n)),Id.set(n,Hme(n,t)),Lr.set(n,{id:zb(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const i=t.children(n),a=t.edges();i.length>0?(le.debug("Cluster identified",n,Id),a.forEach(s=>{const o=F0(s.v,n),l=F0(s.w,n);o^l&&(le.warn("Edge: ",s," leaves cluster ",n),le.warn("Descendants of XXX ",n,": ",Id.get(n)),Lr.get(n).externalConnections=!0)})):le.debug("Not a cluster ",n,Id)});for(let n of Lr.keys()){const i=Lr.get(n).id,a=t.parent(i);a!==n&&Lr.has(a)&&!Lr.get(a).externalConnections&&(Lr.get(n).id=a);const s=t.edges().some(o=>o.v===n);if(i&&((r=Lr.get(n))!=null&&r.externalConnections)&&s&&Yme(t,i,n)){const o=flt(t,n,t.parent(i));o&&(Lr.get(n).id=o)}}t.edges().forEach(function(n){const i=t.edge(n);le.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),le.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let a=n.v,s=n.w;if(le.warn("Fix XXX",Lr,"ids:",n.v,n.w,"Translating: ",Lr.get(n.v)," --- ",Lr.get(n.w)),Lr.get(n.v)||Lr.get(n.w)){if(le.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),a=LQ(n.v),s=LQ(n.w),t.removeEdge(n.v,n.w,n.name),a!==n.v){const o=t.parent(a);Lr.get(o).externalConnections=!0,i.fromCluster=n.v}if(s!==n.w){const o=t.parent(s);Lr.get(o).externalConnections=!0,i.toCluster=n.w}le.warn("Fix Replacing with XXX",a,s,n.name),t.setEdge(a,s,i,n.name)}}),le.warn("Adjusted Graph",fh(t)),qme(t,0),le.trace(Lr)},"adjustClustersAndEdges"),qme=x((t,e)=>{var i,a,s,o;if(le.warn("extractor - ",e,fh(t),t.children("D")),e>10){le.error("Bailing out");return}let r=t.nodes(),n=!1;for(const l of r){const u=t.children(l);n=n||u.length>0}if(!n){le.debug("Done, no node has children",t.nodes());return}le.debug("Nodes = ",r,e);for(const l of r)if(le.debug("Extracting node",l,Lr,Lr.has(l)&&!Lr.get(l).externalConnections,!t.parent(l),t.node(l),t.children("D")," Depth ",e),!Lr.has(l))le.debug("Not a cluster",l,e);else if((a=(i=Lr.get(l))==null?void 0:i.clusterData)!=null&&a.explicitDir&&t.children(l)&&t.children(l).length>0){le.warn("Cluster with explicit dir, creating subgraph for children",l,e);const u=Lr.get(l).clusterData.dir,h=new ms({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b$(l,t,h,l);const d=t.node(l)||{};t.setNode(l,{...d,clusterNode:!0,id:l,clusterData:Lr.get(l).clusterData,label:Lr.get(l).label,graph:h}),le.warn("Subgraph for cluster with explicit dir created:",l,fh(h))}else if(!Lr.get(l).externalConnections&&t.children(l)&&t.children(l).length>0){le.warn("Cluster without external connections, without a parent and with children",l,e);let h=t.graph().rankdir==="TB"?"LR":"TB";(o=(s=Lr.get(l))==null?void 0:s.clusterData)!=null&&o.dir&&(h=Lr.get(l).clusterData.dir,le.warn("Fixing dir",Lr.get(l).clusterData.dir,h));const d=new ms({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b$(l,t,d,l);const f=t.node(l)||{};t.setNode(l,{...f,clusterNode:!0,id:l,clusterData:Lr.get(l).clusterData,label:Lr.get(l).label,graph:d}),le.debug("Old graph after copy",fh(t))}else le.warn("Cluster ** ",l," **not meeting the criteria !externalConnections:",!Lr.get(l).externalConnections," no parent: ",!t.parent(l)," children ",t.children(l)&&t.children(l).length>0,t.children("D"),e),le.debug(Lr);r=t.nodes(),le.warn("New list of nodes",r);for(const l of r){const u=t.node(l);le.warn(" Now next level",l,u),u!=null&&u.clusterNode&&qme(u.graph,e+1)}},"extractor"),Ume=x((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=Ume(t,i);r=[...r,...a]}),r},"sorter"),dlt=x(t=>Ume(t,t.children()),"sortNodesByHierarchy"),Yme=x((t,e,r)=>{let n=t.parent(e);for(;n&&n!==r;){const i=Lr.get(n);if(i&&!i.externalConnections)return!0;n=t.parent(n)}return!1},"isNodeInExtractableCluster"),flt=x((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||F0(i,r))continue;const a=zb(i,t,e);if(a&&!Yme(t,a,e))return a}return null},"findSafeAnchorNode");class plt{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return MQ(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&MQ(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,glt)),n=n._prev;return"["+e.join(", ")+"]"}}function MQ(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function glt(t,e){if(t!=="_next"&&t!=="_prev")return e}var mlt=Ym(1);function ylt(t,e){if(t.nodeCount()<=1)return[];var r=blt(t,e||mlt),n=vlt(r.graph,r.buckets,r.zeroIdx);return Ax(Xi(n,function(i){return t.outEdges(i.v,i.w)}))}function vlt(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)CI(t,e,r,s);for(;s=i.dequeue();)CI(t,e,r,s);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(s=e[o].dequeue(),s){n=n.concat(CI(t,e,r,s,!0));break}}}return n}function CI(t,e,r,n,i){var a=i?[]:void 0;return ft(t.inEdges(n.v),function(s){var o=t.edge(s),l=t.node(s.v);i&&a.push({v:s.v,w:s.w}),l.out-=o,x$(e,r,l)}),ft(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,x$(e,r,u)}),t.removeNode(n.v),a}function blt(t,e){var r=new ms,n=0,i=0;ft(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),ft(t.edges(),function(o){var l=r.edge(o.v,o.w)||0,u=e(o),h=l+u;r.setEdge(o.v,o.w,h),i=Math.max(i,r.node(o.v).out+=u),n=Math.max(n,r.node(o.w).in+=u)});var a=Fb(i+n+3).map(function(){return new plt}),s=n+1;return ft(r.nodes(),function(o){x$(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function x$(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function xlt(t){var e=t.graph().acyclicer==="greedy"?ylt(t,r(t)):Tlt(t);ft(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,gG("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function Tlt(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,ft(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return ft(t.nodes(),i),e}function wlt(t){ft(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function _x(t,e,r,n){var i;do i=gG(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function Clt(t){var e=new ms().setGraph(t.graph());return ft(t.nodes(),function(r){e.setNode(r,t.node(r))}),ft(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function Xme(t){var e=new ms({multigraph:t.isMultigraph()}).setGraph(t.graph());return ft(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),ft(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function IQ(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,u=o):(i<0&&(s=-s),l=s,u=s*a/i),{x:r+l,y:n+u}}function ZR(t){var e=Xi(Fb(jme(t)+1),function(){return[]});return ft(t.nodes(),function(r){var n=t.node(r),i=n.rank;Di(i)||(e[i][n.order]=r)}),e}function klt(t){var e=KC(Xi(t.nodes(),function(r){return t.node(r).rank}));ft(t.nodes(),function(r){var n=t.node(r);zme(n,"rank")&&(n.rank-=e)})}function Slt(t){var e=KC(Xi(t.nodes(),function(a){return t.node(a).rank})),r=[];ft(t.nodes(),function(a){var s=t.node(a).rank-e;r[s]||(r[s]=[]),r[s].push(a)});var n=0,i=t.graph().nodeRankFactor;ft(r,function(a,s){Di(a)&&s%i!==0?--n:n&&ft(a,function(o){t.node(o).rank+=n})})}function NQ(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),_x(t,"border",i,e)}function jme(t){return B0(Xi(t.nodes(),function(e){var r=t.node(e).rank;if(!Di(r))return r}))}function Elt(t,e){var r={lhs:[],rhs:[]};return ft(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function Alt(t,e){return e()}function _lt(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&ft(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;as.lim&&(o=s,l=!0);var u=eh(e.edges(),function(h){return l===$Q(t,t.node(h.v),o)&&l!==$Q(t,t.node(h.w),o)});return pG(u,function(h){return ZC(e,h)})}function iye(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),vG(t),yG(t,e),Wlt(t,e)}function Wlt(t,e){var r=dG(t.nodes(),function(i){return!e.node(i).parent}),n=Vlt(t,r);n=n.slice(1),ft(n,function(i){var a=t.node(i).parent,s=e.edge(i,a),o=!1;s||(s=e.edge(a,i),o=!0),e.node(i).rank=e.node(a).rank+(o?s.minlen:-s.minlen)})}function Hlt(t,e,r){return t.hasEdge(e,r)}function $Q(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function qlt(t){switch(t.graph().ranker){case"network-simplex":PQ(t);break;case"tight-tree":Ylt(t);break;case"longest-path":Ult(t);break;default:PQ(t)}}var Ult=mG;function Ylt(t){mG(t),Zme(t)}function PQ(t){fg(t)}function Xlt(t){var e=_x(t,"root",{},"_root"),r=jlt(t),n=B0(dh(r))-1,i=2*n+1;t.graph().nestingRoot=e,ft(t.edges(),function(s){t.edge(s).minlen*=i});var a=Klt(t)+1;ft(t.children(),function(s){aye(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function aye(t,e,r,n,i,a,s){var o=t.children(s);if(!o.length){s!==e&&t.setEdge(e,s,{weight:0,minlen:r});return}var l=NQ(t,"_bt"),u=NQ(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,ft(o,function(d){aye(t,e,r,n,i,a,d);var f=t.node(d),p=f.borderTop?f.borderTop:d,g=f.borderBottom?f.borderBottom:d,m=f.borderTop?n:2*n,y=p!==g?1:i-a[s]+1;t.setEdge(l,p,{weight:m,minlen:y,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:y,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}function jlt(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&ft(a,function(s){r(s,i+1)}),e[n]=i}return ft(t.children(),function(n){r(n,1)}),e}function Klt(t){return lS(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function Zlt(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,ft(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function Qlt(t,e,r){var n={},i;ft(r,function(a){for(var s=t.parent(a),o,l;s;){if(o=t.parent(s),o?(l=n[o],n[o]=s):(l=i,i=s),l&&l!==s){e.setEdge(l,s);return}s=o}})}function Jlt(t,e,r){var n=ect(t),i=new ms({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return ft(t.nodes(),function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,o||n),ft(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=Di(h)?0:h.weight;i.setEdge(u,a,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i}function ect(t){for(var e;t.hasNode(e=gG("_root")););return e}function tct(t,e){for(var r=0,n=1;n0;)h%2&&(d+=o[h+1]),h=h-1>>1,o[h]+=u.weight;l+=u.weight*d})),l}function nct(t){var e={},r=eh(t.nodes(),function(o){return!t.children(o).length}),n=B0(Xi(r,function(o){return t.node(o).rank})),i=Xi(Fb(n+1),function(){return[]});function a(o){if(!zme(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),ft(t.successors(o),a)}}var s=cS(r,function(o){return t.node(o).rank});return ft(s,a),i}function ict(t,e){return Xi(e,function(r){var n=t.inEdges(r);if(n.length){var i=lS(n,function(a,s){var o=t.edge(s),l=t.node(s.v);return{sum:a.sum+o.weight*l.order,weight:a.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function act(t,e){var r={};ft(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};Di(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),ft(e.edges(),function(i){var a=r[i.v],s=r[i.w];!Di(a)&&!Di(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=eh(r,function(i){return!i.indegree});return sct(n)}function sct(t){var e=[];function r(a){return function(s){s.merged||(Di(s.barycenter)||Di(a.barycenter)||s.barycenter>=a.barycenter)&&oct(a,s)}}function n(a){return function(s){s.in.push(a),--s.indegree===0&&t.push(s)}}for(;t.length;){var i=t.pop();e.push(i),ft(i.in.reverse(),r(i)),ft(i.out,n(i))}return Xi(eh(e,function(a){return!a.merged}),function(a){return JA(a,["vs","i","barycenter","weight"])})}function oct(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function lct(t,e){var r=Elt(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=cS(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(cct(!!e)),l=BQ(a,i,l),ft(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=BQ(a,i,l)});var u={vs:Ax(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function BQ(t,e,r){for(var n;e.length&&(n=QA(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function cct(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function sye(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=eh(i,function(g){return g!==s&&g!==o}));var u=ict(t,i);ft(u,function(g){if(t.children(g.v).length){var m=sye(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&hct(g,m)}});var h=act(u,r);uct(h,l);var d=lct(h,n);if(s&&(d.vs=Ax([s,d.vs,o]),t.predecessors(s).length)){var f=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function uct(t,e){ft(t,function(r){r.vs=Ax(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function hct(t,e){Di(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function dct(t){var e=jme(t),r=FQ(t,Fb(1,e+1),"inEdges"),n=FQ(t,Fb(e-1,-1,-1),"outEdges"),i=nct(t);zQ(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){fct(o%2?r:n,o%4>=2),i=ZR(t);var u=tct(t,i);us||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function mct(t){var e={},r=0;function n(i){var a=r;ft(t.children(i),n),e[i]={low:a,lim:r++}}return ft(t.children(),n),e}function yct(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=QA(a);return ft(a,function(h,d){var f=bct(t,h),p=f?t.node(f).order:l;(f||h===u)&&(ft(a.slice(o,d+1),function(g){ft(t.predecessors(g),function(m){var y=t.node(m),v=y.order;(vu)&&oye(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return ft(s,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(s,u,d,o,l),u=d,o=l)}n(s,u,s.length,l,a.length)}),s}return lS(e,i),r}function bct(t,e){if(t.node(e).dummy)return dG(t.predecessors(e),function(r){return t.node(r).dummy})}function oye(t,e,r){if(e>r){var n=e;e=r,r=n}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=t[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function xct(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function Tct(t,e,r,n){var i={},a={},s={};return ft(e,function(o){ft(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),ft(e,function(o){var l=-1;ft(o,function(u){var h=n(u);if(h.length){h=cS(h,function(m){return s[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];a[u]===u&&l{var n=r(" buildLayoutGraph",()=>Gct(t));r(" runLayout",()=>Ict(n,r)),r(" updateInputGraph",()=>Nct(t,n))})}function Ict(t,e){e(" makeSpaceForEdgeLabels",()=>Wct(t)),e(" removeSelfEdges",()=>Qct(t)),e(" acyclic",()=>xlt(t)),e(" nestingGraph.run",()=>Xlt(t)),e(" rank",()=>qlt(Xme(t))),e(" injectEdgeLabelProxies",()=>Hct(t)),e(" removeEmptyRanks",()=>Slt(t)),e(" nestingGraph.cleanup",()=>Zlt(t)),e(" normalizeRanks",()=>klt(t)),e(" assignRankMinMax",()=>qct(t)),e(" removeEdgeLabelProxies",()=>Uct(t)),e(" normalize.run",()=>Nlt(t)),e(" parentDummyChains",()=>pct(t)),e(" addBorderSegments",()=>_lt(t)),e(" order",()=>dct(t)),e(" insertSelfEdges",()=>Jct(t)),e(" adjustCoordinateSystem",()=>Rlt(t)),e(" position",()=>Lct(t)),e(" positionSelfEdges",()=>eut(t)),e(" removeBorderNodes",()=>Zct(t)),e(" normalize.undo",()=>Olt(t)),e(" fixupEdgeLabelCoords",()=>jct(t)),e(" undoCoordinateSystem",()=>Llt(t)),e(" translateGraph",()=>Yct(t)),e(" assignNodeIntersects",()=>Xct(t)),e(" reversePoints",()=>Kct(t)),e(" acyclic.undo",()=>wlt(t))}function Nct(t,e){ft(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),ft(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var Dct=["nodesep","edgesep","ranksep","marginx","marginy"],Oct={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},$ct=["acyclicer","ranker","rankdir","align"],Pct=["width","height"],Bct={width:0,height:0},Fct=["minlen","weight","width","height","labeloffset"],zct={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Vct=["labelpos"];function Gct(t){var e=new ms({multigraph:!0,compound:!0}),r=AI(t.graph());return e.setGraph(v$({},Oct,EI(r,Dct),JA(r,$ct))),ft(t.nodes(),function(n){var i=AI(t.node(n));e.setNode(n,Tot(EI(i,Pct),Bct)),e.setParent(n,t.parent(n))}),ft(t.edges(),function(n){var i=AI(t.edge(n));e.setEdge(n,v$({},zct,EI(i,Fct),JA(i,Vct)))}),e}function Wct(t){var e=t.graph();e.ranksep/=2,ft(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function Hct(t){ft(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};_x(t,"edge-proxy",a,"_ep")}})}function qct(t){var e=0;ft(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=B0(e,n.maxRank))}),t.graph().maxRank=e}function Uct(t){ft(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function Yct(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,o=a.marginy||0;function l(u){var h=u.x,d=u.y,f=u.width,p=u.height;e=Math.min(e,h-f/2),r=Math.max(r,h+f/2),n=Math.min(n,d-p/2),i=Math.max(i,d+p/2)}ft(t.nodes(),function(u){l(t.node(u))}),ft(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,ft(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),ft(t.edges(),function(u){var h=t.edge(u);ft(h.points,function(d){d.x-=e,d.y-=n}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=e),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=n)}),a.width=r-e+s,a.height=i-n+o}function Xct(t){ft(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=n),r.points.unshift(IQ(n,a)),r.points.push(IQ(i,s))})}function jct(t){ft(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Kct(t){ft(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function Zct(t){ft(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(QA(r.borderLeft)),s=t.node(QA(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),ft(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function Qct(t){ft(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function Jct(t){var e=ZR(t);ft(e,function(r){var n=0;ft(r,function(i,a){var s=t.node(i);s.order=a+n,ft(s.selfEdges,function(o){_x(t,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:a+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function eut(t){ft(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function EI(t,e){return KR(JA(t,e),Number)}function AI(t){var e={};return ft(t,function(r,n){e[n.toLowerCase()]=r}),e}var VQ=x((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),GQ=x((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),tut=x(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),rut=x((t,e,r,n,i)=>{const a=[],s=new Set;if(r.forEach(({start:h,end:d})=>{h!==n&&s.add(h),d!==n&&s.add(d)}),s.forEach(h=>{const d=t.node(h);typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)}),a.length===0&&r.forEach(({edge:h})=>{(h.points??[]).forEach(d=>{typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)})}),a.length===0)return GQ(i);const o=a.reduce((h,d)=>({x:h.x+d.x/a.length,y:h.y+d.y/a.length}),{x:0,y:0}),l=o.x-e.x,u=o.y-e.y;return Math.abs(l)>Math.abs(u)?l>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":GQ(i)},"getSelfLoopSide"),nut=x((t,e="top",r=0,n=0)=>{const i=t.x,a=t.y-r,s=t.width/2,o=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),u=VQ(Math.max(n,t.width*.35),36,l),h=VQ(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const d=a+o;return[{x:i-u/2,y:d},{x:i-u/2,y:d+h},{x:i+u/2,y:d+h},{x:i+u/2,y:d}]}case"right":{const d=i+s;return[{x:d,y:a-u/2},{x:d+h,y:a-u/2},{x:d+h,y:a+u/2},{x:d,y:a+u/2}]}case"left":{const d=i-s;return[{x:d,y:a-u/2},{x:d-h,y:a-u/2},{x:d-h,y:a+u/2},{x:d,y:a+u/2}]}case"top":default:{const d=a-o;return[{x:i-u/2,y:d},{x:i-u/2,y:d-h},{x:i+u/2,y:d-h},{x:i+u/2,y:d}]}}},"getSelfLoopPoints"),iut=x((t,e,r="top",n=0,i={})=>{const s=t.x,o=t.y-n,l=i.width??0,u=i.height??0;switch(r){case"bottom":return{x:s,y:Math.max(...e.map(h=>h.y))+u/2+4};case"right":return{x:Math.max(...e.map(h=>h.x))+l/2+4,y:o};case"left":return{x:Math.min(...e.map(h=>h.x))-l/2-4,y:o};case"top":default:return{x:s,y:Math.min(...e.map(h=>h.y))-u/2-4}}},"getSelfLoopLabelPosition"),cye=x((t,e=0,{mergeSelfLoops:r=!0}={})=>{var s;const n=new Map,i=[],a=(s=t.graph())==null?void 0:s.rankdir;return t.edges().forEach(o=>{const l=t.edge(o);if(r&&l.selfLoop){const u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:o.v,end:o.w})}else i.push({edge:l,start:o.v,end:o.w})}),n.forEach(o=>{if(o.length!==3){o.forEach(T=>i.push(T));return}o.sort((T,b)=>T.edge.selfLoop.order-b.edge.selfLoop.order);const[l,u,h]=o,d=l.edge.originalEdge??u.edge.originalEdge??h.edge.originalEdge??u.edge,f=t.node(d.start);if(!f){o.forEach(T=>i.push(T));return}const p={width:u.edge.width,height:u.edge.height},g=rut(t,f,o,d.start,a),m=nut(f,g,e,p.width??0),y=iut(f,m,g,e,p),v={...u.edge,...d,id:d.id,points:m,start:d.start,end:d.end,x:y.x,y:y.y,width:p.width,height:p.height,labelStyle:u.edge.labelStyle,fromCluster:l.edge.fromCluster??u.edge.fromCluster??h.edge.fromCluster,toCluster:l.edge.toCluster??u.edge.toCluster??h.edge.toCluster};delete v.selfLoop,delete v.originalEdge,i.push({edge:v,start:v.start,end:v.end})}),i},"getEdgesToRender"),uye=x(async(t,e,r,n,i,a)=>{le.warn("Graph in recursive render:XAX",fh(e),i);const s=e.graph().rankdir;le.trace("Dir in recursive render - dir:",s);const o=t.insert("g").attr("class","root");e.nodes()?le.info("Recursive render XXX",e.nodes()):le.info("No nodes found for",e),e.edges().length>0&&le.info("Recursive edges",e.edge(e.edges()[0]));const l=o.insert("g").attr("class","clusters"),u=o.insert("g").attr("class","edgePaths"),h=o.insert("g").attr("class","edgeLabels"),d=o.insert("g").attr("class","nodes"),f=tut(r);await Promise.all(e.nodes().map(async function(T){const b=e.node(T);if(i!==void 0){const w=JSON.parse(JSON.stringify(i.clusterData));le.trace(`Setting data for parent cluster XXX +?)[ \r ]*`,h$="[̀-ͯ]",vrt=new RegExp(h$+"+$"),brt="("+Uge+"+)|"+(yrt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(h$+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(h$+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+mrt)+("|"+grt+")");let UZ=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(brt,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new $o("EOF",new co(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new _t("Unexpected character: '"+e[r]+"'",new $o(e[r],new co(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(` +`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new $o(i,new co(this,r,this.tokenRegex.lastIndex))}};class xrt{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new _t("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var Trt=Oge;we("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});we("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});we("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});we("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});we("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});we("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");we("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var YZ={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};we("\\char",function(t){var e=t.popToken(),r,n=0;if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new _t("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=YZ[e.text],n==null||n>=r)throw new _t("Invalid base-"+r+" digit "+e.text);for(var i;(i=YZ[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new _t("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new _t("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new _t("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new _t("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};we("\\newcommand",t=>jV(t,!1,!0,!1));we("\\renewcommand",t=>jV(t,!0,!1,!1));we("\\providecommand",t=>jV(t,!0,!0,!0));we("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});we("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});we("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),Md[r],li.math[r],li.text[r]),""});we("\\bgroup","{");we("\\egroup","}");we("~","\\nobreakspace");we("\\lq","`");we("\\rq","'");we("\\aa","\\r a");we("\\AA","\\r A");we("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");we("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");we("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");we("ℬ","\\mathscr{B}");we("ℰ","\\mathscr{E}");we("ℱ","\\mathscr{F}");we("ℋ","\\mathscr{H}");we("ℐ","\\mathscr{I}");we("ℒ","\\mathscr{L}");we("ℳ","\\mathscr{M}");we("ℛ","\\mathscr{R}");we("ℭ","\\mathfrak{C}");we("ℌ","\\mathfrak{H}");we("ℨ","\\mathfrak{Z}");we("\\Bbbk","\\Bbb{k}");we("\\llap","\\mathllap{\\textrm{#1}}");we("\\rlap","\\mathrlap{\\textrm{#1}}");we("\\clap","\\mathclap{\\textrm{#1}}");we("\\mathstrut","\\vphantom{(}");we("\\underbar","\\underline{\\text{#1}}");we("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');we("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");we("\\ne","\\neq");we("≠","\\neq");we("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");we("∉","\\notin");we("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");we("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");we("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");we("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");we("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");we("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");we("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");we("⟂","\\perp");we("‼","\\mathclose{!\\mkern-0.8mu!}");we("∌","\\notni");we("⌜","\\ulcorner");we("⌝","\\urcorner");we("⌞","\\llcorner");we("⌟","\\lrcorner");we("©","\\copyright");we("®","\\textregistered");we("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');we("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');we("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');we("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');we("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");we("⋮","\\vdots");we("\\varGamma","\\mathit{\\Gamma}");we("\\varDelta","\\mathit{\\Delta}");we("\\varTheta","\\mathit{\\Theta}");we("\\varLambda","\\mathit{\\Lambda}");we("\\varXi","\\mathit{\\Xi}");we("\\varPi","\\mathit{\\Pi}");we("\\varSigma","\\mathit{\\Sigma}");we("\\varUpsilon","\\mathit{\\Upsilon}");we("\\varPhi","\\mathit{\\Phi}");we("\\varPsi","\\mathit{\\Psi}");we("\\varOmega","\\mathit{\\Omega}");we("\\substack","\\begin{subarray}{c}#1\\end{subarray}");we("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");we("\\boxed","\\fbox{$\\displaystyle{#1}$}");we("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");we("\\implies","\\DOTSB\\;\\Longrightarrow\\;");we("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");we("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");we("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var XZ={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},wrt=new Set(["bin","rel"]);we("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in XZ?e=XZ[r]:(r.slice(0,4)==="\\not"||r in li.math&&wrt.has(li.math[r].group))&&(e="\\dotsb"),e});var KV={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};we("\\dotso",function(t){var e=t.future().text;return e in KV?"\\ldots\\,":"\\ldots"});we("\\dotsc",function(t){var e=t.future().text;return e in KV&&e!==","?"\\ldots\\,":"\\ldots"});we("\\cdots",function(t){var e=t.future().text;return e in KV?"\\@cdots\\,":"\\@cdots"});we("\\dotsb","\\cdots");we("\\dotsm","\\cdots");we("\\dotsi","\\!\\cdots");we("\\dotsx","\\ldots\\,");we("\\DOTSI","\\relax");we("\\DOTSB","\\relax");we("\\DOTSX","\\relax");we("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");we("\\,","\\tmspace+{3mu}{.1667em}");we("\\thinspace","\\,");we("\\>","\\mskip{4mu}");we("\\:","\\tmspace+{4mu}{.2222em}");we("\\medspace","\\:");we("\\;","\\tmspace+{5mu}{.2777em}");we("\\thickspace","\\;");we("\\!","\\tmspace-{3mu}{.1667em}");we("\\negthinspace","\\!");we("\\negmedspace","\\tmspace-{4mu}{.2222em}");we("\\negthickspace","\\tmspace-{5mu}{.277em}");we("\\enspace","\\kern.5em ");we("\\enskip","\\hskip.5em\\relax");we("\\quad","\\hskip1em\\relax");we("\\qquad","\\hskip2em\\relax");we("\\tag","\\@ifstar\\tag@literal\\tag@paren");we("\\tag@paren","\\tag@literal{({#1})}");we("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new _t("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});we("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");we("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");we("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");we("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");we("\\newline","\\\\\\relax");we("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Yge=Mt(Bc["Main-Regular"][84][1]-.7*Bc["Main-Regular"][65][1]);we("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Yge+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");we("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Yge+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");we("\\hspace","\\@ifstar\\@hspacer\\@hspace");we("\\@hspace","\\hskip #1\\relax");we("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");we("\\ordinarycolon",":");we("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");we("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');we("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');we("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');we("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');we("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');we("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');we("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');we("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');we("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');we("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');we("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');we("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');we("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');we("∷","\\dblcolon");we("∹","\\eqcolon");we("≔","\\coloneqq");we("≕","\\eqqcolon");we("⩴","\\Coloneqq");we("\\ratio","\\vcentcolon");we("\\coloncolon","\\dblcolon");we("\\colonequals","\\coloneqq");we("\\coloncolonequals","\\Coloneqq");we("\\equalscolon","\\eqqcolon");we("\\equalscoloncolon","\\Eqqcolon");we("\\colonminus","\\coloneq");we("\\coloncolonminus","\\Coloneq");we("\\minuscolon","\\eqcolon");we("\\minuscoloncolon","\\Eqcolon");we("\\coloncolonapprox","\\Colonapprox");we("\\coloncolonsim","\\Colonsim");we("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");we("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");we("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");we("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");we("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");we("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");we("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");we("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");we("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");we("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");we("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");we("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");we("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");we("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");we("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");we("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");we("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");we("\\nleqq","\\html@mathml{\\@nleqq}{≰}");we("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");we("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");we("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");we("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");we("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");we("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");we("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");we("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");we("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");we("\\imath","\\html@mathml{\\@imath}{ı}");we("\\jmath","\\html@mathml{\\@jmath}{ȷ}");we("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");we("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");we("⟦","\\llbracket");we("⟧","\\rrbracket");we("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");we("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");we("⦃","\\lBrace");we("⦄","\\rBrace");we("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");we("⦵","\\minuso");we("\\darr","\\downarrow");we("\\dArr","\\Downarrow");we("\\Darr","\\Downarrow");we("\\lang","\\langle");we("\\rang","\\rangle");we("\\uarr","\\uparrow");we("\\uArr","\\Uparrow");we("\\Uarr","\\Uparrow");we("\\N","\\mathbb{N}");we("\\R","\\mathbb{R}");we("\\Z","\\mathbb{Z}");we("\\alef","\\aleph");we("\\alefsym","\\aleph");we("\\Alpha","\\mathrm{A}");we("\\Beta","\\mathrm{B}");we("\\bull","\\bullet");we("\\Chi","\\mathrm{X}");we("\\clubs","\\clubsuit");we("\\cnums","\\mathbb{C}");we("\\Complex","\\mathbb{C}");we("\\Dagger","\\ddagger");we("\\diamonds","\\diamondsuit");we("\\empty","\\emptyset");we("\\Epsilon","\\mathrm{E}");we("\\Eta","\\mathrm{H}");we("\\exist","\\exists");we("\\harr","\\leftrightarrow");we("\\hArr","\\Leftrightarrow");we("\\Harr","\\Leftrightarrow");we("\\hearts","\\heartsuit");we("\\image","\\Im");we("\\infin","\\infty");we("\\Iota","\\mathrm{I}");we("\\isin","\\in");we("\\Kappa","\\mathrm{K}");we("\\larr","\\leftarrow");we("\\lArr","\\Leftarrow");we("\\Larr","\\Leftarrow");we("\\lrarr","\\leftrightarrow");we("\\lrArr","\\Leftrightarrow");we("\\Lrarr","\\Leftrightarrow");we("\\Mu","\\mathrm{M}");we("\\natnums","\\mathbb{N}");we("\\Nu","\\mathrm{N}");we("\\Omicron","\\mathrm{O}");we("\\plusmn","\\pm");we("\\rarr","\\rightarrow");we("\\rArr","\\Rightarrow");we("\\Rarr","\\Rightarrow");we("\\real","\\Re");we("\\reals","\\mathbb{R}");we("\\Reals","\\mathbb{R}");we("\\Rho","\\mathrm{P}");we("\\sdot","\\cdot");we("\\sect","\\S");we("\\spades","\\spadesuit");we("\\sub","\\subset");we("\\sube","\\subseteq");we("\\supe","\\supseteq");we("\\Tau","\\mathrm{T}");we("\\thetasym","\\vartheta");we("\\weierp","\\wp");we("\\Zeta","\\mathrm{Z}");we("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");we("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");we("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");we("\\bra","\\mathinner{\\langle{#1}|}");we("\\ket","\\mathinner{|{#1}\\rangle}");we("\\braket","\\mathinner{\\langle{#1}\\rangle}");we("\\Bra","\\left\\langle#1\\right|");we("\\Ket","\\left|#1\\right\\rangle");var Xge=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",s),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...a,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};we("\\bra@ket",Xge(!1));we("\\bra@set",Xge(!0));we("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");we("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");we("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");we("\\angln","{\\angl n}");we("\\blue","\\textcolor{##6495ed}{#1}");we("\\orange","\\textcolor{##ffa500}{#1}");we("\\pink","\\textcolor{##ff00af}{#1}");we("\\red","\\textcolor{##df0030}{#1}");we("\\green","\\textcolor{##28ae7b}{#1}");we("\\gray","\\textcolor{gray}{#1}");we("\\purple","\\textcolor{##9d38bd}{#1}");we("\\blueA","\\textcolor{##ccfaff}{#1}");we("\\blueB","\\textcolor{##80f6ff}{#1}");we("\\blueC","\\textcolor{##63d9ea}{#1}");we("\\blueD","\\textcolor{##11accd}{#1}");we("\\blueE","\\textcolor{##0c7f99}{#1}");we("\\tealA","\\textcolor{##94fff5}{#1}");we("\\tealB","\\textcolor{##26edd5}{#1}");we("\\tealC","\\textcolor{##01d1c1}{#1}");we("\\tealD","\\textcolor{##01a995}{#1}");we("\\tealE","\\textcolor{##208170}{#1}");we("\\greenA","\\textcolor{##b6ffb0}{#1}");we("\\greenB","\\textcolor{##8af281}{#1}");we("\\greenC","\\textcolor{##74cf70}{#1}");we("\\greenD","\\textcolor{##1fab54}{#1}");we("\\greenE","\\textcolor{##0d923f}{#1}");we("\\goldA","\\textcolor{##ffd0a9}{#1}");we("\\goldB","\\textcolor{##ffbb71}{#1}");we("\\goldC","\\textcolor{##ff9c39}{#1}");we("\\goldD","\\textcolor{##e07d10}{#1}");we("\\goldE","\\textcolor{##a75a05}{#1}");we("\\redA","\\textcolor{##fca9a9}{#1}");we("\\redB","\\textcolor{##ff8482}{#1}");we("\\redC","\\textcolor{##f9685d}{#1}");we("\\redD","\\textcolor{##e84d39}{#1}");we("\\redE","\\textcolor{##bc2612}{#1}");we("\\maroonA","\\textcolor{##ffbde0}{#1}");we("\\maroonB","\\textcolor{##ff92c6}{#1}");we("\\maroonC","\\textcolor{##ed5fa6}{#1}");we("\\maroonD","\\textcolor{##ca337c}{#1}");we("\\maroonE","\\textcolor{##9e034e}{#1}");we("\\purpleA","\\textcolor{##ddd7ff}{#1}");we("\\purpleB","\\textcolor{##c6b9fc}{#1}");we("\\purpleC","\\textcolor{##aa87ff}{#1}");we("\\purpleD","\\textcolor{##7854ab}{#1}");we("\\purpleE","\\textcolor{##543b78}{#1}");we("\\mintA","\\textcolor{##f5f9e8}{#1}");we("\\mintB","\\textcolor{##edf2df}{#1}");we("\\mintC","\\textcolor{##e0e5cc}{#1}");we("\\grayA","\\textcolor{##f6f7f7}{#1}");we("\\grayB","\\textcolor{##f0f1f2}{#1}");we("\\grayC","\\textcolor{##e3e5e6}{#1}");we("\\grayD","\\textcolor{##d6d8da}{#1}");we("\\grayE","\\textcolor{##babec2}{#1}");we("\\grayF","\\textcolor{##888d93}{#1}");we("\\grayG","\\textcolor{##626569}{#1}");we("\\grayH","\\textcolor{##3b3e40}{#1}");we("\\grayI","\\textcolor{##21242c}{#1}");we("\\kaBlue","\\textcolor{##314453}{#1}");we("\\kaGreen","\\textcolor{##71B307}{#1}");var jge={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Crt{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new xrt(Trt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new UZ(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new $o("EOF",n.loc)),this.pushTokens(i),new $o("",co.range(r,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new _t("Extra }",a)}else if(a.text==="EOF")throw new _t("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[o]==="{")&&a.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(s!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new _t("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new _t("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new _t("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new _t("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new _t("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new $o(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var s=i.replace(/##/g,"");s.includes("#"+(a+1));)++a;for(var o=new UZ(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||Md.hasOwnProperty(e)||li.math.hasOwnProperty(e)||li.text.hasOwnProperty(e)||jge.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Md.hasOwnProperty(e)&&!Md[e].primitive}}var jZ=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,FE=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),vI={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},KZ={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let Kge=class Zge{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Crt(e,r,this.mode),this.settings=r,this.leftrightDepth=0,this.nextToken=null}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new _t("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new $o("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(Zge.endOfExpression.has(i.text)||r&&i.text===r||e&&Md[i.text]&&Md[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=128)this.settings.strict&&(tge(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:co.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h0){if(++e>=dnt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ym(t){return function(){return t}}var KA=(function(){try{var t=hg(Object,"defineProperty");return t({},"",{}),t}catch{}})(),mnt=KA?function(t,e){return KA(t,"toString",{configurable:!0,enumerable:!1,value:Ym(e),writable:!0})}:cg,lme=gnt(mnt);function cme(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var Tnt=9007199254740991,wnt=/^(?:0|[1-9]\d*)$/;function BR(t,e){var r=typeof t;return e=e??Tnt,!!e&&(r=="number"||r!="symbol"&&wnt.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=Snt}function kf(t){return t!=null&&JV(t.length)&&!qC(t)}function UC(t,e,r){if(!Vo(r))return!1;var n=typeof e;return(n=="number"?kf(r)&&BR(e,r.length):n=="string"&&e in r)?Ex(r[e],t):!1}function Ent(t){return VR(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&UC(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function Oit(t,e){var r=this.__data__,n=qR(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function zh(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&zst?new jC:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&UC(e[0],e[1],i)&&(n=1);++r-1?i[a?e[s]:s]:void 0}}var Rot=Math.max;function Lot(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Urt(r);return i<0&&(i=Rot(n+i,0)),ume(t,Sf(e),i)}var dG=_ot(Lot);function zme(t,e){var r=-1,n=kf(t)?Array(t.length):[];return jR(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function Xi(t,e){var r=Zi(t)?gy:zme;return r(t,Sf(e))}function Mot(t,e){return t==null?t:cG(t,hG(e),dg)}function Iot(t,e){return t&&uG(t,hG(e))}function Not(t,e){return t>e}var Dot=Object.prototype,Oot=Dot.hasOwnProperty;function $ot(t,e){return t!=null&&Oot.call(t,e)}function Vme(t,e){return t!=null&&Ome(t,e,$ot)}function Pot(t,e){return gy(e,function(r){return t[r]})}function dh(t){return t==null?[]:Pot(t,Lo(t))}var Bot="[object Map]",Fot="[object Set]",zot=Object.prototype,Vot=zot.hasOwnProperty;function AQ(t){if(t==null)return!0;if(kf(t)&&(Zi(t)||typeof t=="string"||typeof t.splice=="function"||Pb(t)||HR(t)||$b(t)))return!t.length;var e=ol(t);if(e==Bot||e==Fot)return!t.size;if(GR(t))return!yme(t).length;for(var r in t)if(Vot.call(t,r))return!1;return!0}function Di(t){return t===void 0}function Gme(t,e){return te||a&&s&&l&&!o&&!u||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function Yot(t,e,r){e.length?e=gy(e,function(a){return Zi(a)?function(s){return XR(s,a.length===1?a[0]:a)}:a}):e=[cg];var n=-1;e=gy(e,WR(Sf));var i=zme(t,function(a,s,o){var l=gy(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return Hot(i,function(a,s){return Uot(a,s,r)})}function Xot(t,e){return Wot(t,e,function(r,n){return $me(t,n)})}var JA=Kit(function(t,e){return t==null?{}:Xot(t,e)}),jot=Math.ceil,Kot=Math.max;function Zot(t,e,r,n){for(var i=-1,a=Kot(jot((e-t)/(r||1)),0),s=Array(a);a--;)s[++i]=t,t+=r;return s}function Qot(t){return function(e,r,n){return n&&typeof n!="number"&&UC(e,r,n)&&(r=n=void 0),e=n3(e),r===void 0?(r=e,e=0):r=n3(r),n=n===void 0?e1&&UC(t,e[0],e[1])?e=[]:r>2&&UC(e[0],e[1],e[2])&&(e=[e[0]]),Yot(t,nG(e),[])}),elt=1/0,tlt=my&&1/oG(new my([,-0]))[1]==elt?function(t){return new my(t)}:hnt,rlt=200;function nlt(t,e,r){var n=-1,i=xnt,a=t.length,s=!0,o=[],l=o;if(a>=rlt){var u=tlt(t);if(u)return oG(u);s=!1,i=Mme,l=new jC}else l=o;e:for(;++n1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Xf,this._children[e]={},this._children[Xf][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],ft(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),ft(Lo(this._in[e]),r),delete this._in[e],delete this._preds[e],ft(Lo(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Di(r))r=Xf;else{r+="";for(var n=r;!Di(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==Xf)return r}}children(e){if(Di(e)&&(e=Xf),this._isCompound){var r=this._children[e];if(r)return Lo(r)}else{if(e===Xf)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Lo(r)}successors(e){var r=this._sucs[e];if(r)return Lo(r)}neighbors(e){var r=this.predecessors(e);if(r)return ilt(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;ft(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),ft(this._edgeObjs,function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function a(s){var o=n.parent(s);return o===void 0||r.hasNode(o)?(i[s]=o,o):o in i?i[o]:a(o)}return this._isCompound&&ft(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return qC(e)||(e=Ym(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return dh(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return lS(e,function(a,s){return i.length>1?n.setEdge(a,s,r):n.setEdge(a,s),s}),this}setEdge(){var e,r,n,i,a=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,Di(n)||(n=""+n);var o=QT(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!Di(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=clt(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,RQ(this._preds[r],e),RQ(this._sucs[e],r),this._in[r][o]=l,this._out[e][o]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?wI(this._isDirected,arguments[0]):QT(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?wI(this._isDirected,arguments[0]):QT(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?wI(this._isDirected,arguments[0]):QT(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],LQ(this._preds[r],e),LQ(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=dh(n);return r?eh(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=dh(n);return r?eh(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}ms.prototype._nodeCount=0;ms.prototype._edgeCount=0;function RQ(t,e){t[e]?t[e]++:t[e]=1}function LQ(t,e){--t[e]||delete t[e]}function QT(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+_Q+a+_Q+(Di(n)?llt:n)}function clt(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function wI(t,e){return QT(t,e.v,e.w,e.name)}function fh(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:ult(t),edges:hlt(t)};return Di(t.graph())||(e.value=Mst(t.graph())),e}function ult(t){return Xi(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Di(r)||(i.value=r),Di(n)||(i.parent=n),i})}function hlt(t){return Xi(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Di(e.name)||(n.name=e.name),Di(r)||(n.value=r),n})}var Lr=new Map,Id=new Map,Wme=new Map,Hme=x(()=>{Id.clear(),Wme.clear(),Lr.clear()},"clear"),F0=x((t,e)=>{const r=Id.get(e)||[];return le.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),dlt=x((t,e)=>{const r=Id.get(e)||[];return le.info("Descendants of ",e," is ",r),le.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||F0(t.v,e)||F0(t.w,e)||r.includes(t.w):(le.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),b$=x((t,e,r,n)=>{le.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),le.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)b$(a,e,r,n);else{const s=e.node(a);le.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(le.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(le.debug("Setting parent",a,t),r.setParent(a,t)):(le.info("In copy ",t,"root",n,"data",e.node(t),n),le.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);le.debug("Copying Edges",o),o.forEach(l=>{le.info("Edge",l);const u=e.edge(l.v,l.w,l.name);le.info("Edge data",u,n);try{if(dlt(l,n)){const h=Id.get(n)||[],d=h.includes(l.v)||F0(l.v,n)||l.v===n,f=h.includes(l.w)||F0(l.w,n)||l.w===n;if(d&&f)le.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),le.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const p=d?n:l.v,g=f?n:l.w;le.info("Rebinding cross-boundary edge as ",p,g,u,l.name),e.setEdge(p,g,u,l.name)}}else le.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){le.error(h)}})}le.debug("Removing node",a),e.removeNode(a)})},"copy"),qme=x((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)Wme.set(i,t),n=[...n,...qme(i,e)];return n},"extractDescendants"),flt=x((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),s=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>s.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),zb=x((t,e,r)=>{const n=e.children(t);if(le.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=zb(a,e,r),o=flt(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),MQ=x(t=>!Lr.has(t)||!Lr.get(t).externalConnections?t:Lr.has(t)?Lr.get(t).id:t,"getAnchorId"),plt=x((t,e)=>{var r;if(!t||e>10){le.debug("Opting out, no graph ");return}else le.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(le.warn("Cluster identified",n," Replacement id in edges: ",zb(n,t,n)),Id.set(n,qme(n,t)),Lr.set(n,{id:zb(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const i=t.children(n),a=t.edges();i.length>0?(le.debug("Cluster identified",n,Id),a.forEach(s=>{const o=F0(s.v,n),l=F0(s.w,n);o^l&&(le.warn("Edge: ",s," leaves cluster ",n),le.warn("Descendants of XXX ",n,": ",Id.get(n)),Lr.get(n).externalConnections=!0)})):le.debug("Not a cluster ",n,Id)});for(let n of Lr.keys()){const i=Lr.get(n).id,a=t.parent(i);a!==n&&Lr.has(a)&&!Lr.get(a).externalConnections&&(Lr.get(n).id=a);const s=t.edges().some(o=>o.v===n);if(i&&((r=Lr.get(n))!=null&&r.externalConnections)&&s&&Xme(t,i,n)){const o=mlt(t,n,t.parent(i));o&&(Lr.get(n).id=o)}}t.edges().forEach(function(n){const i=t.edge(n);le.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),le.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let a=n.v,s=n.w;if(le.warn("Fix XXX",Lr,"ids:",n.v,n.w,"Translating: ",Lr.get(n.v)," --- ",Lr.get(n.w)),Lr.get(n.v)||Lr.get(n.w)){if(le.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),a=MQ(n.v),s=MQ(n.w),t.removeEdge(n.v,n.w,n.name),a!==n.v){const o=t.parent(a);Lr.get(o).externalConnections=!0,i.fromCluster=n.v}if(s!==n.w){const o=t.parent(s);Lr.get(o).externalConnections=!0,i.toCluster=n.w}le.warn("Fix Replacing with XXX",a,s,n.name),t.setEdge(a,s,i,n.name)}}),le.warn("Adjusted Graph",fh(t)),Ume(t,0),le.trace(Lr)},"adjustClustersAndEdges"),Ume=x((t,e)=>{var i,a,s,o;if(le.warn("extractor - ",e,fh(t),t.children("D")),e>10){le.error("Bailing out");return}let r=t.nodes(),n=!1;for(const l of r){const u=t.children(l);n=n||u.length>0}if(!n){le.debug("Done, no node has children",t.nodes());return}le.debug("Nodes = ",r,e);for(const l of r)if(le.debug("Extracting node",l,Lr,Lr.has(l)&&!Lr.get(l).externalConnections,!t.parent(l),t.node(l),t.children("D")," Depth ",e),!Lr.has(l))le.debug("Not a cluster",l,e);else if((a=(i=Lr.get(l))==null?void 0:i.clusterData)!=null&&a.explicitDir&&t.children(l)&&t.children(l).length>0){le.warn("Cluster with explicit dir, creating subgraph for children",l,e);const u=Lr.get(l).clusterData.dir,h=new ms({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b$(l,t,h,l);const d=t.node(l)||{};t.setNode(l,{...d,clusterNode:!0,id:l,clusterData:Lr.get(l).clusterData,label:Lr.get(l).label,graph:h}),le.warn("Subgraph for cluster with explicit dir created:",l,fh(h))}else if(!Lr.get(l).externalConnections&&t.children(l)&&t.children(l).length>0){le.warn("Cluster without external connections, without a parent and with children",l,e);let h=t.graph().rankdir==="TB"?"LR":"TB";(o=(s=Lr.get(l))==null?void 0:s.clusterData)!=null&&o.dir&&(h=Lr.get(l).clusterData.dir,le.warn("Fixing dir",Lr.get(l).clusterData.dir,h));const d=new ms({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b$(l,t,d,l);const f=t.node(l)||{};t.setNode(l,{...f,clusterNode:!0,id:l,clusterData:Lr.get(l).clusterData,label:Lr.get(l).label,graph:d}),le.debug("Old graph after copy",fh(t))}else le.warn("Cluster ** ",l," **not meeting the criteria !externalConnections:",!Lr.get(l).externalConnections," no parent: ",!t.parent(l)," children ",t.children(l)&&t.children(l).length>0,t.children("D"),e),le.debug(Lr);r=t.nodes(),le.warn("New list of nodes",r);for(const l of r){const u=t.node(l);le.warn(" Now next level",l,u),u!=null&&u.clusterNode&&Ume(u.graph,e+1)}},"extractor"),Yme=x((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=Yme(t,i);r=[...r,...a]}),r},"sorter"),glt=x(t=>Yme(t,t.children()),"sortNodesByHierarchy"),Xme=x((t,e,r)=>{let n=t.parent(e);for(;n&&n!==r;){const i=Lr.get(n);if(i&&!i.externalConnections)return!0;n=t.parent(n)}return!1},"isNodeInExtractableCluster"),mlt=x((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||F0(i,r))continue;const a=zb(i,t,e);if(a&&!Xme(t,a,e))return a}return null},"findSafeAnchorNode");class ylt{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return IQ(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&IQ(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,vlt)),n=n._prev;return"["+e.join(", ")+"]"}}function IQ(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function vlt(t,e){if(t!=="_next"&&t!=="_prev")return e}var blt=Ym(1);function xlt(t,e){if(t.nodeCount()<=1)return[];var r=wlt(t,e||blt),n=Tlt(r.graph,r.buckets,r.zeroIdx);return Ax(Xi(n,function(i){return t.outEdges(i.v,i.w)}))}function Tlt(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)CI(t,e,r,s);for(;s=i.dequeue();)CI(t,e,r,s);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(s=e[o].dequeue(),s){n=n.concat(CI(t,e,r,s,!0));break}}}return n}function CI(t,e,r,n,i){var a=i?[]:void 0;return ft(t.inEdges(n.v),function(s){var o=t.edge(s),l=t.node(s.v);i&&a.push({v:s.v,w:s.w}),l.out-=o,x$(e,r,l)}),ft(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,x$(e,r,u)}),t.removeNode(n.v),a}function wlt(t,e){var r=new ms,n=0,i=0;ft(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),ft(t.edges(),function(o){var l=r.edge(o.v,o.w)||0,u=e(o),h=l+u;r.setEdge(o.v,o.w,h),i=Math.max(i,r.node(o.v).out+=u),n=Math.max(n,r.node(o.w).in+=u)});var a=Fb(i+n+3).map(function(){return new ylt}),s=n+1;return ft(r.nodes(),function(o){x$(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function x$(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function Clt(t){var e=t.graph().acyclicer==="greedy"?xlt(t,r(t)):klt(t);ft(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,gG("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function klt(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,ft(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return ft(t.nodes(),i),e}function Slt(t){ft(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function _x(t,e,r,n){var i;do i=gG(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function Elt(t){var e=new ms().setGraph(t.graph());return ft(t.nodes(),function(r){e.setNode(r,t.node(r))}),ft(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function jme(t){var e=new ms({multigraph:t.isMultigraph()}).setGraph(t.graph());return ft(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),ft(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function NQ(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,u=o):(i<0&&(s=-s),l=s,u=s*a/i),{x:r+l,y:n+u}}function ZR(t){var e=Xi(Fb(Kme(t)+1),function(){return[]});return ft(t.nodes(),function(r){var n=t.node(r),i=n.rank;Di(i)||(e[i][n.order]=r)}),e}function Alt(t){var e=KC(Xi(t.nodes(),function(r){return t.node(r).rank}));ft(t.nodes(),function(r){var n=t.node(r);Vme(n,"rank")&&(n.rank-=e)})}function _lt(t){var e=KC(Xi(t.nodes(),function(a){return t.node(a).rank})),r=[];ft(t.nodes(),function(a){var s=t.node(a).rank-e;r[s]||(r[s]=[]),r[s].push(a)});var n=0,i=t.graph().nodeRankFactor;ft(r,function(a,s){Di(a)&&s%i!==0?--n:n&&ft(a,function(o){t.node(o).rank+=n})})}function DQ(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),_x(t,"border",i,e)}function Kme(t){return B0(Xi(t.nodes(),function(e){var r=t.node(e).rank;if(!Di(r))return r}))}function Rlt(t,e){var r={lhs:[],rhs:[]};return ft(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function Llt(t,e){return e()}function Mlt(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&ft(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;as.lim&&(o=s,l=!0);var u=eh(e.edges(),function(h){return l===PQ(t,t.node(h.v),o)&&l!==PQ(t,t.node(h.w),o)});return pG(u,function(h){return ZC(e,h)})}function aye(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),vG(t),yG(t,e),Ult(t,e)}function Ult(t,e){var r=dG(t.nodes(),function(i){return!e.node(i).parent}),n=Hlt(t,r);n=n.slice(1),ft(n,function(i){var a=t.node(i).parent,s=e.edge(i,a),o=!1;s||(s=e.edge(a,i),o=!0),e.node(i).rank=e.node(a).rank+(o?s.minlen:-s.minlen)})}function Ylt(t,e,r){return t.hasEdge(e,r)}function PQ(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function Xlt(t){switch(t.graph().ranker){case"network-simplex":BQ(t);break;case"tight-tree":Klt(t);break;case"longest-path":jlt(t);break;default:BQ(t)}}var jlt=mG;function Klt(t){mG(t),Qme(t)}function BQ(t){fg(t)}function Zlt(t){var e=_x(t,"root",{},"_root"),r=Qlt(t),n=B0(dh(r))-1,i=2*n+1;t.graph().nestingRoot=e,ft(t.edges(),function(s){t.edge(s).minlen*=i});var a=Jlt(t)+1;ft(t.children(),function(s){sye(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function sye(t,e,r,n,i,a,s){var o=t.children(s);if(!o.length){s!==e&&t.setEdge(e,s,{weight:0,minlen:r});return}var l=DQ(t,"_bt"),u=DQ(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,ft(o,function(d){sye(t,e,r,n,i,a,d);var f=t.node(d),p=f.borderTop?f.borderTop:d,g=f.borderBottom?f.borderBottom:d,m=f.borderTop?n:2*n,y=p!==g?1:i-a[s]+1;t.setEdge(l,p,{weight:m,minlen:y,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:y,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}function Qlt(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&ft(a,function(s){r(s,i+1)}),e[n]=i}return ft(t.children(),function(n){r(n,1)}),e}function Jlt(t){return lS(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function ect(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,ft(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function tct(t,e,r){var n={},i;ft(r,function(a){for(var s=t.parent(a),o,l;s;){if(o=t.parent(s),o?(l=n[o],n[o]=s):(l=i,i=s),l&&l!==s){e.setEdge(l,s);return}s=o}})}function rct(t,e,r){var n=nct(t),i=new ms({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return ft(t.nodes(),function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,o||n),ft(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=Di(h)?0:h.weight;i.setEdge(u,a,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i}function nct(t){for(var e;t.hasNode(e=gG("_root")););return e}function ict(t,e){for(var r=0,n=1;n0;)h%2&&(d+=o[h+1]),h=h-1>>1,o[h]+=u.weight;l+=u.weight*d})),l}function sct(t){var e={},r=eh(t.nodes(),function(o){return!t.children(o).length}),n=B0(Xi(r,function(o){return t.node(o).rank})),i=Xi(Fb(n+1),function(){return[]});function a(o){if(!Vme(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),ft(t.successors(o),a)}}var s=cS(r,function(o){return t.node(o).rank});return ft(s,a),i}function oct(t,e){return Xi(e,function(r){var n=t.inEdges(r);if(n.length){var i=lS(n,function(a,s){var o=t.edge(s),l=t.node(s.v);return{sum:a.sum+o.weight*l.order,weight:a.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function lct(t,e){var r={};ft(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};Di(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),ft(e.edges(),function(i){var a=r[i.v],s=r[i.w];!Di(a)&&!Di(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=eh(r,function(i){return!i.indegree});return cct(n)}function cct(t){var e=[];function r(a){return function(s){s.merged||(Di(s.barycenter)||Di(a.barycenter)||s.barycenter>=a.barycenter)&&uct(a,s)}}function n(a){return function(s){s.in.push(a),--s.indegree===0&&t.push(s)}}for(;t.length;){var i=t.pop();e.push(i),ft(i.in.reverse(),r(i)),ft(i.out,n(i))}return Xi(eh(e,function(a){return!a.merged}),function(a){return JA(a,["vs","i","barycenter","weight"])})}function uct(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function hct(t,e){var r=Rlt(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=cS(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(dct(!!e)),l=FQ(a,i,l),ft(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=FQ(a,i,l)});var u={vs:Ax(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function FQ(t,e,r){for(var n;e.length&&(n=QA(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function dct(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function oye(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=eh(i,function(g){return g!==s&&g!==o}));var u=oct(t,i);ft(u,function(g){if(t.children(g.v).length){var m=oye(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&pct(g,m)}});var h=lct(u,r);fct(h,l);var d=hct(h,n);if(s&&(d.vs=Ax([s,d.vs,o]),t.predecessors(s).length)){var f=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function fct(t,e){ft(t,function(r){r.vs=Ax(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function pct(t,e){Di(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function gct(t){var e=Kme(t),r=zQ(t,Fb(1,e+1),"inEdges"),n=zQ(t,Fb(e-1,-1,-1),"outEdges"),i=sct(t);VQ(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){mct(o%2?r:n,o%4>=2),i=ZR(t);var u=ict(t,i);us||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function bct(t){var e={},r=0;function n(i){var a=r;ft(t.children(i),n),e[i]={low:a,lim:r++}}return ft(t.children(),n),e}function xct(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=QA(a);return ft(a,function(h,d){var f=wct(t,h),p=f?t.node(f).order:l;(f||h===u)&&(ft(a.slice(o,d+1),function(g){ft(t.predecessors(g),function(m){var y=t.node(m),v=y.order;(vu)&&lye(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return ft(s,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(s,u,d,o,l),u=d,o=l)}n(s,u,s.length,l,a.length)}),s}return lS(e,i),r}function wct(t,e){if(t.node(e).dummy)return dG(t.predecessors(e),function(r){return t.node(r).dummy})}function lye(t,e,r){if(e>r){var n=e;e=r,r=n}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=t[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Cct(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function kct(t,e,r,n){var i={},a={},s={};return ft(e,function(o){ft(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),ft(e,function(o){var l=-1;ft(o,function(u){var h=n(u);if(h.length){h=cS(h,function(m){return s[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];a[u]===u&&l{var n=r(" buildLayoutGraph",()=>qct(t));r(" runLayout",()=>Oct(n,r)),r(" updateInputGraph",()=>$ct(t,n))})}function Oct(t,e){e(" makeSpaceForEdgeLabels",()=>Uct(t)),e(" removeSelfEdges",()=>tut(t)),e(" acyclic",()=>Clt(t)),e(" nestingGraph.run",()=>Zlt(t)),e(" rank",()=>Xlt(jme(t))),e(" injectEdgeLabelProxies",()=>Yct(t)),e(" removeEmptyRanks",()=>_lt(t)),e(" nestingGraph.cleanup",()=>ect(t)),e(" normalizeRanks",()=>Alt(t)),e(" assignRankMinMax",()=>Xct(t)),e(" removeEdgeLabelProxies",()=>jct(t)),e(" normalize.run",()=>$lt(t)),e(" parentDummyChains",()=>yct(t)),e(" addBorderSegments",()=>Mlt(t)),e(" order",()=>gct(t)),e(" insertSelfEdges",()=>rut(t)),e(" adjustCoordinateSystem",()=>Ilt(t)),e(" position",()=>Nct(t)),e(" positionSelfEdges",()=>nut(t)),e(" removeBorderNodes",()=>eut(t)),e(" normalize.undo",()=>Blt(t)),e(" fixupEdgeLabelCoords",()=>Qct(t)),e(" undoCoordinateSystem",()=>Nlt(t)),e(" translateGraph",()=>Kct(t)),e(" assignNodeIntersects",()=>Zct(t)),e(" reversePoints",()=>Jct(t)),e(" acyclic.undo",()=>Slt(t))}function $ct(t,e){ft(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),ft(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var Pct=["nodesep","edgesep","ranksep","marginx","marginy"],Bct={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Fct=["acyclicer","ranker","rankdir","align"],zct=["width","height"],Vct={width:0,height:0},Gct=["minlen","weight","width","height","labeloffset"],Wct={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Hct=["labelpos"];function qct(t){var e=new ms({multigraph:!0,compound:!0}),r=AI(t.graph());return e.setGraph(v$({},Bct,EI(r,Pct),JA(r,Fct))),ft(t.nodes(),function(n){var i=AI(t.node(n));e.setNode(n,kot(EI(i,zct),Vct)),e.setParent(n,t.parent(n))}),ft(t.edges(),function(n){var i=AI(t.edge(n));e.setEdge(n,v$({},Wct,EI(i,Gct),JA(i,Hct)))}),e}function Uct(t){var e=t.graph();e.ranksep/=2,ft(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function Yct(t){ft(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};_x(t,"edge-proxy",a,"_ep")}})}function Xct(t){var e=0;ft(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=B0(e,n.maxRank))}),t.graph().maxRank=e}function jct(t){ft(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function Kct(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,o=a.marginy||0;function l(u){var h=u.x,d=u.y,f=u.width,p=u.height;e=Math.min(e,h-f/2),r=Math.max(r,h+f/2),n=Math.min(n,d-p/2),i=Math.max(i,d+p/2)}ft(t.nodes(),function(u){l(t.node(u))}),ft(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,ft(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),ft(t.edges(),function(u){var h=t.edge(u);ft(h.points,function(d){d.x-=e,d.y-=n}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=e),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=n)}),a.width=r-e+s,a.height=i-n+o}function Zct(t){ft(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=n),r.points.unshift(NQ(n,a)),r.points.push(NQ(i,s))})}function Qct(t){ft(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Jct(t){ft(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function eut(t){ft(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(QA(r.borderLeft)),s=t.node(QA(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),ft(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function tut(t){ft(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function rut(t){var e=ZR(t);ft(e,function(r){var n=0;ft(r,function(i,a){var s=t.node(i);s.order=a+n,ft(s.selfEdges,function(o){_x(t,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:a+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function nut(t){ft(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function EI(t,e){return KR(JA(t,e),Number)}function AI(t){var e={};return ft(t,function(r,n){e[n.toLowerCase()]=r}),e}var GQ=x((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),WQ=x((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),iut=x(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),aut=x((t,e,r,n,i)=>{const a=[],s=new Set;if(r.forEach(({start:h,end:d})=>{h!==n&&s.add(h),d!==n&&s.add(d)}),s.forEach(h=>{const d=t.node(h);typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)}),a.length===0&&r.forEach(({edge:h})=>{(h.points??[]).forEach(d=>{typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)})}),a.length===0)return WQ(i);const o=a.reduce((h,d)=>({x:h.x+d.x/a.length,y:h.y+d.y/a.length}),{x:0,y:0}),l=o.x-e.x,u=o.y-e.y;return Math.abs(l)>Math.abs(u)?l>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":WQ(i)},"getSelfLoopSide"),sut=x((t,e="top",r=0,n=0)=>{const i=t.x,a=t.y-r,s=t.width/2,o=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),u=GQ(Math.max(n,t.width*.35),36,l),h=GQ(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const d=a+o;return[{x:i-u/2,y:d},{x:i-u/2,y:d+h},{x:i+u/2,y:d+h},{x:i+u/2,y:d}]}case"right":{const d=i+s;return[{x:d,y:a-u/2},{x:d+h,y:a-u/2},{x:d+h,y:a+u/2},{x:d,y:a+u/2}]}case"left":{const d=i-s;return[{x:d,y:a-u/2},{x:d-h,y:a-u/2},{x:d-h,y:a+u/2},{x:d,y:a+u/2}]}case"top":default:{const d=a-o;return[{x:i-u/2,y:d},{x:i-u/2,y:d-h},{x:i+u/2,y:d-h},{x:i+u/2,y:d}]}}},"getSelfLoopPoints"),out=x((t,e,r="top",n=0,i={})=>{const s=t.x,o=t.y-n,l=i.width??0,u=i.height??0;switch(r){case"bottom":return{x:s,y:Math.max(...e.map(h=>h.y))+u/2+4};case"right":return{x:Math.max(...e.map(h=>h.x))+l/2+4,y:o};case"left":return{x:Math.min(...e.map(h=>h.x))-l/2-4,y:o};case"top":default:return{x:s,y:Math.min(...e.map(h=>h.y))-u/2-4}}},"getSelfLoopLabelPosition"),uye=x((t,e=0,{mergeSelfLoops:r=!0}={})=>{var s;const n=new Map,i=[],a=(s=t.graph())==null?void 0:s.rankdir;return t.edges().forEach(o=>{const l=t.edge(o);if(r&&l.selfLoop){const u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:o.v,end:o.w})}else i.push({edge:l,start:o.v,end:o.w})}),n.forEach(o=>{if(o.length!==3){o.forEach(T=>i.push(T));return}o.sort((T,b)=>T.edge.selfLoop.order-b.edge.selfLoop.order);const[l,u,h]=o,d=l.edge.originalEdge??u.edge.originalEdge??h.edge.originalEdge??u.edge,f=t.node(d.start);if(!f){o.forEach(T=>i.push(T));return}const p={width:u.edge.width,height:u.edge.height},g=aut(t,f,o,d.start,a),m=sut(f,g,e,p.width??0),y=out(f,m,g,e,p),v={...u.edge,...d,id:d.id,points:m,start:d.start,end:d.end,x:y.x,y:y.y,width:p.width,height:p.height,labelStyle:u.edge.labelStyle,fromCluster:l.edge.fromCluster??u.edge.fromCluster??h.edge.fromCluster,toCluster:l.edge.toCluster??u.edge.toCluster??h.edge.toCluster};delete v.selfLoop,delete v.originalEdge,i.push({edge:v,start:v.start,end:v.end})}),i},"getEdgesToRender"),hye=x(async(t,e,r,n,i,a)=>{le.warn("Graph in recursive render:XAX",fh(e),i);const s=e.graph().rankdir;le.trace("Dir in recursive render - dir:",s);const o=t.insert("g").attr("class","root");e.nodes()?le.info("Recursive render XXX",e.nodes()):le.info("No nodes found for",e),e.edges().length>0&&le.info("Recursive edges",e.edge(e.edges()[0]));const l=o.insert("g").attr("class","clusters"),u=o.insert("g").attr("class","edgePaths"),h=o.insert("g").attr("class","edgeLabels"),d=o.insert("g").attr("class","nodes"),f=iut(r);await Promise.all(e.nodes().map(async function(T){const b=e.node(T);if(i!==void 0){const w=JSON.parse(JSON.stringify(i.clusterData));le.trace(`Setting data for parent cluster XXX Node.id = `,T,` data=`,w.height,` -Parent cluster`,i.height),e.setNode(i.id,w),e.parent(T)||(le.trace("Setting parent",T,i.id),e.setParent(T,i.id,w))}if(le.info("(Insert) Node XXX"+T+": "+JSON.stringify(e.node(T))),b!=null&&b.clusterNode){le.info("Cluster identified XBX",T,b.width,e.node(T));const{ranksep:w,nodesep:C}=e.graph();b.graph.setGraph({...b.graph.graph(),ranksep:w+25,nodesep:C});const S=await uye(d,b.graph,r,n,e.node(T),a),k=S.elem;Kt(b,k),b.diff=S.diff||0,le.info("New compound node after recursive render XAX",T,"width",b.width,"height",b.height),eKe(k,b)}else e.children(T).length>0?(le.trace("Cluster - the non recursive path XBX",T,b.id,b,b.width,"Graph:",e),le.trace(zb(b.id,e)),Lr.set(b.id,{id:zb(b.id,e),node:b})):(le.trace("Node - the non recursive path XAX",T,d,e.node(T),s),await rS(d,e.node(T),{config:a,dir:s}))})),await x(async()=>{const T=e.edges().map(async function(b){const w=e.edge(b.v,b.w,b.name);if(le.info("Edge "+b.v+" -> "+b.w+": "+JSON.stringify(b)),le.info("Edge "+b.v+" -> "+b.w+": ",b," ",JSON.stringify(e.edge(b))),le.info("Fix",Lr,"ids:",b.v,b.w,"Translating: ",Lr.get(b.v),Lr.get(b.w)),f&&w.selfLoop){if(w.selfLoop.order!==1)return;const C=w.id;w.id=w.selfLoop.id,await zA(h,w),w.id=C;return}await zA(h,w)});await Promise.all(T)},"processEdges")(),le.info("Graph before layout:",JSON.stringify(fh(e))),le.info("############################################# XXX"),le.info("### Layout ### XXX"),le.info("############################################# XXX"),lye(e),le.info("Graph after layout:",JSON.stringify(fh(e)));let g=0,{subGraphTitleTotalMargin:m}=vx(a);await Promise.all(dlt(e).map(async function(T){var w;const b=e.node(T);if(le.info("Position XBX => "+T+": ("+b.x,","+b.y,") width: ",b.width," height: ",b.height),b!=null&&b.clusterNode)b.y+=m,le.info("A tainted cluster node XBX1",T,b.id,b.width,b.height,b.x,b.y,e.parent(T)),Lr.get(b.id).node=b,FA(b);else if(e.children(T).length>0){le.info("A pure cluster node XBX1",T,b.id,b.x,b.y,b.width,b.height,e.parent(T)),b.height+=m,e.node(b.parentId);const C=(b==null?void 0:b.padding)/2||0,S=((w=b==null?void 0:b.labelBBox)==null?void 0:w.height)||0,k=S-C||0;le.debug("OffsetY",k,"labelHeight",S,"halfPadding",C),await xR(l,b),Lr.get(b.id).node=b}else{const C=e.node(b.parentId);b.y+=m/2,le.info("A regular node XBX1 - using the padding",b.id,"parent",b.parentId,b.width,b.height,b.x,b.y,"offsetY",b.offsetY,"parent",C,C==null?void 0:C.offsetY,b),FA(b)}}));const y=m/2;return cye(e,y,{mergeSelfLoops:f}).forEach(function({edge:T,start:b,end:w}){le.info("Edge "+b+" -> "+w+": "+JSON.stringify(T),T),T.points.forEach(E=>E.y+=y);const C=e.node(b),S=e.node(w),k=RV(u,T,Lr,r,C,S,n);Vpe(T,k)}),e.nodes().forEach(function(T){const b=e.node(T);le.info(T,b.type,b.diff),b.isGroup&&(g=b.diff)}),le.warn("Returning from recursive render XAX",o,g),{elem:o,diff:g}},"recursiveRender"),aut=x(async(t,e)=>{var a,s,o,l,u,h;const r=new ms({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((a=t.config)==null?void 0:a.nodeSpacing)||((o=(s=t.config)==null?void 0:s.flowchart)==null?void 0:o.nodeSpacing)||t.nodeSpacing,ranksep:((l=t.config)==null?void 0:l.rankSpacing)||((h=(u=t.config)==null?void 0:u.flowchart)==null?void 0:h.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");LV(n,t.markers,t.type,t.diagramId),Bpe(),zpe(),yfe(),Wme(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),le.debug("Edges:",t.edges),t.edges.forEach(d=>{if(d.start===d.end){const f=d.start,p=f+"---"+f+"---1",g=f+"---"+f+"---2",m=r.node(f);r.setNode(p,{domId:p,id:p,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(p,m.parentId),r.setNode(g,{domId:g,id:g,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,m.parentId);const y=structuredClone(d),v=structuredClone(d),T=structuredClone(d),b=structuredClone(d);v.originalEdge=y,v.selfLoop={id:y.id,order:0},T.originalEdge=y,T.selfLoop={id:y.id,order:1},b.originalEdge=y,b.selfLoop={id:y.id,order:2},v.label="",v.arrowTypeEnd="none",v.endLabelLeft="",v.endLabelRight="",v.startLabelLeft="",v.id=f+"-cyclic-special-1",T.startLabelRight="",T.startLabelLeft="",T.endLabelLeft="",T.endLabelRight="",T.arrowTypeStart="none",T.arrowTypeEnd="none",T.id=f+"-cyclic-special-mid",b.label="",b.startLabelRight="",b.startLabelLeft="",b.arrowTypeStart="none",m.isGroup&&(v.fromCluster=f,b.toCluster=f),b.id=f+"-cyclic-special-2",b.arrowTypeStart="none",r.setEdge(f,p,v,f+"-cyclic-special-0"),r.setEdge(p,g,T,f+"-cyclic-special-1"),r.setEdge(g,f,b,f+"-cyclic-special-2")}else r.setEdge(d.start,d.end,{...d},d.id)}),le.warn("Graph at first:",JSON.stringify(fh(r))),hlt(r),le.warn("Graph after XAX:",JSON.stringify(fh(r)));const i=Fe();await uye(n,r,t.type,t.diagramId,void 0,i)},"render");const sut=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:cye,render:aut},Symbol.toStringTag,{value:"Module"}));async function hye(t,e){const r=new ms({multigraph:!0,compound:!0}),n=[...e.edges],i=Fe(),a=t.insert("g").attr("class","root"),s=a.insert("g").attr("class","clusters"),o=a.insert("g").attr("class","edges edgePath"),l=a.insert("g").attr("class","edgeLabels"),u=a.insert("g").attr("class","nodes"),h=new Map,d=t.node()!=null;await Promise.all(e.nodes.map(async f=>{var p;if(f.isGroup)r.setNode(f.id,{...f});else{if(d){const g=await rS(u,f,{config:i,dir:f.dir}),m=((p=g.node())==null?void 0:p.getBBox())??{width:0,height:0};h.set(f.id,g),f.width=m.width,f.height=m.height}r.setNode(f.id,{...f})}}));for(const f of n)r.setEdge(f.start,f.end,{...f},f.id),e.edges.some(g=>g.id===f.id)||e.edges.push(f);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:f}=await tr(async()=>{const{captureNodeSizes:p}=await Promise.resolve().then(()=>sPt);return{captureNodeSizes:p}},void 0,import.meta.url);f(t,e)}return{graph:r,groups:{clusters:s,edgePaths:o,edgeLabels:l,nodes:u,rootGroups:a},nodeElements:h}}x(hye,"createGraphWithElements");var WQ=5,VE=1e-5,GE=1e-6;function e_(t){const e=[];for(let r=0;r=1-GE||f<=GE||f>=1-GE?null:{point:{x:t.x+d*i,y:t.y+d*a},tA:d,tB:f}}x(dye,"segmentIntersection");function T$(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}x(T$,"isHorizontalSeg");function fye(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}x(pye,"getArcSweepFlag");var out=.001;function gye(t,e){if(t.length<2)return t.map(a=>({...a}));const r=t.map(a=>({...a})),n=e.arrowTypeStart&&ma[e.arrowTypeStart];if(n){const a=t[0],s=t[1],o=Math.atan2(s.y-a.y,s.x-a.x);r[0].x=a.x+n*Math.cos(o),r[0].y=a.y+n*Math.sin(o)}const i=e.arrowTypeEnd&&ma[e.arrowTypeEnd];if(i){const a=t.length,s=t[a-2],o=t[a-1],l=Math.atan2(o.y-s.y,o.x-s.x);r[a-1].x=o.x-i*Math.cos(l),r[a-1].y=o.y-i*Math.sin(l)}return r}x(gye,"applyMarkerOffsets");function mye(t,e,r,n,i){const a=t.point.x,s=t.point.y,o={x:a-e*t.r,y:s-r*t.r},l={x:a+e*t.r,y:s+r*t.r},u=[`L${yy(o)}`];return i==="arc"?u.push(`A${Vl(t.r)},${Vl(t.r)} 0 0 ${n} ${yy(l)}`):u.push(`M${yy(l)}`),u}x(mye,"emitJump");function w$(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=r.x-e.x,o=r.y-e.y,l=Math.hypot(i,a),u=Math.hypot(s,o);if(l0){const b=w$(i[u-1],i[u],i[u+1]??i[u],WQ);b&&(m=b.cutLen)}let y=d,v=null;a&&ub.t-w.t);for(const b of T)b.r=Math.min(b.r,b.d-m,y-b.d);for(let b=0;bw){const C=w/2;T[b].r=Math.min(T[b].r,C),T[b+1].r=Math.min(T[b+1].r,C)}}for(const b of T)b.r=2?n:null}catch{return null}}x(xye,"decodeDataPoints");function Tye(t,e,r){if(!r.enabled)return;const n=t.node();if(!n)return;const i=new Map;for(const u of e)i.set(u.id,u);const a=[],s=new Map;for(const u of e){const h=typeof CSS<"u"&&CSS.escape?CSS.escape(u.id):u.id,d=n.querySelector(`path[data-id="${h}"]`);if(!d)continue;s.set(u.id,d);const p=xye(d.getAttribute("data-points"))??u.points;a.push({...u,points:p})}const o=fye(a);if(o.length===0)return;const l=new Map;for(const u of o){const h=l.get(u.jumpEdgeId)??[];h.push(u),l.set(u.jumpEdgeId,h)}for(const u of a){const h=l.get(u.id);if(!h||h.length===0)continue;const d=i.get(u.id),f=d==null?void 0:d.curve;if(f!==void 0&&!bye(f))continue;const p=s.get(u.id);if(!p)continue;if(f===void 0){const b=p.getAttribute("d")??"";if(!vye(b))continue}const g=p.getAttribute("style")??"",m=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(g),y=m?Number.parseFloat(m[1]):null,v=m?Number.parseFloat(m[2]):null,T=yye(u,h,r);if(p.setAttribute("d",T),y!==null&&v!==null&&typeof p.getTotalLength=="function"){const b=p.getTotalLength(),w=Math.max(0,b-y-v),C=`0 ${y} ${w} ${v}`,S=g.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${C};`).replace(/;\s*;+/g,";");p.setAttribute("style",S)}}}x(Tye,"applyLineJumpsToSvg");async function wye(t,e){var i,a;for(const s of t.nodes)s.isGroup?await xR(e.clusters,s):FA(s);const r=new Map;for(const s of t.nodes)s!=null&&s.id&&r.set(s.id,s);for(const s of t.edges){const o=s.start?r.get(s.start)??{}:{},l=s.end?r.get(s.end)??{}:{},u=RV(e.edgePaths,{...s},{},t.type,o,l,t.diagramId);s.label&&await zA(e.rootGroups,s),s.label&&Cye(s,u)}const n=(a=(i=t.config)==null?void 0:i.swimlane)==null?void 0:a.lineHops;if(n!==!1){const s=n==="gap"?"gap":"arc",o=t.edges.filter(l=>Array.isArray(l.points)&&l.points.length>=2).map(l=>({id:l.id,points:l.points,curve:l.curve,arrowTypeStart:l.arrowTypeStart,arrowTypeEnd:l.arrowTypeEnd}));Tye(e.edgePaths,o,{enabled:!0,jumpRadius:6,jumpStyle:s})}}x(wye,"adjustLayout");function Cye(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=Xt(),{subGraphTitleTotalMargin:i}=vx({flowchart:n.flowchart??{}});if(t.label){const a=zC.get(t.id);let s=t.x,o=t.y;if(r){const l=yr.calcLabelPosition(r);le.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t!=null&&t.startLabelLeft){const a=Li.get(t.id).startLeft;let s=t==null?void 0:t.x,o=t==null?void 0:t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=Li.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=Li.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=Li.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}}x(Cye,"positionEdgeLabel");var _I="__swimlane_default__",lut=21,HQ=20;function C$(t){return Math.max(t.padding??HQ,HQ)}x(C$,"topLaneHorizontalPadding");function kye(t){const{x:e,y:r,width:n,height:i}=t,a=t.swimlaneContentTop;if(typeof e!="number"||typeof r!="number"||typeof n!="number"||typeof i!="number"||typeof a!="number"||!Number.isFinite(e)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(a)||n<=0||i<=0){delete t.groupTitleRect;return}const s=r-i/2,o=Math.min(a,r+i/2),l=Math.min(lut,Math.max(0,o-s)),u=s+l;if(u<=s){delete t.groupTitleRect;return}t.groupTitleRect={left:e-n/2,right:e+n/2,top:s,bottom:u}}x(kye,"assignTopLaneTitleRect");function Sye(t){const e=t.direction,r=t.nodes??(t.nodes=[]);for(const a of t.nodes??[])a.isGroup&&!a.parentId&&(a.shape="swimlane",e&&(a.direction=e));const n=r.filter(a=>!a.isGroup&&!a.parentId);if(n.length===0)return;let i=r.find(a=>a.id===_I);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:_I,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const a of n)a.parentId=_I}x(Sye,"prepareLayoutForSwimlanes");function Eye(t){const e=new Map;for(const l of t.nodes??[])e.set(l.id,l);const r=[];for(const l of t.edges??[]){const u=typeof l.start=="string"?l.start:void 0,h=typeof l.end=="string"?l.end:void 0;!u||!h||l.labelNodeId||r.push({id:l.id,src:u,dst:h,ref:l})}const n=t.nodes??[],i=n.filter(l=>l.isGroup),a=n.filter(l=>!l.isGroup);return{nodes:[...[...i].reverse(),...a].map(l=>l.id),edges:r,layout:t,nodeById:e}}x(Eye,"toGraphView");function Aye(t,e,r,n){const{layout:i}=t,a=t.nodeById,s=(n==null?void 0:n.layerGap)??100,o=(n==null?void 0:n.nodeGap)??40;let l=0;for(const f of e.layers){let p=0;for(const g of f){const m=a.get(g);if(!m){p++;continue}m.layer=l,m.order=p;const y=r.x[g]??p*o,v=r.y[g]??l*s;m.x=y,m.y=v,p++}l++}const u=i.nodes??[],h=new Map,d=[];for(const f of u){if(!(f!=null&&f.isGroup))continue;f.parentId||d.push(f);const p=u.filter(T=>T.parentId===f.id);let g=1/0,m=-1/0,y=1/0,v=-1/0;for(const T of p){const b=T.x??r.x[T.id],w=T.y??r.y[T.id],C=T.width??0,S=T.height??0;b!=null&&w!=null&&(g=Math.min(g,b-C/2),m=Math.max(m,b+C/2),y=Math.min(y,w-S/2),v=Math.max(v,w+S/2))}if(g===1/0||y===1/0)f.x=f.x??0,f.y=f.y??0,f.width=f.width??0,f.height=f.height??0;else{const T=f.padding??20,b=f.parentId?T:2*C$(f),w=T,C=Math.max(0,m-g)+b,S=Math.max(0,v-y)+w,k=(g+m)/2,E=(y+v)/2;f.x=k,f.y=E,f.width=C,f.height=S,h.set(f.id,{minX:g,maxX:m,minY:y,maxY:v})}}if(d.length>0&&h.size>0){let f=1/0,p=-1/0,g=0;for(const m of d){const y=m.padding??20;y>g&&(g=y);const v=h.get(m.id);v&&(f=Math.min(f,v.minY),p=Math.max(p,v.maxY))}if(f!==1/0&&p!==-1/0){const m=Math.max(0,p-f),v=Math.max(g,36),T=m+2*v,b=(f+p)/2;for(const _ of d)_.y=b,_.height=T,_.swimlaneContentTop=f;const w=[...d].sort((_,M)=>{const L=_.x??0,P=M.x??0;return L-P}),C=[],S=[],k=[];for(const _ of w){const M=h.get(_.id);if(!M)continue;const L=Math.max(0,M.maxX-M.minX)+2*C$(_),P=(M.minX+M.maxX)/2;C.push(_.id),S.push(P),k.push(L)}const E=C.length;if(E>0){const _=new Map;if(E===1)_.set(C[0],k[0]);else{const M=[];for(let I=0;I0&&i>0?{cx:e,cy:r,rect:vy(e,r,n,i)}:void 0}x(bG,"measuredNodeRect");function xG(t){if(t.isGroup)return;const e=bG(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}x(xG,"nodeBoundsInfoFor");function wl(t,e,r=Ea){return Math.abs(t.x-e.x)r}x(xi,"isHorizontalSegment");function Ti(t,e,r=Ea){return qr(t,e,r)&&Math.abs(t.y-e.y)>r}x(Ti,"isVerticalSegment");function qs(t,e,r,n){return Math.max(0,Math.min(Math.max(t,e),Math.max(r,n))-Math.max(Math.min(t,e),Math.min(r,n)))}x(qs,"overlapLength");function Uc(t,e,r=Ea){return t.horizontal&&e.horizontal&&Kr(t.a,e.a,r)?qs(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&qr(t.a,e.a,r)?qs(t.a.y,t.b.y,e.a.y,e.b.y):0}x(Uc,"sameAxisSegmentOverlapLength");function Vb(t,e=Ea){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!wl(i,n,e))&&r.push({x:n.x,y:n.y})}return r}x(on,"dedupeConsecutivePoints");function TG(t,e=Ea){if(!t||t.length!==4)return;const[r,n,i,a]=t;return xi(r,n,e)&&Ti(n,i,e)&&xi(i,a,e)?{kind:"HVH",p0:r,p1:n,p2:i,p3:a}:Ti(r,n,e)&&xi(n,i,e)&&Ti(i,a,e)?{kind:"VHV",p0:r,p1:n,p2:i,p3:a}:void 0}x(TG,"classifyThreeSegmentRoute");function QR(t,e,r,n=0){const i=Math.min(t.x,e.x),a=Math.max(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.y,e.y);return a>r.left-n&&ir.top-n&&se.left+r&&t.xe.top+r&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}x(Rye,"rectContainsRect");function t_(t,e){return t.lefte.left&&t.tope.top}x(t_,"rectsOverlap");function k$(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}x(k$,"inflateRect");function vy(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}x(vy,"rectFromCenterSize");function To(t){var e;return(e=bG(t))==null?void 0:e.rect}x(To,"rectOfNodeBounds");function Qp(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}x(Qp,"portForRectSide");function CG(t,e,r,n,i,a=Ea){const s=e==="left"||e==="right",o=n==="left"||n==="right";if(s&&o){if(e==="right"&&n==="left"&&t.xr.x){if(Kr(t,r,a))return[t,r];const d=(t.x+r.x)/2;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}if(e===n){if(Kr(t,r,a))return;const d=e==="left"?Math.min(t.x,r.x)-i:Math.max(t.x,r.x)+i;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}return}if(!s&&!o){if(e===n){if(qr(t,r,a))return;const f=e==="top"?Math.min(t.y,r.y)-i:Math.max(t.y,r.y)+i;return[t,{x:t.x,y:f},{x:r.x,y:f},r]}if(!(e==="bottom"&&n==="top"&&t.yr.y))return;if(qr(t,r,a))return[t,r];const d=(t.y+r.y)/2;return[t,{x:t.x,y:d},{x:r.x,y:d},r]}if(s&&!o){const h=e==="right"&&r.x>t.x||e==="left"&&r.xr.y;return h&&d?[t,{x:r.x,y:t.y},r]:void 0}const l=e==="bottom"&&r.y>t.y||e==="top"&&r.yr.x;return l&&u?[t,{x:t.x,y:r.y},r]:void 0}x(CG,"buildOrthogonalPortPath");function kG(t,e,r,n){return e==="left"||e==="right"?[t,{x:n,y:t.y},{x:n,y:r.y},r]:[t,{x:t.x,y:n},{x:r.x,y:n},r]}x(kG,"buildSameSideTrackPath");function JR(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=xG(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}x(JR,"collectRealNodeBounds");function Ef(t){const e=[],r=[];for(const n of t){const i=xG(n);if(!i)continue;const a={id:i.id,rect:i.rect};n.isEdgeLabel?r.push(a):e.push(a)}return{realNodeRects:e,labelNodeRects:r}}x(Ef,"collectNodeRectEntries");function Lye(t,{includeEdgeLabels:e=!0}={}){const r=[];for(const n of t){if(n.isGroup||!e&&n.isEdgeLabel)continue;const i=n.x??0,a=n.y??0,s=n.width??0,o=n.height??0;r.push({nodeId:n.id,...vy(i,a,s,o)})}return r}x(Lye,"collectLayoutNodeRects");function SG(t,e,r=Ea){const n=t.start,i=t.end;if(!n||!i)return;const a=e.get(n),s=e.get(i);if(!(!a||!s))return{srcId:n,dstId:i,srcInfo:a,dstInfo:s,collinearX:Math.abs(a.cx-s.cx)g||fv)return!1;const T=Math.abs(m-h.a.x)i:a&&o&&Kr(t,r,i)?qs(t.x,e.x,r.x,n.x)>i:!1}x(Mye,"sameAxisSegmentsOverlap");function r_(t,e,r,n,{epsilon:i=Ea,skipDegenerateOther:a=!1}={}){for(const s of r){if(s===n||s.isLayoutOnly)continue;const o=s.points;if(!(!o||o.length<2))for(let l=0;lf+i&&gm+i&&dn+Ea&&t=2?e[e.length-2]:void 0,l=(s?qr(s,i):!1)?{x:i.x,y:a.y}:{x:a.x,y:i.y};e.push(l)}e.push(a)}const r=[];for(const n of e){const i=r[r.length-1];(!i||!wl(i,n))&&r.push(n)}return r}x(n_,"orthogonalizePolyline");function Qc(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=Nye(e);if(e=n.points,!n.changed)break}return e}x(Qc,"simplifyPolyline");var br=.001,uut=.5,qQ=4;function AG(t,e,r){const n=t;if(n.isLayoutOnly||!n.points||n.points.length=0&&i=t.length)return t;const a=i-n;if(a<0||a>=t.length)return t;const s=Dye(t[i],t[a],e);return r?[s,...t.slice(i)]:[...t.slice(0,i+1),s]}x(E$,"clipEndpoint");function Oye(t,e){for(const r of t){const n=AG(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=E$(i,n.srcRect,!0)),n.dstRect&&(i=E$(i,n.dstRect,!1)),i=Qc(n_(i)),i=_G(i,n.srcRect,n.dstRect),n.edge.points=Qc(n_(i))}}x(Oye,"clipEdgeEndpointsToNodeBoundaries");function A$(t,e,r,n=!1){if(Kr(t,e,br)){if(e.yr.bottom+br)return e;if(n){if(t.xr.right+br)return{x:r.right,y:t.y}}return{x:Math.abs(e.x-r.left)<=Math.abs(e.x-r.right)?r.left:r.right,y:t.y}}if(qr(t,e,br)){if(e.xr.right+br)return e;if(n){if(t.yr.bottom+br)return{x:t.x,y:r.bottom}}const i=Math.abs(e.y-r.top)<=Math.abs(e.y-r.bottom);return{x:t.x,y:i?r.top:r.bottom}}return e}x(A$,"snapEndpointToBoundary");function i_(t,e,r){const n=t[e];for(let i=e+r;i>=0&&in.lo)),r=Math.min(...t.map(n=>n.hi));if(!(e>r))return{lo:e,hi:r}}x($ye,"intersectRanges");function R$(t,e){return e==="left"||e==="right"?a_(t.top,t.bottom):a_(t.left,t.right)}x(R$,"clearanceRangeForSide");function s_(t,e,r){const n=t.y>=r.top-br&&t.y<=r.bottom+br,i=t.x>=r.left-br&&t.x<=r.right+br;if(Kr(t,e,br)&&n){if(Math.abs(t.x-r.left)0?$ye(a):void 0}x(Pye,"straightClearanceRange");function L$(t,e,r,n,i){const a=Pye(t,e,r,n,i);if(!a)return;const s=i?t.y:t.x,o=Math.min(a.hi,Math.max(a.lo,s));if(!(Math.abs(o-s)({...o}));for(let o=e;o>=0&&o=r.left-br&&Math.max(t.x,e.x)<=r.right+br,i=Math.min(t.y,e.y)>=r.top-br&&Math.max(t.y,e.y)<=r.bottom+br;if(Math.abs(t.y-r.top)n.bottom+br;case"left":return Kr(e,r,br)&&r.xn.right+br}}x(N$,"leavesOutward");function D$(t,e,r){if(t.length<3)return t;if(r){const a=I$(t[0],t[1],e);return a&&N$(a,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=I$(t[n-1],t[n],e);return i&&N$(i,t[n-1],t[n-2],e)?t.slice(0,n):t}x(D$,"collapseOwnBorderStub");function zye(t,e,r){let n=t;if(e){const a=i_(n,0,1);if(a){const s=A$(a,n[0],e);s!==n[0]&&(n=[s,...n.slice(1)])}n=D$(n,e,!0)}if(r){const a=n.length-1,s=i_(n,a,-1);if(s){const o=A$(s,n[a],r,!0);o!==n[a]&&(n=[...n.slice(0,a),o])}n=D$(n,r,!1)}const i=_G(n,e,r);return i!==n||n.length===2?i:(e&&(n=M$(n,e,!0)),r&&(n=M$(n,r,!1)),n)}x(zye,"snapAndCollapseEndpoints");function O$(t,e){for(const r of t){const n=AG(r,e,2);if(!n)continue;const i=on(n.points,br),a=zye(i,n.srcRect,n.dstRect);if(a.length<3){n.edge.points=a;continue}const s=[a[0],{...a[0]},...a.slice(1,-1),a[a.length-1],{...a[a.length-1]}];n.edge.points=s}}x(O$,"prepareEdgeEndpointsForRenderer");function RG(t){return new Map(t.map(e=>[e.id,e]))}x(RG,"buildNodeMap");function Vye(t,e){let r=t.parentId,n=null;for(;r;){const i=e.get(r);if(!(i!=null&&i.isGroup))break;n=i.id,r=i.parentId}return n}x(Vye,"resolveTopLevelGroupId");function $$(t,e){let r=0,n=t.parentId;for(;n;){const i=e.get(n);if(!(i!=null&&i.isGroup))break;r++,n=i.parentId}return r}x($$,"groupDepth");function LG(t){let e=1/0,r=-1/0,n=1/0,i=-1/0;for(const a of t){const s=a.x,o=a.y;if(typeof s!="number"||typeof o!="number")continue;const l=a.width??0,u=a.height??0;e=Math.min(e,s-l/2),r=Math.max(r,s+l/2),n=Math.min(n,o-u/2),i=Math.max(i,o+u/2)}return e===1/0||n===1/0?null:{minX:e,maxX:r,minY:n,maxY:i}}x(LG,"boundsForChildren");function Gye(t,e){const r=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+r,t.height=Math.max(0,e.maxY-e.minY)+r}x(Gye,"applyGroupBounds");function Wye(t){const e=RG(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>$$(i,e)-$$(n,e));for(const n of r){const i=t.filter(s=>s.parentId===n.id),a=LG(i);a&&Gye(n,a)}}x(Wye,"recomputeNestedGroupBounds");function o_(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(l=>!l.isGroup);let a=1/0,s=-1/0;for(const l of i){const u=l[e];typeof u=="number"&&(a=Math.min(a,u),s=Math.max(s,u))}if(!Number.isFinite(a)||!Number.isFinite(s))return!1;const o=x(l=>a+s-l,"mirror");for(const l of r){const u=l[e];typeof u=="number"&&(l[e]=o(u));const h=l.groupTitleRect;h&&(l.groupTitleRect=e==="x"?{...h,left:o(h.right),right:o(h.left)}:{...h,top:o(h.bottom),bottom:o(h.top)})}for(const l of n)for(const u of l.points??[])u[e]=o(u[e]);return!0}x(o_,"mirrorAxis");function Hye(t){return(t.nodes??[]).some(r=>!r.isGroup)?o_(t,"y"):!0}x(Hye,"applyBtDirectionTransform");function qye(t,e="LR"){const r=t.nodes??[],n=t.edges??[],i=r.filter(D=>!D.isGroup);let a=1/0,s=1/0;for(const D of i){const R=D.x??0,I=D.y??0;R0?Math.max(1,h/d):1;for(const D of i){const R=D.x??0,$=((D.y??0)-s)*f+o,O=R-a;D.x=$,D.y=O}for(const D of n)if(D.points)for(const R of D.points){const I=R.x,O=(R.y-s)*f+o,N=I-a;R.x=O,R.y=N}Wye(r);const p=r.filter(D=>D.isGroup&&!D.parentId);if(p.length===0)return e==="RL"&&o_(t,"x"),!0;const g=RG(r),m=new Map;for(const D of r){if(D.isGroup)continue;const R=Vye(D,g);if(!R)continue;const I=m.get(R)??[];I.push(D),m.set(R,I)}let y=0;for(const D of p){const R=D.padding??0;R>y&&(y=R)}const v=[];let T=1/0,b=-1/0;for(const D of p){const R=m.get(D.id)??[],I=LG(R);I&&(T=Math.min(T,I.minX),b=Math.max(b,I.maxX),v.push({lane:D,contentTop:I.minY,contentBottom:I.maxY,centerY:(I.minY+I.maxY)/2}))}if(T===1/0||b===-1/0)return!0;const w=Math.max(0,b-T),C=Math.max(y,10),S=w+2*C,k=o+S,M=(T+b)/2-S/2-o,L=M+k/2,P=Math.max(y,o);v.sort((D,R)=>D.centerY-R.centerY);for(let D=0;Df.cy?v.bottom:v.top,P=f.cx+T;if(P<=v.left+_l||P>=v.right-_l)continue;b={x:P,y:L},w={x:P,y:o.y},C={x:o.x,y:o.y}}else{const L=p.cx>f.cx?v.right:v.left,P=f.cy+T;if(P<=v.top+_l||P>=v.bottom-_l)continue;b={x:L,y:P},w={x:o.x,y:P},C={x:o.x,y:o.y}}const S=wl(b,w,_l),k=wl(w,C,_l);if(S&&k||!S&&Oi(b,w,n,[h],1)||!k&&Oi(w,C,n,[d],1))continue;const E=!S&&r_(b,w,t,i,{epsilon:_l,skipDegenerateOther:!0}),_=!k&&r_(w,C,t,i,{epsilon:_l,skipDegenerateOther:!0});if(!(E||_)){S?y=[w,C]:k?y=[b,w]:y=[b,w,C];break}}y&&(i.points=y)}}x(Uye,"portSwapToLShape");function Yye(t,e){const{realNodeRects:a,labelNodeRects:s}=Ef(e.values());for(const o of t){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<4)continue;const u=on(l,.001);if(u.length<4)continue;const h=u.length-1,d=u[h],f=u[h-1],p=u[h-2],g=d.x-f.x,m=d.y-f.y,y=Math.hypot(g,m);if(y>=10||y<.001)continue;const v=f.x-p.x,T=f.y-p.y;if(Math.hypot(v,T)<.001)continue;const w=xi(f,d,.001),C=Ti(f,d,.001),S=xi(p,f,.001),k=Ti(p,f,.001);if(!(w&&k||C&&S))continue;const E=o.end,_=o.start,M=E?e.get(E):void 0;if(!M)continue;const L=M.x??0,P=M.y??0,D=To(M);if(!D)continue;let R,I;if(k){const B=T<0;R={x:L,y:p.y},I={x:L,y:B?D.bottom:D.top}}else{const B=v>0;R={x:p.x,y:P},I={x:B?D.right:D.left,y:P}}if(Oi(R,I,a,E?[E]:[],-2)||Oi(R,I,s,[],-2))continue;if(_){const B=e.get(_),G=B?To(B):void 0;if(G&&wG(R,G,2))continue}const $=x((B,G)=>`${B.x.toFixed(3)},${B.y.toFixed(3)}|${G.x.toFixed(3)},${G.y.toFixed(3)}`,"ownSegmentKey"),O=new Set;for(let B=0;B{for(const H of t){if(H===o||H.isLayoutOnly)continue;const q=H.points;if(!(!q||q.length<2))for(let Z=0;Z=0){const B=u[h-3],G=[_,E].filter(H=>!!H);if(Oi(B,R,a,G,-2)||N(B,R))continue}const z=[...u.slice(0,h-2),R,I];o.points=z;const V=o.labelNodeId;if(V){const B=e.get(V);if(B){const G=B.width??0,H=B.height??0;if(G>0&&H>0){let q,Z,Y=-1;for(let ie=0;ie=G+2||ge&&te>=H+2)&&te>Y&&(Y=te,q=(K.x+Q.x)/2,Z=(K.y+Q.y)/2)}q!==void 0&&Z!==void 0&&(B.x=q,B.y=Z)}}}}}x(Yye,"collapseShortTerminalStub");var Yt=.001,ka=8,$r=Vb,RI=x((t,e)=>qr(t,e,Yt)||Kr(t,e,Yt),"orthogonallyAligned");function Xye(t,e){const i=x((p,g)=>{const m=p.x??0,y=p.y??0,v=g.x-m,T=g.y-y;let b=(p.width??0)/2,w=(p.height??0)/2;return Math.abs(T)*b>Math.abs(v)*w?(T<0&&(w=-w),{x:m+(T===0?0:w*v/T),y:y+w}):(v<0&&(b=-b),{x:m+b,y:y+(v===0?0:b*T/v)})},"rectIntersect"),a=x((p,g)=>{const m=on(p.points??[]);if(m.length<2)return;const y=g?p.start:p.end,v=y?e.get(y):void 0,T=v?To(v):void 0;if(!v||!y||!T)return;const b=g?m[0]:m[m.length-1],w=g?m[1]:m[m.length-2],C=i(v,b);let S=b;if(RI(w,C)&&(S=w),qr(C,S,Yt))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"V",coord:C.x,min:Math.min(C.y,S.y),max:Math.max(C.y,S.y),boundary:C,railEnd:S,rect:T};if(Kr(C,S,Yt))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"H",coord:C.y,min:Math.min(C.x,S.x),max:Math.max(C.x,S.x),boundary:C,railEnd:S,rect:T}},"terminalLaneFor"),s=x((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),o=x((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:p.orientation==="H"?(Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1)&&qr(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&Kr(p.boundary,g.boundary,1),"sameTerminalFace"),l=x((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:s(p,g)>=ka&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=x((p,g)=>{if(p.nodeId!==g.nodeId||p.orientation!==g.orientation||p.orientation!=="H"||p.atStart===g.atStart)return!1;const m=s(p,g);if(m2*y?!1:o(p,g)&&Math.abs(p.coord-g.coord)<16},"nearTerminalLaneConflict"),h=x((p,g)=>{const m=on(p.edge.points??[]);if(m.length<2)return;const y=p.orientation==="V"?{x:p.boundary.x+g,y:p.boundary.y}:{x:p.boundary.x,y:p.boundary.y+g},v=p.orientation==="V"?{x:p.railEnd.x+g,y:p.railEnd.y}:{x:p.railEnd.x,y:p.railEnd.y+g};if(!x(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?Kr(y,p.boundary,Yt)&&y.x>=p.rect.left+1&&y.x<=p.rect.right-1:Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1?qr(y,p.boundary,Yt)&&y.y>=p.rect.top+1&&y.y<=p.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(p.atStart){const S=m.length>1&&wl(m[1],p.railEnd,Yt),k=m.slice(S?2:1),E=k[0];return E&&!RI(E,v)?void 0:[y,v,...k]}const b=m.length>1&&wl(m[m.length-2],p.railEnd,Yt),w=m.slice(0,b?-2:-1),C=w[w.length-1];if(!(C&&!RI(C,v)))return[...w,v,y]},"shiftedCandidate"),d=x(p=>{const g=p.edge,m=on(g.points??[]);if(m.length!==2)return!1;const y=g.start,v=g.end,T=y?e.get(y):void 0,b=v?e.get(v):void 0;if(!T||!b)return!1;const w=T.x??0,C=T.y??0,S=b.x??0,k=b.y??0,[E,_]=m;return Kr(E,_,Yt)&&Math.abs(C-k)<1&&Math.abs(w-S)>1||qr(E,_,Yt)&&Math.abs(w-S)<1&&Math.abs(C-k)>1},"laneIsStraightCollinearConnector"),f=[-7,7,-14,14,-21,21];for(let p=0;p<8;p++){const g=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[a(y,!0),a(y,!1)]).filter(y=>!!y);let m=!1;for(let y=0;y{const E=d(S),_=d(k);return E!==_?Number(E)-Number(_):+!k.atStart-+!S.atStart});for(const S of C){for(const k of f){const E=h(S,k);if(!E)continue;const _=a({...S.edge,points:E},S.atStart);if(!(!_||g.some(M=>M.edge!==S.edge&&(l(_,M)||w&&u(_,M))))){S.edge.points=E,m=!0;break}}if(m)break}}if(!m)return}}x(Xye,"separateSharedRenderedTerminalLanes");function jye(t,e){const{realNodeRects:n,labelNodeRects:i}=Ef(e.values()),a=x((o,l)=>{const u=o.start,h=o.end,d=$r(l);if(d.length!==l.length-1)return!1;const f=[u,h].filter(p=>!!p);for(const p of d)if(Oi(p.a,p.b,n,f,-2)||Oi(p.a,p.b,i,[],-2))return!1;for(const p of t){if(p===o||p.isLayoutOnly)continue;const g=p.points;if(!(!g||g.length<2)){for(const m of d)for(const y of $r(on(g)))if(Uc(m,y,.5)>=ka||Gh(m.a,m.b,y.a,y.b,Yt))return!1}}return!0},"candidateIsSafe"),s=x((o,l)=>{if(l+4>=o.length)return;const u=o[l],h=o[l+1],d=o[l+2],f=o[l+3],p=o[l+4],g=xi(u,h)&&Ti(h,d)&&xi(d,f)&&Ti(f,p)&&qr(u,f,Yt)&&qr(u,p,Yt)&&qr(h,d,Yt)&&(h.x-u.x)*(f.x-d.x)<0,m=Ti(u,h)&&xi(h,d)&&Ti(d,f)&&xi(f,p)&&Kr(u,f,Yt)&&Kr(u,p,Yt)&&Kr(h,d,Yt)&&(h.y-u.y)*(f.y-d.y)<0;if(g||m)return on([...o.slice(0,l+1),p,...o.slice(l+5)]);if(l+5>=o.length)return;const y=o[l+5],v=Ti(u,h)&&xi(h,d)&&Ti(d,f)&&xi(f,p)&&Ti(p,y)&&qr(u,p,Yt)&&qr(u,y,Yt)&&qr(d,f,Yt)&&(d.x-h.x)*(p.x-f.x)<0,T=xi(u,h)&&Ti(h,d)&&xi(d,f)&&Ti(f,p)&&xi(p,y)&&Kr(u,p,Yt)&&Kr(u,y,Yt)&&Kr(d,f,Yt)&&(d.y-h.y)*(p.y-f.y)<0;if(!(!v&&!T))return on([...o.slice(0,l+1),y,...o.slice(l+6)])},"withoutDogleg");for(let o=0;o<8;o++){let l=!1;for(const u of t){if(u.isLayoutOnly)continue;const h=on(u.points??[]);for(let d=0;d<=h.length-5;d++){const f=s(h,d);if(!(!f||!a(u,f))){u.points=f,l=!0;break}}if(l)break}if(!l)return}}x(jye,"collapseRedundantRectangularDoglegs");function P$(t,e){const{realNodeRects:a,labelNodeRects:s}=Ef(e.values()),o=t.filter(g=>!g.isLayoutOnly),l=x((g,m,y)=>on(g===m?y??[]:g.points??[]),"pointsFor"),u=x((g,m)=>{let y=0;for(let v=0;v{const m=$r(g);if(m.length!==3)return;const y=m[1];if(!(m[0].horizontal===y.horizontal||m[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),d=x((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);return a.filter(v=>{if(y.includes(v.id))return!1;const T=v.rect;return m.horizontal?qs(m.a.x,m.b.x,T.left,T.right)>=ka&&m.a.y>=T.top-2&&m.a.y<=T.bottom+2:qs(m.a.y,m.b.y,T.top,T.bottom)>=ka&&m.a.x>=T.left-2&&m.a.x<=T.right+2})},"blockingRectsFor"),f=x((g,m,y)=>{const v=g.map(b=>({...b}));if(m.horizontal)v[m.index].y=y,v[m.index+1].y=y;else if(m.vertical)v[m.index].x=y,v[m.index+1].x=y;else return;const T=Qc(on(v));return $r(T).length===T.length-1?T:void 0},"candidateByMovingRail"),p=x((g,m,y)=>{const v=[g.start,g.end].filter(b=>!!b),T=$r(m);if(T.length!==m.length-1)return!1;for(const b of T)if(Oi(b.a,b.b,a,v,-2)||Oi(b.a,b.b,s,[],-2))return!1;for(const b of o)if(b!==g){for(const w of T)for(const C of $r(l(b)))if(Uc(w,C,.5)>=ka)return!1}return u(g,m)<=y},"candidateIsSafe");for(let g=0;g<8;g++){const m=u();let y=!1;for(const v of o){const T=l(v),b=h(T);if(!b)continue;const w=d(v,b.segment);if(w.length===0)continue;const C=b.horizontal?[Math.min(...w.map(S=>S.rect.top))-20,Math.max(...w.map(S=>S.rect.bottom))+20]:[Math.min(...w.map(S=>S.rect.left))-20,Math.max(...w.map(S=>S.rect.right))+20];for(const S of C){const k=f(T,b.segment,S);if(!(!k||!p(v,k,m))){v.points=k,y=!0;break}}if(y)break}if(!y)return}}x(P$,"liftObstacleHuggingSameSideRails");function B$(t,e){const n=x(l=>{const u=l.groupTitleRect;if(!(!u||typeof u.left!="number"||typeof u.right!="number"||typeof u.top!="number"||typeof u.bottom!="number"||!Number.isFinite(u.left)||!Number.isFinite(u.right)||!Number.isFinite(u.top)||!Number.isFinite(u.bottom)||u.right<=u.left||u.bottom<=u.top))return{left:u.left,right:u.right,top:u.top,bottom:u.bottom}},"validTitleRect"),i=x(l=>{if(!l.isGroup||l.parentId)return;const u=l.direction,h=typeof u=="string"?u.toUpperCase():"";if(h==="LR"||h==="RL"||h==="BT")return;const d=n(l),f=l.y,p=l.height;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(m<=0||g{if(!l.horizontal)return!1;const h=l.a.y;return h<=u.top+Yt||h>=u.bottom-Yt?!1:qs(l.a.x,l.b.x,u.left,u.right)>=ka},"horizontalSegmentIntersectsTitle"),s=[...e.values()].map(i).filter(l=>!!l);if(s.length===0)return;let o=0;for(const l of t){if(l.isLayoutOnly)continue;const u=on(l.points??[]);for(const h of $r(u))for(const d of s)a(h,d.rect)&&(o=Math.max(o,d.rect.bottom-h.a.y+4))}if(!(o<=Yt))for(const l of s){const u=l.node.y,h=l.node.height;typeof u!="number"||typeof h!="number"||!Number.isFinite(u)||!Number.isFinite(h)||h<=0||(l.node.y=u-o/2,l.node.height=h+o,l.node.groupTitleRect={...l.rect,top:l.rect.top-o,bottom:l.rect.bottom-o})}}x(B$,"liftTopLaneTitleBandsAboveRails");function F$(t,e){const n=x(u=>{const h=u.groupTitleRect;if(!(!h||typeof h.left!="number"||typeof h.right!="number"||typeof h.top!="number"||typeof h.bottom!="number"||!Number.isFinite(h.left)||!Number.isFinite(h.right)||!Number.isFinite(h.top)||!Number.isFinite(h.bottom)||h.right<=h.left||h.bottom<=h.top))return{left:h.left,right:h.right,top:h.top,bottom:h.bottom}},"validTitleRect"),i=x(u=>{if(!u.isGroup||u.parentId||u.direction!=="LR")return;const d=n(u),f=u.x,p=u.width;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(g<=0||m{if(!u.vertical)return!1;const d=u.a.x;return d<=h.left+Yt||d>=h.right-Yt?!1:qs(u.a.y,u.b.y,h.top,h.bottom)>=ka},"verticalSegmentIntersectsTitle"),s=x((u,h)=>{if(!u.horizontal)return!1;const d=u.a.y;return d<=h.top+Yt||d>=h.bottom-Yt?!1:qs(u.a.x,u.b.x,h.left,h.right)>=ka},"horizontalSegmentIntersectsTitle"),o=[...e.values()].map(i).filter(u=>!!u);if(o.length===0)return;let l=0;for(const u of t){if(u.isLayoutOnly)continue;const h=on(u.points??[]);for(const d of $r(h))for(const f of o)if(a(d,f.rect))l=Math.max(l,f.rect.right-d.a.x+4);else if(s(d,f.rect)){const p=Math.min(d.a.x,d.b.x);l=Math.max(l,f.rect.right-p+4)}}if(!(l<=Yt))for(const u of o){const h=u.node.x,d=u.node.width;typeof h!="number"||typeof d!="number"||!Number.isFinite(h)||!Number.isFinite(d)||d<=0||(u.node.x=h-l/2,u.node.width=d+l,u.node.groupTitleRect={...u.rect,left:u.rect.left-l,right:u.rect.right-l})}}x(F$,"shiftLeftLaneTitleBandsLeftOfRails");function Kye(t,e){const{realNodeRects:n}=Ef(e.values()),i=t.filter(g=>!g.isLayoutOnly),a=x((g,m=new Map)=>on(m.get(g)??g.points??[]),"replacementPointsFor"),s=x((g=new Map)=>{let m=0;for(let y=0;yi.reduce((m,y)=>m+Mo(a(y,g)),0),"totalBends"),l=x(g=>{const m=a(g);if(m.length<4)return;const y=m[m.length-2],v=m[m.length-1];if(!(!xi(y,v,Yt)&&!Ti(y,v,Yt)))return{tailStart:y,terminal:v}},"terminalTailFor"),u=x((g,m)=>{const y=a(g);if(y.length<3)return;const v=y[0],T=y[1];let b;if(xi(v,T,Yt))b={x:T.x,y:m.tailStart.y};else if(Ti(v,T,Yt))b={x:m.tailStart.x,y:T.y};else return;const w=Qc(on([v,T,b,m.tailStart,m.terminal]));return $r(w).length===w.length-1?w:void 0},"candidateWithDestinationTail"),h=x((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);for(const v of $r(m))if(Oi(v.a,v.b,n,y,-2))return!0;return!1},"pathHasNodeHit"),d=x((g,m,y)=>{for(const v of i)if(v!==g){for(const T of $r(m))for(const b of $r(a(v,y)))if(Uc(T,b,.5)>=ka)return!0}return!1},"pathHasSharedTrack"),f=x((g,m,y)=>!h(g,m)&&!d(g,m,y),"candidateIsSafe"),p=x(()=>{const g=new Map;for(const m of i){const y=m.end;if(!y||!e.has(y)||a(m).length<4)continue;const T=g.get(y)??[];T.push(m),g.set(y,T)}return g},"edgesByDestination");for(let g=0;g<4;g++){const m=s();if(m===0)return;const y=o();let v,T=m,b=y;for(const w of p().values())for(let C=0;C=m||R>T||R===T&&I>=b||(v=D,T=R,b=I)}if(!v)return;for(const[w,C]of v)w.points=C}}x(Kye,"swapDestinationTerminalTailsToReduceCrossings");function Zye(t,e){const{realNodeRects:a,labelNodeRects:s}=Ef(e.values()),o=t.filter(w=>!w.isLayoutOnly),l=x((w,C=new Map)=>on(C.get(w)??w.points??[]),"replacementPointsFor"),u=x((w=new Map)=>{let C=0;for(let S=0;So.reduce((C,S)=>C+Mo(l(S,w)),0),"totalBends"),d=x(w=>{const C=w.start,S=w.end,k=C?e.get(C):void 0,E=S?e.get(S):void 0,_=k?To(k):void 0,M=E?To(E):void 0;return _&&M?{src:_,dst:M}:void 0},"endpointRectsFor"),f=x((w,C,S)=>{if(S.index<=0||S.index+1>=C.length-1)return;const k=d(w);if(k){if(S.vertical){const E=S.a.x,_=Math.min(k.src.left,k.dst.left),M=Math.max(k.src.right,k.dst.right),L=E<_-Yt?"left":E>M+Yt?"right":void 0;return L?{edge:w,points:C,segmentIndex:S.index,axis:"vertical",side:L,coord:E,min:Math.min(S.a.y,S.b.y),max:Math.max(S.a.y,S.b.y)}:void 0}if(S.horizontal){const E=S.a.y,_=Math.min(k.src.top,k.dst.top),M=Math.max(k.src.bottom,k.dst.bottom),L=E<_-Yt?"top":E>M+Yt?"bottom":void 0;return L?{edge:w,points:C,segmentIndex:S.index,axis:"horizontal",side:L,coord:E,min:Math.min(S.a.x,S.b.x),max:Math.max(S.a.x,S.b.x)}:void 0}}},"externalRailForSegment"),p=x(()=>{const w=[];for(const C of o){const S=l(C);for(const k of $r(S)){const E=f(C,S,k);E&&w.push(E)}}return w},"collectExternalRails"),g=x((w,C)=>w.edge!==C.edge&&w.axis===C.axis&&w.side===C.side&&qs(w.min,w.max,C.min,C.max)>=ka,"railsInteract"),m=x(w=>{const C=[],S=new Set;for(const k of w){if(S.has(k))continue;const E=[k],_=[];for(S.add(k);E.length>0;){const M=E.pop();_.push(M);for(const L of w)!S.has(L)&&g(M,L)&&(S.add(L),E.push(L))}_.length>1&&C.push(_)}return C},"connectedComponents"),y=x(w=>{const C=[];for(const S of w)C.some(k=>Math.abs(k-S.coord){const C=w.map(E=>E.coord),S=y(w),k=[];if(w.length<=6){const E=new Array(S.length).fill(!1),_=[],M=x(()=>{if(_.length===w.length){_.some((L,P)=>Math.abs(L-C[P])>=Yt)&&k.push([..._]);return}for(const[L,P]of S.entries())E[L]||(E[L]=!0,_.push(P),M(),_.pop(),E[L]=!1)},"visit");return M(),k}for(let E=0;E{const S=new Map;for(const[E,_]of w.entries()){const M=C[E],L=S.get(_.edge)??_.points.map(P=>({x:P.x,y:P.y}));_.axis==="vertical"?(L[_.segmentIndex].x=M,L[_.segmentIndex+1].x=M):(L[_.segmentIndex].y=M,L[_.segmentIndex+1].y=M),S.set(_.edge,L)}const k=new Map;for(const[E,_]of S){const M=Qc(on(_));if($r(M).length!==M.length-1)return;k.set(E,M)}return k},"replacementsForAssignment"),b=x(w=>{for(const[C,S]of w){const k=[C.start,C.end].filter(E=>!!E);for(const E of $r(S))if(Oi(E.a,E.b,a,k,-2)||Oi(E.a,E.b,s,[],-2))return!1}for(let C=0;C=ka)return!1}}return!0},"candidateIsSafe");for(let w=0;w<4;w++){const C=u();if(C===0)return;let S,k=C,E=h(),_=Number.POSITIVE_INFINITY;for(const M of m(p()))for(const L of v(M)){const P=T(M,L);if(!P||!b(P))continue;const D=u(P);if(D>=C)continue;const R=h(P),I=M.reduce(($,O,N)=>$+Math.abs(L[N]-O.coord),0);D>k||D===k&&(R>E||R===E&&I>=_)||(S=P,k=D,E=R,_=I)}if(!S)return;for(const[M,L]of S)M.points=L}}x(Zye,"reassignCrossingExternalRailChannels");function Qye(t,e){const{realNodeRects:n,labelNodeRects:i}=Ef(e.values()),a=t.filter(p=>!p.isLayoutOnly),s=x((p,g,m)=>on(p===g?m??[]:p.points??[]),"pointsFor"),o=x(p=>$r(p).reduce((g,m)=>{const y=m.a.x-m.b.x,v=m.a.y-m.b.y;return g+Math.hypot(y,v)},0),"pathLength"),l=x((p,g)=>{let m=0;for(let y=0;y{if(p.horizontal){const m=p.a.y;return(Math.abs(m-g.top)<1||Math.abs(m-g.bottom)<1)&&qs(p.a.x,p.b.x,g.left,g.right)>=ka}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&qs(p.a.y,p.b.y,g.top,g.bottom)>=ka}return!1},"segmentRunsAlongRectBorder"),h=x(p=>{const g=[p.start,p.end].filter(y=>!!y),m=[];for(const y of g){const v=e.get(y),T=v?To(v):void 0;T&&m.push(T)}return m},"endpointRectsFor"),d=x((p,g)=>{if(g+3>=p.length)return[];const m=p[g],y=p[g+1],v=p[g+2],T=p[g+3],b=xi(m,y,Yt)&&Ti(y,v,Yt)&&xi(v,T,Yt),w=Ti(m,y,Yt)&&xi(y,v,Yt)&&Ti(v,T,Yt);if(!b&&!w)return[];if(!(b?Math.sign(y.x-m.x)!==Math.sign(T.x-v.x):Math.sign(y.y-m.y)!==Math.sign(T.y-v.y)))return[];const S=qr(m,T,Yt)||Kr(m,T,Yt)?[]:[{x:m.x,y:T.y},{x:T.x,y:m.y}],k=S.length===0?[[...p.slice(0,g+1),...p.slice(g+3)]]:S.map(_=>[...p.slice(0,g+1),_,...p.slice(g+3)]),E=new Set;return k.map(_=>Qc(on(_))).filter(_=>{if($r(_).length!==_.length-1||!_.some(L=>wl(L,T,Yt)))return!1;const M=_.map(L=>`${L.x.toFixed(3)},${L.y.toFixed(3)}`).join("|");return E.has(M)?!1:(E.add(M),!0)})},"shortcutCandidatesAt"),f=x((p,g,m)=>{const y=[p.start,p.end].filter(T=>!!T),v=h(p);for(const T of $r(g))if(Oi(T.a,T.b,n,y,-2)||Oi(T.a,T.b,i,[],-2)||v.some(b=>u(T,b)))return!1;for(const T of a)if(T!==p){for(const b of $r(g))for(const w of $r(s(T)))if(Uc(b,w,.5)>=ka)return!1}return l(p,g)<=m},"candidateIsSafe");for(let p=0;p<8;p++){const g=l();let m,y,v=g,T=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY;for(const w of a){const C=s(w),S=Mo(C,Yt),k=o(C);for(let E=0;E<=C.length-4;E++)for(const _ of d(C,E)){const M=Mo(_,Yt),L=o(_);if(!(Mv||D===v&&(M>T||M===T&&L>=b)||(m=w,y=_,v=D,T=M,b=L)}}if(!m||!y)return;m.points=y}}x(Qye,"shortcutRedundantOrthogonalJogs");function Jye(t,e){const s=[];for(const ce of e.values()){if(ce.isGroup||ce.isEdgeLabel)continue;const oe=ce.x??0,be=ce.y??0,fe=To(ce);fe&&s.push({id:String(ce.id??""),cx:oe,cy:be,rect:fe})}if(s.length===0)return;const o=new Map(s.map(ce=>[ce.id,ce])),l=s.map(ce=>({id:ce.id,rect:ce.rect})),u=["top","bottom","left","right"],h={top:Math.min(...s.map(ce=>ce.rect.top))-20,bottom:Math.max(...s.map(ce=>ce.rect.bottom))+20,left:Math.min(...s.map(ce=>ce.rect.left))-20,right:Math.max(...s.map(ce=>ce.rect.right))+20},d=t.filter(ce=>!ce.isLayoutOnly),f=new Map(d.map((ce,oe)=>[ce,oe])),p=x(ce=>{const oe=ce==="left"||ce==="top"?-1:1,be=[];for(let fe=0;fe<=2;fe++)be.push(h[ce]+oe*20*fe);return be},"outwardTracksForSide"),g=x((ce,oe=new Map)=>on(oe.get(ce)??ce.points??[]),"replacementPointsFor"),m=x((ce,oe)=>{let be=0;for(const fe of ce)for(const Pe of oe)Gh(fe.a,fe.b,Pe.a,Pe.b,Yt)&&be++;return be},"crossingCountBetweenSegments"),y=x((ce,oe)=>m($r(ce),$r(oe)),"crossingCountBetweenPaths"),v=x((ce=new Map)=>{let oe=0;const be=[],fe=new Set,Pe=[],ve=x(Ce=>{fe.has(Ce)||(fe.add(Ce),Pe.push(Ce))},"addEdge");for(let Ce=0;Ce0&&(oe+=ae,be.push({first:Ve,second:Te,count:ae}),ve(Ve),ve(Te))}}return Pe.sort((Ce,Ve)=>(f.get(Ce)??0)-(f.get(Ve)??0)),{count:oe,pairs:be,edgeSet:fe,edges:Pe}},"crossingSnapshot"),T=x((ce,oe)=>{const be=new Set(oe.keys());if(be.size===0)return ce.count;let fe=0;for(const ve of ce.pairs)(be.has(ve.first)||be.has(ve.second))&&(fe+=ve.count);let Pe=0;for(let ve=0;ve{const oe=new Map;for(const Pe of ce.pairs){const ve=oe.get(Pe.first)??new Set;ve.add(Pe.second),oe.set(Pe.first,ve);const Ce=oe.get(Pe.second)??new Set;Ce.add(Pe.first),oe.set(Pe.second,Ce)}const be=[],fe=new Set;for(const Pe of ce.edges){if(fe.has(Pe))continue;const ve=[Pe],Ce=[];for(fe.add(Pe);ve.length>0;){const Ve=ve.pop();Ce.push(Ve);for(const se of oe.get(Ve)??[])fe.has(se)||(fe.add(se),ve.push(se))}Ce.sort((Ve,se)=>(f.get(Ve)??0)-(f.get(se)??0)),Ce.length>1&&be.push(Ce)}return be},"crossingComponents"),w=x(ce=>[ce.start,ce.end].filter(oe=>!!oe),"endpointIdsFor"),C=x(ce=>{const oe=[];for(const be of b(ce)){const fe=new Set(be),Pe=new Set(be.flatMap(Ce=>w(Ce))),ve=[...be];for(const Ce of d)fe.has(Ce)||w(Ce).some(Ve=>Pe.has(Ve))&&ve.push(Ce);ve.sort((Ce,Ve)=>(f.get(Ce)??0)-(f.get(Ve)??0)),oe.push(ve)}return oe},"pairSearchGroups"),S=x((ce,oe,be)=>T(ce,new Map([[oe,be]])),"crossingCountWithSingleReplacement"),k=x(ce=>{const oe=new Map;for(const be of ce.pairs)oe.set(be.first,(oe.get(be.first)??0)+be.count),oe.set(be.second,(oe.get(be.second)??0)+be.count);return oe},"currentCrossingsByEdge"),E=x(ce=>ce.slice(1).reduce((oe,be,fe)=>{const Pe=ce[fe];return oe+Math.abs(be.x-Pe.x)+Math.abs(be.y-Pe.y)},0),"pathLength"),_=x((ce=new Map)=>d.reduce((oe,be)=>oe+Mo(g(be,ce)),0),"totalBends"),M=x((ce=new Map)=>d.reduce((oe,be)=>oe+E(g(be,ce)),0),"totalLength"),L=x((ce,oe,be=new Map)=>{const fe=$r(oe);for(const Pe of d)if(Pe!==ce){for(const ve of fe)for(const Ce of $r(g(Pe,be)))if(Uc(ve,Ce,.5)>=ka)return!0}return!1},"pathHasSegmentConflict"),P=x((ce,oe)=>{const be=[ce.start,ce.end].filter(fe=>!!fe);for(const fe of $r(oe))if(Oi(fe.a,fe.b,l,be,-2))return!0;return!1},"pathHitsNode"),D=x((ce,oe)=>{const be=Qc(on(oe));$r(be).length===be.length-1&&ce.push(be)},"pushOrthogonalCandidate"),R=x(ce=>ce==="left"||ce==="right","sideIsHorizontal"),I=x((ce,oe,be)=>{switch(oe){case"left":return Math.min(ce.x,be.x)-20;case"right":return Math.max(ce.x,be.x)+20;case"top":return Math.min(ce.y,be.y)-20;case"bottom":return Math.max(ce.y,be.y)+20}},"localTrackForSameSide"),$=x((ce,oe,be,fe)=>{const Pe=be==="left"||be==="top"?-1:1,ve=[I(oe,be,fe),h[be]];for(const Ce of ve)for(let Ve=0;Ve<=2;Ve++)D(ce,kG(oe,be,fe,Ce+Pe*20*Ve))},"addSameSideCandidates"),O=x((ce,oe,be,fe,Pe)=>{for(const ve of p(be))for(const Ce of p(Pe))D(ce,[oe,{x:ve,y:oe.y},{x:ve,y:Ce},{x:fe.x,y:Ce},fe])},"addHorizontalToVerticalCandidates"),N=x((ce,oe,be,fe,Pe)=>{for(const ve of p(be))for(const Ce of p(Pe))D(ce,[oe,{x:oe.x,y:ve},{x:Ce,y:ve},{x:Ce,y:fe.y},fe])},"addVerticalToHorizontalCandidates"),F=x((ce,oe,be,fe,Pe)=>{const ve=[...p("top"),...p("bottom")];for(const Ce of p(be))for(const Ve of p(Pe))for(const se of ve)D(ce,[oe,{x:Ce,y:oe.y},{x:Ce,y:se},{x:Ve,y:se},{x:Ve,y:fe.y},fe])},"addHorizontalPairCandidates"),z=x((ce,oe,be,fe,Pe)=>{const ve=[...p("left"),...p("right")];for(const Ce of p(be))for(const Ve of p(Pe))for(const se of ve)D(ce,[oe,{x:oe.x,y:Ce},{x:se,y:Ce},{x:se,y:Ve},{x:fe.x,y:Ve},fe])},"addVerticalPairCandidates"),V=x(ce=>{const oe=new Set;return ce.map(be=>on(be)).filter(be=>{const fe=be.map(Pe=>`${Pe.x.toFixed(3)},${Pe.y.toFixed(3)}`).join("|");return oe.has(fe)||be.length<2?!1:(oe.add(fe),!0)})},"dedupeCandidatePaths"),B=x((ce,oe,be,fe)=>{const Pe=[],ve=CG(ce,oe,be,fe,20,Yt);ve&&D(Pe,ve),oe===fe&&$(Pe,ce,oe,be);const Ce=R(oe),Ve=R(fe);return Ce&&!Ve?O(Pe,ce,oe,be,fe):!Ce&&Ve?N(Pe,ce,oe,be,fe):Ce?F(Pe,ce,oe,be,fe):z(Pe,ce,oe,be,fe),V(Pe)},"buildCandidatesForSides"),G=x((ce,oe,be,fe)=>{const Pe=[...p("left"),...p("right")],ve=[...p("top"),...p("bottom")];for(const Ce of u){const Ve=Qp(fe,Ce),se=Ce==="top"||Ce==="bottom"?p(Ce):ve;for(const de of Pe){D(ce,[oe,be,{x:de,y:be.y},{x:de,y:Ve.y},Ve]);for(const Te of se)D(ce,[oe,be,{x:de,y:be.y},{x:de,y:Te},{x:Ve.x,y:Te},Ve])}}},"addVerticalDepartureOuterTrackCandidates"),H=x((ce,oe,be,fe)=>{const Pe=[...p("left"),...p("right")],ve=[...p("top"),...p("bottom")];for(const Ce of u){const Ve=Qp(fe,Ce),se=Ce==="left"||Ce==="right"?p(Ce):Pe;for(const de of ve){D(ce,[oe,be,{x:be.x,y:de},{x:Ve.x,y:de},Ve]);for(const Te of se)D(ce,[oe,be,{x:be.x,y:de},{x:Te,y:de},{x:Te,y:Ve.y},Ve])}}},"addHorizontalDepartureOuterTrackCandidates"),q=x(ce=>{const oe=ce.start,be=ce.end,fe=be?o.get(be):void 0;if(!oe||!fe)return[];const Pe=on(ce.points??[]);if(Pe.length<4)return[];const ve=Pe[0],Ce=Pe[1],Ve=[];return Ti(ve,Ce,Yt)?G(Ve,ve,Ce,fe):xi(ve,Ce,Yt)&&H(Ve,ve,Ce,fe),Ve},"terminalPreservingOuterTrackCandidates"),Z=x(ce=>{const oe=ce.start,be=ce.end,fe=oe?o.get(oe):void 0,Pe=be?o.get(be):void 0;if(!fe||!Pe)return[];const ve=[];for(const Ce of u){const Ve=Qp(fe,Ce);for(const se of u)ve.push(...B(Ve,Ce,Qp(Pe,se),se))}return ve.push(...q(ce)),ve},"candidatePathsFor"),Y=x(()=>new Map(d.map(ce=>[ce,$r(g(ce))])),"currentSegmentsByEdge"),ie=x((ce,oe,be)=>{const fe=new Set;for(const Pe of d){if(Pe===ce)continue;const ve=be.get(Pe)??$r(g(Pe));oe.some(Ce=>ve.some(Ve=>Uc(Ce,Ve,.5)>=ka))&&fe.add(Pe)}return fe},"sharedTrackConflictsFor"),K=x((ce,oe,be,fe)=>{const Pe=new Set;return Z(ce).map(Ce=>Qc(on(Ce))).filter(Ce=>{if(P(ce,Ce))return!1;const Ve=Ce.map(se=>`${se.x.toFixed(3)},${se.y.toFixed(3)}`).join("|");return Pe.has(Ve)||Ce.length<2?!1:(Pe.add(Ve),!0)}).map(Ce=>{const Ve=$r(Ce);let se=0;for(const de of d)de!==ce&&(se+=m(Ve,be.get(de)??$r(g(de))));return{candidate:Ce,candidateSegments:Ve,crossings:oe.count-(fe.get(ce)??0)+se,bends:Mo(Ce,Yt),totalBends:Mo(Ce),length:E(Ce)}}).filter(({crossings:Ce})=>Ce<=oe.count).sort((Ce,Ve)=>Ce.crossings-Ve.crossings||Ce.bends-Ve.bends||Ce.length-Ve.length).slice(0,48).map(Ce=>({path:Ce.candidate,segments:Ce.candidateSegments,sharedTrackConflicts:ie(ce,Ce.candidateSegments,be),totalBends:Ce.totalBends,length:Ce.length}))},"pairCandidatesFor"),Q=x((ce,oe,be,fe,Pe,ve)=>{let Ce=0;for(const se of ce.pairs)(se.first===oe||se.second===oe||se.first===fe||se.second===fe)&&(Ce+=se.count);let Ve=m(be.segments,Pe.segments);for(const se of d){if(se===oe||se===fe)continue;const de=ve.get(se)??$r(g(se));Ve+=m(be.segments,de)+m(Pe.segments,de)}return ce.count-Ce+Ve},"pairCrossingCount"),te=x((ce,oe)=>{for(const be of ce.sharedTrackConflicts)if(be!==oe)return!1;return!0},"conflictsOnlyWith"),J=x((ce,oe)=>ce.segments.some(be=>oe.segments.some(fe=>Uc(be,fe,.5)>=ka)),"candidatesShareTrack"),ge=x((ce,oe,be,fe)=>te(oe,be.edge)&&te(fe,ce.edge)&&!J(oe,fe),"pairCandidatesAreCompatible"),ee=x((ce,oe,be,fe,Pe)=>{const ve=Q(ce.current,oe.edge,be,fe.edge,Pe,ce.baseSegments);if(!(ve>=ce.current.count))return{replacements:new Map([[oe.edge,be.path],[fe.edge,Pe.path]]),crossings:ve,bends:ce.currentBends-(ce.baseBendsByEdge.get(oe.edge)??0)-(ce.baseBendsByEdge.get(fe.edge)??0)+be.totalBends+Pe.totalBends,length:ce.currentLength-(ce.baseLengthByEdge.get(oe.edge)??0)-(ce.baseLengthByEdge.get(fe.edge)??0)+be.length+Pe.length}},"scorePairReplacement"),Re=x((ce,oe)=>ce.crossings{let Pe=fe;for(const ve of oe.candidates)for(const Ce of be.candidates){if(!ge(oe,ve,be,Ce))continue;const Ve=ee(ce,oe,ve,be,Ce);Ve&&Re(Ve,Pe)&&(Pe=Ve)}return Pe},"bestScoreForOptionPair"),Be=x(ce=>{const oe=_(),be=M(),fe=Y(),Pe=k(ce),ve=new Map(d.map(ae=>[ae,Mo(g(ae))])),Ce=new Map(d.map(ae=>[ae,E(g(ae))])),Ve=new Map,se=C(ce);for(const ae of se)for(const he of ae){if(Ve.has(he))continue;const W=K(he,ce,fe,Pe);W.length>0&&Ve.set(he,{edge:he,candidates:W})}let de={replacements:new Map,crossings:ce.count,bends:oe,length:be};const Te={current:ce,currentBends:oe,currentLength:be,baseBendsByEdge:ve,baseLengthByEdge:Ce,baseSegments:fe};for(const ae of se){const he=new Set(ae.filter(ne=>ce.edgeSet.has(ne))),W=ae.map(ne=>Ve.get(ne)).filter(ne=>!!ne);for(let ne=0;ne0?de.replacements:void 0},"bestPairedReplacement");for(let ce=0;ce<4;ce++){const oe=v(),be=oe.count;if(be===0)return;let fe,Pe,ve=be,Ce=Number.POSITIVE_INFINITY;for(const se of oe.edges){const de=Mo(g(se),Yt);for(const Te of Z(se)){const ae=P(se,Te),he=!ae&&L(se,Te),W=S(oe,se,Te),ne=Mo(Te,Yt);ae||he||!(Wve||W===ve&&ne>=Ce||(fe=se,Pe=Te,ve=W,Ce=ne)}}if(fe&&Pe){fe.points=Pe;continue}const Ve=Be(oe);if(!Ve)return;for(const[se,de]of Ve)se.points=de}}x(Jye,"resolveRenderedOrthogonalCrossings");var id=.001,fut=8;function e1e(t,e){const{nodeInfoById:r,realNodeRects:n}=JR(e),i=["top","bottom","left","right"],a=20,s={top:Math.min(...n.map(m=>m.rect.top))-a,bottom:Math.max(...n.map(m=>m.rect.bottom))+a,left:Math.min(...n.map(m=>m.rect.left))-a,right:Math.max(...n.map(m=>m.rect.right))+a},o=x((m,y,v,T)=>{const b=[],w=CG(m,y,v,T,a,id);return w&&b.push(w),y===T&&b.push(kG(m,y,v,s[y])),b},"buildOrthogonalPathCandidates"),l=x((m,y)=>{for(let v=0;v{let T=0;const b=Vb(m,id),w=y.start,C=y.end;for(const S of t){if(S===y||S.isLayoutOnly)continue;const k=S.start,E=S.end;if(!v&&w&&C&&(k===w||k===C||E===w||E===C))continue;const _=S.points;if(!(!_||_.length<2))for(const M of b)for(const L of Vb(_,id)){if(EG(M.a,M.b,L.a,L.b,id,id)){T++;continue}Uc(M,L,id)>=fut&&T++}}return T},"pathConflictCount"),h=4,d=x((m,y)=>{const v=Math.abs(m.y-y.rect.top),T=Math.abs(m.y-y.rect.bottom),b=Math.abs(m.x-y.rect.left),w=Math.abs(m.x-y.rect.right);let C="top",S=v;return T{const T=f.get(m)??[];T.push({side:y,edgeId:v}),f.set(m,T)},"addFaceClaim");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points??[];if(y.length<1)continue;const v=m.id??"",T=m.start,b=m.end;if(T){const w=r.get(T);w&&p(T,d(y[0],w),v)}if(b){const w=r.get(b);w&&p(b,d(y[y.length-1],w),v)}}const g=x((m,y,v)=>{var T;return((T=f.get(m))==null?void 0:T.some(b=>b.edgeId!==v&&b.side===y))??!1},"faceIsClaimed");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points;if(!y||y.length<2)continue;const v=Mo(y,id);if(v0){const N=u($,m,!0);if(N>M||N===M&&O>=L)continue;M=N,L=O,_=$;continue}u($,m)>E||OR.edgeId!==S));const D=f.get(b);D&&f.set(b,D.filter(R=>R.edgeId!==S)),p(T,d(_[0],w),S),p(b,d(_[_.length-1],C),S)}}}x(e1e,"simplifyDetouredEdges");var oo=.001,UQ=10,HE=7;function z$(t,e){const r=e?0:t.length-1,n=e?1:-1,i=t[r],a=t[r+n];if(!i||!a)return;const s=a.x-i.x,o=a.y-i.y;if(!(Math.abs(s)+Math.abs(o)a&&t_(t,t1e(a)))}x(V$,"labelOverlapsOwnMarker");function i3(t,e){const r=[];for(const g of t){if(g.isLayoutOnly)continue;const m=g.points;if(!(!m||m.length<2))for(let y=0;y{const y=k$(m,a);for(const{nodeId:v,rect:T}of n)if(v!==g&&t_(y,T))return!0;return!1},"labelOverlapsForeignNode"),u=x((g,m)=>{const y=k$(m,a);for(const v of r)if(v.edgeId!==g&&QR(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),h=x((g,m,y)=>l(g,y)||u(m,y),"labelOverlapsAnything"),d=[],f=x(g=>{for(const{id:m,rect:y}of i)if(Rye(y,g))return m},"findContainingLane"),p=x((g,m)=>d.some(y=>y.labelId!==g&&t_(m,y.rect)),"overlapsPlacedLabel");for(const g of t){if(g.isLayoutOnly)continue;const m=g.labelNodeId;if(!m)continue;const y=e.get(m);if(!y)continue;const v=g.points;if(!v||v.length<2)continue;const T=y.width??0,b=y.height??0;if(T<=0||b<=0)continue;const w=[];for(let V=0;V=oo&&q>=oo||w.push({idx:V,length:H+q,orientation:H>=oo?"horizontal":"vertical",midX:(B.x+G.x)/2,midY:(B.y+G.y)/2})}if(w.length===0)continue;const C=w.length>=3?w.filter(V=>V.idx>0&&V.idx0?C:w,k=T>=b?"horizontal":"vertical",E=x(V=>[...V].sort((B,G)=>{const H=B.orientation===k,q=G.orientation===k;if(H!==q)return H?-1:1;const Z=B.length>=(B.orientation==="horizontal"?T:b)+2,Y=G.length>=(G.orientation==="horizontal"?T:b)+2;return Z!==Y?Z?-1:1:G.length-B.length}),"rankSegments"),_=w[0],M=w[w.length-1],L=[.5,.25,.75,.05,.95,.15,.85,.1,.9],P=x((V,B)=>{const G=v[V.idx],H=v[V.idx+1];return{midX:G.x+(H.x-G.x)*B,midY:G.y+(H.y-G.y)*B}},"anchorAtT"),D=x((V,B,G)=>Math.min(G,Math.max(B,V)),"clamp"),R=x((V,B)=>V.midX>=B.left-oo&&V.midX<=B.right+oo&&V.midY>=B.top-oo&&V.midY<=B.bottom+oo,"pointInsideRectInclusive"),I=x(V=>{const B=vy(V.midX,V.midY,T,b),G=f(B);if(G)return{laneId:G,anchor:V,rect:B};const H=i.find(({rect:te})=>R(V,te));if(!H)return;const q=H.rect.left+T/2+s,Z=H.rect.right-T/2-s,Y=H.rect.top+b/2+s,ie=H.rect.bottom-b/2-s;if(q>Z||Y>ie)return;const K={midX:D(V.midX,q,Z),midY:D(V.midY,Y,ie)},Q=vy(K.midX,K.midY,T,b);return R(V,Q)?{laneId:H.id,anchor:K,rect:Q}:void 0},"placementForAnchor"),$=x((V,B,G)=>V.orientation==="horizontal"?Math.abs(B.midX-G.x):Math.abs(B.midY-G.y),"distanceAlongSegment"),O=x((V,B)=>{const H=(V.orientation==="horizontal"?T/2:b/2)+o;if(V===_){const q=v[V.idx];if($(V,B,q)+oo{const B=E(V);for(const G of B)for(const H of L){const q=P(G,H);if(!O(G,q))continue;const Z=I(q);if(Z&&!V$(Z.rect,v)&&!p(m,Z.rect)&&!h(m,g.id,Z.rect))return{laneId:Z.laneId,anchor:Z.anchor}}},"tryPool"),F=x((V,B,G=!1)=>{const H=E(V);for(const q of H){const Z={midX:q.midX,midY:q.midY};if(B&&!O(q,Z))continue;const Y=I(Z);if(Y&&!V$(Y.rect,v)&&!p(m,Y.rect)&&!l(m,Y.rect)&&(G||!u(g.id,Y.rect)))return{laneId:Y.laneId,anchor:Y.anchor}}},"findLaneContainingFallback"),z=N(S)??(S.lengthG.labelId===m);B>=0?d[B]={labelId:m,rect:V}:d.push({labelId:m,rect:V})}}}x(i3,"anchorLabelsToPolyline");var LI=1e-6,put=8,YQ=put/2,gut=3;function G$(t,e){return t{const h=G$(o,l);let d=0;const f=x(p=>{if(!p)return;const g=i.get(p);if(!g)return;const m=u==="x"?g.w/2:g.h/2;m>d&&(d=m)},"consider");f(s.labelNodeId);for(const p of t){if(p===s||p.isLayoutOnly)continue;const g=p.start,m=p.end;!g||!m||G$(g,m)===h&&f(p.labelNodeId)}return d>0?d+gut:0},"labelClearanceFor");for(const s of t){if(s.isLayoutOnly)continue;const o=s.points;if(!TG(o,LI))continue;const l=SG(s,r,LI);if(!l)continue;const{srcId:u,dstId:h,srcInfo:d,dstInfo:f,collinearX:p,collinearY:g}=l;if(p===g)continue;let m,y;if(p){const C=f.cy>d.cy;m={x:d.cx,y:C?d.rect.bottom:d.rect.top},y={x:f.cx,y:C?f.rect.top:f.rect.bottom}}else{const C=f.cx>d.cx;m={x:C?d.rect.right:d.rect.left,y:d.cy},y={x:C?f.rect.left:f.rect.right,y:f.cy}}if(Oi(m,y,n,[u,h],1))continue;const T=a(s,u,h,p?"x":"y"),b=T>YQ?T:YQ,w=[0,b,-b];for(const C of w){const S={...m},k={...y};if(p){if(S.x+=C,k.x+=C,S.x<=d.rect.left||S.x>=d.rect.right||k.x<=f.rect.left||k.x>=f.rect.right)continue}else if(S.y+=C,k.y+=C,S.y<=d.rect.top||S.y>=d.rect.bottom||k.y<=f.rect.top||k.y>=f.rect.bottom)continue;if(!Oi(S,k,n,[u,h],1)&&!r_(S,k,t,s,{epsilon:LI})){s.points=[S,k];break}}}}x(r1e,"straightenCollinearSiblingDetours");function W$(t,e){const{realNodeRects:l,labelNodeRects:u}=Ef(e.values()),h=x((C,S)=>Vb(S,.001).map(k=>({...k,edge:C,interior:k.index>=1&&k.index<=S.length-3})),"segmentsFor"),d=x(()=>{const C=[];for(const S of t){if(S.isLayoutOnly)continue;const k=S.points;!k||k.length<2||C.push(...h(S,on(k)))}return C},"allSegments"),f=x((C,S)=>C.horizontal&&S.horizontal?qs(C.a.x,C.b.x,S.a.x,S.b.x)>=8&&Math.abs(C.a.y-S.a.y)<7:C.vertical&&S.vertical?qs(C.a.y,C.b.y,S.a.y,S.b.y)>=8&&Math.abs(C.a.x-S.a.x)<7:!1,"hasCrowdedParallelTrack"),p=x((C,S)=>{const k=C.start,E=C.end,_=h(C,S);if(_.length!==S.length-1)return!1;const M=[k,E].filter(P=>!!P),L=C.labelNodeId?[C.labelNodeId]:[];for(const P of _)if(Oi(P.a,P.b,l,M,-2)||Oi(P.a,P.b,u,L,-2))return!1;for(const P of t){if(P===C||P.isLayoutOnly)continue;const D=P.points;if(!(!D||D.length<2)){for(const R of _)for(const I of h(P,on(D)))if(f(R,I)||Gh(R.a,R.b,I.a,I.b,.001))return!1}}return!0},"candidateIsSafe"),g=x((C,S)=>{const k=on(C.edge.points??[]);if(k.length<4||C.index>=k.length-1)return;const E=k.map(_=>({..._}));if(C.horizontal)E[C.index].y+=S,E[C.index+1].y+=S;else if(C.vertical)E[C.index].x+=S,E[C.index+1].x+=S;else return;return h(C.edge,E).length===E.length-1?E:void 0},"shiftedCandidate"),m=x((C,S)=>({x:C.x??(S.left+S.right)/2,y:C.y??(S.top+S.bottom)/2}),"nodeCenter"),y=x(C=>{const S=C.edge,k=on(S.points??[]);if(k.length!==4||C.index!==1)return;const E=S.start?e.get(S.start):void 0,_=S.end?e.get(S.end):void 0,M=E?To(E):void 0,L=_?To(_):void 0,P=k.slice(C.index+2);if(!(!E||!_||!M||!L||P.length===0))return{sourceCenter:m(E,M),targetCenter:m(_,L),sourceRect:M,tail:P}},"sourceDetourContextFor"),v=x((C,S,k,E,_,M)=>{const L=E.y>=k.y,P=L?_.bottom:_.top,D=P+(L?20:-20);if(L&&C.b.y<=D+.001||!L&&C.b.y>=D-.001)return;const R=C.a.x+S;return on([{x:k.x,y:P},{x:k.x,y:D},{x:R,y:D},{x:R,y:C.b.y},...M],.001)},"verticalSourceDetour"),T=x((C,S,k,E,_,M)=>{const L=E.x>=k.x,P=L?_.right:_.left,D=P+(L?20:-20);if(L&&C.b.x<=D+.001||!L&&C.b.x>=D-.001)return;const R=C.a.y+S;return on([{x:P,y:k.y},{x:D,y:k.y},{x:D,y:R},{x:C.b.x,y:R},...M],.001)},"horizontalSourceDetour"),b=x((C,S)=>{const k=y(C);if(k){if(C.vertical)return v(C,S,k.sourceCenter,k.targetCenter,k.sourceRect,k.tail);if(C.horizontal)return T(C,S,k.sourceCenter,k.targetCenter,k.sourceRect,k.tail)}},"sourceDetourCandidate"),w=[-7,7,-14,14,-21,21];for(let C=0;C<12;C++){const S=d();let k=!1;for(let E=0;ED.interior);for(const D of P){for(const R of w){const I=g(D,R);if(I&&p(D.edge,I)){D.edge.points=I,k=!0;break}const $=b(D,R);if($&&p(D.edge,$)){D.edge.points=$,k=!0;break}}if(k)break}}if(!k)return}}x(W$,"nudgeSharedInteriorSubpaths");function n1e(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=n.x-r.x,o=n.y-r.y,l=i*o-a*s;if(Math.abs(l)<1e-10)return!1;const u=r.x-t.x,h=r.y-t.y,d=(u*o-h*s)/l,f=(u*a-h*i)/l,p=.01;return d>p&&d<1-p&&f>p&&f<1-p}x(n1e,"segmentsIntersect");function i1e(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=Lye(e),a=[];for(const o of r){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<2)continue;const u=o.start,h=o.end,d=o.labelNodeId,f=o.id??`${u}->${h}`;for(const p of i)if(!(p.nodeId===u||p.nodeId===h)&&!(d&&p.nodeId===d)){for(let g=0;g0){const o=n.filter(u=>u.type==="edge-node-overlap").length,l=n.filter(u=>u.type==="edge-edge-crossing").length;le.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${o} edge-node overlap(s), ${l} edge crossing(s)`);for(const u of n)le.warn(`[SWIMLANE_VALIDATE] ${u.type}: ${u.detail}`)}return n}x(i1e,"validateSwimlanesLayout");function a1e(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(o=>!o.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!qye(t,e)||e==="BT"&&i.length>0&&!Hye(t))return;for(const o of n){if(o.isLayoutOnly)continue;const l=o.points;!l||l.length<2||(o.points=Qc(n_(l)))}e1e(n,r),r1e(n,r),Uye(n,r);const a=new Map;for(const o of r)a.set(String(o.id),o);i3(n,a),Oye(n,a),Yye(n,a),W$(n,a),Xye(n,a),jye(n,a),P$(n,a),Kye(n,a);const s=x(()=>{Jye(n,a),Zye(n,a),Qye(n,a),i3(n,a),O$(n,a),P$(n,a),i3(n,a),O$(n,a)},"finalizeRenderedEdges");s(),W$(n,a),s(),B$(n,a),F$(n,a),B$(n,a),F$(n,a)}x(a1e,"postProcessSwimlaneLayout");function Af(t){const e=new Map(t.nodeById),r=new Set,n=[];for(const a of t.edges){if(!e.has(a.src)||!e.has(a.dst))continue;const s=`${a.id}:${a.src}->${a.dst}`;r.has(s)||(r.add(s),n.push(a))}return{nodes:[...e.keys()],edges:n,layout:t.layout,nodeById:e}}x(Af,"normalizeGraph");function MG(t,e){return t.edges.filter(r=>r.dst===e)}x(MG,"incoming");function s1e(t){const e=new Map;for(const r of t.nodes)e.set(r,[]);for(const r of t.edges)e.get(r.src).push(r.dst);return e}x(s1e,"buildSuccessorMap");function IG(t){const e=s1e(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}x(IG,"buildSortedSuccessorMap");function NG(t){const e=new Map;for(const r of t.nodes)e.set(r,0);for(const r of t.edges)e.set(r.dst,(e.get(r.dst)??0)+1);return e}x(NG,"buildInDegreeMap");function DG(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}x(DG,"sortedZeroInDegreeNodes");function eL(t,e=()=>!0){const r=new Map,n=new Map;for(const i of t.nodes)r.set(i,[]),n.set(i,[]);for(const i of t.edges)e(i)&&(n.get(i.src).push(i.dst),r.get(i.dst).push(i.src));return{preds:r,succs:n}}x(eL,"buildPredecessorSuccessorMaps");function OG(t,e,r,n){var s,o;let i=0;for(const l of t.nodes)n!=null&&n.skipGroups&&((s=t.nodeById.get(l))!=null&&s.isGroup)||(i=Math.max(i,r[l]??0));const a=Array.from({length:i+1},()=>[]);for(const l of e)n!=null&&n.skipGroups&&((o=t.nodeById.get(l))!=null&&o.isGroup)||a[Math.max(0,r[l]??0)].push(l);return a}x(OG,"buildLayersFromRanks");function uS(t){const e=NG(t),r=DG(e),n=[],i=IG(t);for(;r.length;){const a=r.shift();n.push(a);for(const s of i.get(a)??[])if(e.set(s,(e.get(s)??0)-1),(e.get(s)??0)===0){let o=0;for(;o{if(i-n<=1)return 0;const a=n+i>>1;let s=r(n,a)+r(a,i),o=n,l=a,u=n;for(;o=i||od.dst===f.dst?d.id.localeCompare(f.id):d.dst.localeCompare(f.dst));const n=Object.create(null);for(const h of e.nodes)n[h]=0;const i=[],a=x(h=>{n[h]=1;for(const d of r.get(h)??[]){const f=d.dst;n[f]===0?a(f):n[f]===1&&i.push(d)}n[h]=2},"dfs"),s=[...e.nodes].sort((h,d)=>h.localeCompare(d));for(const h of s)n[h]===0&&a(h);const o=new Set(i.map(h=>`${h.id}:${h.src}->${h.dst}`)),l=e.edges.map(h=>o.has(`${h.id}:${h.src}->${h.dst}`)?{id:h.id,src:h.dst,dst:h.src,weight:h.weight,ref:h.ref}:h);return{acyclic:{nodes:[...e.nodes],edges:l,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:i}}x(o1e,"removeCycles_DFS");function l1e(t){const e=new Map,r=x(n=>{if(e.has(n))return e.get(n);const i=t.nodeById.get(n);if(!i)return e.set(n,null),null;const a=i.parentId;if(!a)return e.set(n,null),null;const o=r(a)??a;return e.set(n,o),o},"resolve");for(const n of t.nodes)r(n);return e}x(l1e,"buildTopLaneMap");function Wh(t){const e=l1e(t);return r=>e.get(r)??null}x(Wh,"createTopLaneResolver");function tL(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}x(tL,"buildTopLaneOrder");function PG(t,e){const r=tL(t);if(!e||e.length===0)return r;const n=new Set(r),i=new Set,a=[];for(const s of e)!n.has(s)||i.has(s)||(i.add(s),a.push(s));for(const s of r)i.has(s)||a.push(s);return a}x(PG,"resolveTopLaneOrder");var mut={EPSILON:1e-6},l_={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},XQ={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function c1e(t,e){const r=Af(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:a}=eL(r);for(const C of a.values())C.sort((S,k)=>S.localeCompare(k));const s=uS(r)??[...r.nodes].sort((C,S)=>C.localeCompare(S)),o=new Map;for(const[C,S]of s.entries())o.set(S,C);const l=new Map,u=new Map;for(const C of r.nodes)u.set(C,[]);for(const C of s){const S=(a.get(C)??[]).filter(k=>l.has(k));if(S.length>0){const k=u1e(C,S,{laneOf:n,rankHint:i,topoIndex:o});l.set(C,k),u.get(k).push(C)}else l.has(C)||l.set(C,null)}for(const C of r.nodes)l.has(C)||l.set(C,null);const h=new Set;for(const C of r.nodes)(l.get(C)??null)===null&&h.add(C);const d=[...h].sort((C,S)=>{const k=o.get(C)??0,E=o.get(S)??0;return k===E?C.localeCompare(S):k-E}),f=h1e(r),p=new Map;for(const[C,S]of f.entries())p.set(C,[...S].sort((k,E)=>k.localeCompare(E)));const g=d1e(p),m=f1e(p),y=new Map;for(const C of r.nodes)y.set(C,[]);for(const C of m)for(const S of C.nodes){const k=y.get(S);k?k.push(C.id):y.set(S,[C.id])}const v=[],T=[],b=new Set,w=x(C=>{if(!b.has(C)){b.add(C),v.push(C);for(const S of u.get(C)??[])w(S);T.push(C)}},"walk");for(const C of d)w(C);for(const C of s)w(C);return{parent:l,children:u,roots:d,componentOf:g,blocks:m,nodeBlocks:y,adjacency:p,preorder:v,postorder:T,topologicalOrder:s}}x(c1e,"buildDrivingTree");function u1e(t,e,r){const n=r.laneOf(t);return[...e].sort((a,s)=>{var m,y;const o=r.laneOf(a),l=r.laneOf(s),u=o!=null&&o===n,h=l!=null&&l===n;if(u!==h)return u?-1:1;const d=(m=r.rankHint)==null?void 0:m[a],f=(y=r.rankHint)==null?void 0:y[s];if(d!=null&&f!=null&&d!==f)return f-d;const p=r.topoIndex.get(a)??0,g=r.topoIndex.get(s)??0;return p!==g?p-g:a.localeCompare(s)})[0]}x(u1e,"chooseParent");function h1e(t){const e=new Map;for(const r of t.nodes)e.set(r,new Set);for(const r of t.edges)e.get(r.src).add(r.dst),e.get(r.dst).add(r.src);return e}x(h1e,"buildAdjacency");function d1e(t){const e=new Map;let r=0;for(const n of t.keys()){if(e.has(n))continue;const i=[n];for(;i.length>0;){const a=i.pop();if(!e.has(a)){e.set(a,r);for(const s of t.get(a)??[])e.has(s)||i.push(s)}}r++}return e}x(d1e,"assignComponents");function f1e(t){const e=new Map,r=new Map,n=[],i=[];let a=0;const s=x((o,l)=>{e.set(o,++a),r.set(o,a);for(const u of t.get(o)??[])u!==l&&(e.has(u)?(e.get(u)??0)<(e.get(o)??0)&&(n.push([o,u]),r.set(o,Math.min(r.get(o)??a,e.get(u)??a))):(n.push([o,u]),s(u,o),r.set(o,Math.min(r.get(o)??a,r.get(u)??a)),(r.get(u)??0)>=(e.get(o)??0)&&i.push(p1e(o,u,n,i.length))))},"visit");for(const o of t.keys())e.has(o)||s(o,null);return i}x(f1e,"computeBlocks");function p1e(t,e,r,n){const i=[],a=new Set;for(;r.length>0;){const s=r.pop();if(i.push(s),a.add(s[0]),a.add(s[1]),s[0]===t&&s[1]===e||s[0]===e&&s[1]===t)break}return{id:n,edges:i,nodes:[...a]}}x(p1e,"popBlock");function g1e(t,e,r){const n=[...t.nodes],i=new Map;for(const[T,b]of n.entries())i.set(b,T);const a=n.length,s=new Array(a).fill(-1),o=new Array(a).fill(0),l=[],u=new Set;for(const T of n){const b=r.parent.get(T)??null,w=i.get(T);w!=null&&b==null&&(s[w]=-1,o[w]=0,u.has(T)||(u.add(T),l.push(T)))}for(;l.length>0;){const T=l.shift(),b=i.get(T);if(b==null)continue;const w=r.children.get(T)??[];for(const C of w){if(u.has(C))continue;const S=i.get(C);S!=null&&(s[S]=b,o[S]=o[b]+1,u.add(C),l.push(C))}}for(const T of n){if(u.has(T))continue;const b=i.get(T);b!=null&&(s[b]=-1,o[b]=0,u.add(T))}const h=Math.max(1,Math.ceil(Math.log2(Math.max(1,a)))+1),d=Array.from({length:h},()=>new Array(a).fill(-1));for(let T=0;T{if(T===-1||b===-1)return-1;o[T]>C&1&&(T=d[C][T],T===-1))return-1;if(T===b)return T;for(let C=h-1;C>=0;C--){const S=d[C][T],k=d[C][b];S===-1||k===-1||S!==k&&(T=S,b=k)}return d[0][T]},"lcaIndex"),p=Array.from({length:a},()=>new Map);for(const T of t.edges){let b=T.src,w=T.dst,C=e[b],S=e[w];if(C==null||S==null||(C>S&&([b,w]=[w,b],[C,S]=[S,C]),C==null||S==null||C===S))continue;const k=i.get(b),E=i.get(w);if(k==null||E==null)continue;const _=f(k,E);if(_===-1)continue;const M=p[_];for(let L=C;L{if(b.size!==0)for(const[w,C]of b)T.set(w,(T.get(w)??0)+C)},"mergeInto"),y=new Set,v=x(T=>{const b=i.get(T);y.add(T);const w=b==null?void 0:p[b],C=w?new Map(w):new Map,S=r.children.get(T)??[];for(const k of S){const E=v(k),_=e[T];if(_!=null){let M=g.get(T);M||(M=new Map,g.set(T,M));let L=E.get(_)??0;const P=e[k];P!=null&&P>_&&(L+=1),M.set(k,L)}m(C,E)}return C},"dfs");for(const T of r.roots)y.has(T)||v(T);for(const T of n)y.has(T)||v(T);return g}x(g1e,"computeSubtreeCrossCounts");function m1e(t,e,r){const n=new Map,i=x(a=>{let s=r[a]??0;const o=[...e.get(a)??[]];o.sort(BG(r));for(const l of o){i(l);const u=n.get(l);u!=null&&(s=Math.min(s,u))}n.set(a,s)},"annotate");for(const a of t)i(a);return n}x(m1e,"annotateMinimumLayers");function BG(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}x(BG,"compareByRankThenId");function y1e(t,e,r,n){let i=0;for(const l of e){const u=r[l]??0;u>i&&(i=u)}const a=Array.from({length:i+1},()=>[]),s=new Set,o=x(l=>{if(s.has(l))return;s.add(l);const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l);for(const h of n(l))o(h)},"emit");for(const l of t)o(l);for(const l of e)if(!s.has(l)){const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l),s.add(l)}return a}x(y1e,"emitNodesInTreeOrder");function v1e(t){const e=[];for(const r of t){const n=new Set,i=[];for(const a of r)n.has(a)||(n.add(a),i.push(a));e.push(i)}return e}x(v1e,"deduplicateLayers");function b1e(t,e,r,n){return i=>{const a=t.get(i)??[];if(a.length===0)return[];const s=e[i]??0,o=[],l=[],u=r.get(i);for(const h of a){const d=n.get(h)??s;d>s?o.push({child:h,min:d}):l.push(h)}return o.sort((h,d)=>h.min===d.min?h.child.localeCompare(d.child):h.min-d.min),l.sort((h,d)=>{const f=(u==null?void 0:u.get(h))??0,p=(u==null?void 0:u.get(d))??0;if(f!==p)return f-p;const g=n.get(h)??s,m=n.get(d)??s;return g!==m?g-m:h.localeCompare(d)}),[...o.map(h=>h.child),...l]}}x(b1e,"createChildOrderer");function c_(t,e,r){const n=c1e(t,{rankHint:e,laneOf:r}),{children:i,roots:a}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const s=g1e(t,e,n),o=[...a].sort(BG(e)),l=m1e(o,i,e),u=b1e(i,e,s,l);let h=y1e(o,t.nodes,e,u);return h=v1e(h),h}x(c_,"buildMultitreeLayerOrder");function x1e(t,e,r){const n=new Set(t),i=new Set(e),a=Gb(e),s=[];for(const o of r)n.has(o.src)&&i.has(o.dst)&&s.push(a.get(o.dst));return $G(s)}x(x1e,"countCrossingsBetweenAdjacent");function H$(t,e,r){const n=[];for(const a of e){const s=r[a.src],o=r[a.dst];if(s==null||o==null||s===o)continue;let l=a.src,u=a.dst,h=s,d=o;s>o&&(l=a.dst,u=a.src,h=o,d=s);for(let f=h;f(r[f]??0)-(r[d]??0));for(const d of h){const f=r[d]??0;if(f===0)continue;let p=0;for(const v of n.get(d)??[])p=Math.max(p,(r[v]??0)+1);if(p>=f)continue;const g=f;r[d]=p;const m=c_(t,r,i),y=H$(m,t.edges,r);y(e[i]??0)-(e[a]??0)||i.localeCompare(a));for(const i of n){const a=r(i);if(!a)continue;const s=t.edges.filter(m=>m.src===i);if(s.length===0)continue;let o=!1,l=0;for(const m of s){const y=r(m.dst);y==null||y===a?o=!0:l++}if(l===0||o)continue;let u=0,h=!1;for(const m of t.edges){if(m.dst!==i)continue;const y=r(m.src);y&&(y===a?h=!0:u++)}if(u>0||!h)continue;const d=e[i]??0,f=d+l;let p=0;for(const m of t.edges)m.dst===i&&(p=Math.max(p,(e[m.src]??0)+1));const g=Math.max(d,p,f);g!==d&&(e[i]=g)}}x(w1e,"adjustCrossLaneSources");function C1e(t,e){const r=Af(t),n=uS(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,a=Wh(r);let s=Object.create(null);for(const l of n){const u=MG(r,l),h=e!=null&&e.ignoreCrossLaneEdges?u.filter(d=>{const f=a(d.src),p=a(l);return!f||!p?!0:f===p}):u;if(h.length===0)s[l]=0;else if(i&&h.length===1){const d=h[0].src,f=a(d),p=a(l);f!==p?s[l]=s[d]??0:s[l]=(s[d]??0)+1}else{let d=-1/0;for(const f of h)d=Math.max(d,(s[f.src]??0)+1);s[l]=d===-1/0?0:d}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(s=T1e(r,s)),e!=null&&e.ignoreCrossLaneEdges&&w1e(r,s),{layers:c_(r,s,a),rankOf:s,dummy:new Set}}x(C1e,"assignLayers_LongestPath");function k1e(t,e){const r=Af(t),i={...C1e(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},a=Wh(r),{preds:s,succs:o}=eL(r,g=>{if(e!=null&&e.ignoreCrossLaneEdges){const m=a(g.src),y=a(g.dst);if(m&&y&&m!==y)return!1}return!0}),l=uS(r)??[...r.nodes],u=[...l].reverse(),h=x((g,m)=>{let y=0;for(const b of s.get(g)??[])y=Math.max(y,(i[b]??0)+1);let v=Number.POSITIVE_INFINITY;const T=o.get(g)??[];return T.length>0&&(v=Math.min(...T.map(b=>(i[b]??0)-1))),Number.isFinite(v)||(v=Math.max(y,m)),Math.min(Math.max(m,y),v)},"clampFeasible"),d=l_.GRAVITY_ITERATIONS,f=x(g=>{let m=!1;for(const y of g){const v=s.get(y)??[],T=o.get(y)??[];if(v.length===0&&T.length===0)continue;const b=v.length>0?v.reduce((k,E)=>k+(i[E]??0)+1,0)/v.length:i[y]??0,w=T.length>0?T.reduce((k,E)=>k+(i[E]??0)-1,0)/T.length:i[y]??0,C=Math.round((b+w)/2),S=h(y,C);S!==i[y]&&(i[y]=S,m=!0)}return m},"relaxOrder");for(let g=0;g0){const y=Math.min(...m.map(v=>(i[v]??0)-1));(i[g]??0)>y&&(i[g]=y)}}return{layers:OG(r,l,i),rankOf:i,dummy:new Set}}x(k1e,"assignLayers_Gravity");function S1e(t){const e=NG(t),r=IG(t);let n=DG(e);const i=[];for(;n.length>0;){const a=[];for(const s of n){i.push(s);for(const o of r.get(s)??[])e.set(o,(e.get(o)??0)-1),(e.get(o)??0)===0&&a.push(o)}n=a.sort((s,o)=>s.localeCompare(o))}return i.length===t.nodes.length?i:null}x(S1e,"topoSortByGenerationIfAcyclic");function E1e(t,e){const r=Af(t),n=(e==null?void 0:e.direction)==="LR"?S1e(r)??[...r.nodes].sort():uS(r)??[...r.nodes].sort(),i=Wh(r),a=x(h=>i(h)??h,"laneOf"),s=Object.create(null),o=new Map,l=x((h,d)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?a(h)===a(d)?1:0:1,"edgeWeight");for(const h of n){const d=r.nodeById.get(h);if(d!=null&&d.isGroup)continue;const f=MG(r,h);let p=0;if(f.length>0)for(const v of f){const T=v.src,b=s[T]??0;p=Math.max(p,b+l(T,h))}const g=a(h),m=o.get(g)??0,y=Math.max(p,m);s[h]=y,o.set(g,y+1)}return{layers:OG(r,n,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}x(E1e,"assignLayers_LaneAwareCompact");function A1e(t,e){const r=Af(e),{rankOf:n}=t,i=t.layers.map(p=>[...p]),a=new Set(t.dummy?[...t.dummy]:[]);let s=0;const o=new Map(r.nodeById),l=x(p=>{const g=`placeholder-${s++}`,m={id:g,isGroup:!1,isDummy:!0,width:0,height:0};for(o.set(g,m),a.add(g);i.length<=p;)i.push([]);return i[p].push(g),n[g]=p,g},"addDummyAt"),u=[...r.edges].sort((p,g)=>p.id===g.id?p.src===g.src?p.dst.localeCompare(g.dst):p.src.localeCompare(g.src):p.id.localeCompare(g.id)),h=[];for(const p of u){const g=n[p.src]??0,m=n[p.dst]??0;if(m-g<=1){h.push(p);continue}let y=p.src;for(let T=g+1,b=0;T!r.nodes.includes(p))],edges:h,layout:r.layout,nodeById:o};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:f}}x(A1e,"makeProperLayering");function q$(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const r=[...t].sort((n,i)=>n-i);return e%2===1?r[(e-1)/2]:.5*(r[e/2-1]+r[e/2])}x(q$,"median");function U$(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}x(U$,"barycenter");function _1e(t,e,r,n){const i=new Map;for(const a of t)i.set(a,[]);for(const a of r)n==="down"?e.has(a.src)&&i.has(a.dst)&&i.get(a.dst).push(e.get(a.src)):e.has(a.dst)&&i.has(a.src)&&i.get(a.src).push(e.get(a.dst));return i}x(_1e,"neighborPositionsFor");function R1e(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}x(R1e,"currentOrderTieBreak");function Y$(t,e,r){const n=new Set(t),i=new Set(e),a=Gb(t),s=Gb(e),o=[];for(const u of r)n.has(u.src)&&i.has(u.dst)&&o.push({u:a.get(u.src),v:s.get(u.dst)});o.sort((u,h)=>u.u===h.u?u.v-h.v:u.u-h.u);const l=o.map(u=>u.v);return $G(l)}x(Y$,"countCrossingsBetweenAdjacent");function a3(t,e,r){return[...t].sort((n,i)=>{const a=q$(e.get(n)??[]),s=q$(e.get(i)??[]);return a===s?R1e(n,i,r):isFinite(a)?isFinite(s)?a-s:-1:1})}x(a3,"sortByHeuristic");function X$(t,e,r,n,i,a){const s=Gb(t),o=Gb(e),l=_1e(e,s,r,n);if(!i||!a||a.length===0)return a3(e,l,o);const u=new Map;for(const f of e){const p=i(f),g=u.get(p)??[];g.push(f),u.set(p,g)}const h=[];for(const f of a){const p=u.get(f);if(!p||p.length===0)continue;const g=a3(p,l,o);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=a3(d,l,o);for(const p of f){const g=U$(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[y,v]of h.entries()){const T=U$(l.get(v)??[]);if(gs.has(m.src)&&o.has(m.dst)),h=l?r.filter(m=>o.has(m.src)&&l.has(m.dst)):void 0,d=x(m=>{let y=Y$(t,m,u);return h&&n&&(y+=Y$(m,n,h)),y},"crossingScore"),f=i?new Map:null;if(i&&f)for(const m of e)f.set(m,i(m));let p=!0,g=d(a);for(;p;){p=!1;for(let m=0;m+1[...o]),i=e.edges,a=Wh(e),s=PG(e,r==null?void 0:r.laneOrder);for(let o=0;o<3;o++){for(let l=1;l=0;l--)n[l]=X$(n[l+1],n[l],i,"up",a,s),n[l]=j$(n[l+1],n[l],i,n[l-1],a)}return{layers:n}}x(L1e,"orderLayers");function M1e(t,e,r){const n=(r==null?void 0:r.layerGap)??XQ.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??XQ.DEFAULT_NODE_GAP,a=(r==null?void 0:r.laneGap)??i*2,s=(r==null?void 0:r.direction)??"TB",o=s==="LR"||s==="RL",l=t.layers,u=Object.create(null),h=Object.create(null),d=x(M=>e.nodeById.get(M),"getNode"),f=x(M=>{var L;return((L=d(M))==null?void 0:L.width)??0},"getWidth"),p=x(M=>{var L;return((L=d(M))==null?void 0:L.height)??0},"getHeight"),g=Wh(e),m=PG(e,r==null?void 0:r.laneOrder),y=l.map(M=>M.reduce((L,P)=>Math.max(L,p(P)),0)),v=[];if(o)for(let M=0;M+1Math.max(N,f(F)),0),P=l[M+1].reduce((N,F)=>Math.max(N,f(F)),0),D=y[M],R=y[M+1],I=D/2+R/2,$=(L+P)/2,O=Math.max(0,$-I-n);v.push(O)}const T=new Set;for(const M of l)for(const L of M)T.add(g(L));const b=T.has(null),w=m.filter(M=>T.has(M)),C=[...b?[null]:[],...w],S=Object.create(null);for(const M of w)S[M]=0;b&&(S.null=0);for(const M of l){const L=Object.create(null),P=[];for(const D of M){const R=g(D);R===null?P.push(D):(L[R]||(L[R]=[])).push(D)}for(const[D,R]of Object.entries(L)){const I=R.reduce(($,O)=>$+f(O),0)+i*Math.max(0,R.length-1);S[D]=Math.max(S[D]??0,I)}if(b&&P.length){const D=P.reduce((R,I)=>R+f(I),0)+i*Math.max(0,P.length-1);S.null=Math.max(S.null??0,D)}}const k=new Map;{const M=C.map(D=>(D===null?S.null:S[D])??0);let P=-(M.reduce((D,R)=>D+R,0)+a*Math.max(0,C.length-1))/2;for(let D=0;Df(V)),F=N.reduce((V,B)=>V+B,0)+i*($.length-1);let z=O-F/2;for(const[V,B]of $.entries()){const G=N[V];u[B]=z+G/2,h[B]=E+P/2,z+=G+i}}}const R=v[M]??0;E+=P+n+R}const _=new Map;for(const M of e.edges){const L=M.ref.id;_.has(L)||_.set(L,[]),_.get(L).push(M)}for(const[,M]of _){if(M.length===0)continue;const L=M[0].ref,P=L.start,D=L.end;if(P==null||D==null)continue;const R=Math.round(((u[P]??0)+(u[D]??0))/2),I=new Set;for(const $ of M)I.add($.src),I.add($.dst);for(const $ of I){if($===P||$===D)continue;const O=e.nodeById.get($);O!=null&&O.isDummy&&(u[$]=R)}}return{x:u,y:h}}x(M1e,"assignCoordinates");var I1e=8;function N1e(t){let e=2166136261;for(let r=0;r>>0}x(N1e,"hashString");function D1e(t){let e=t>>>0;return()=>{e+=1831565813;let r=e;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}x(D1e,"mulberry32");function O1e(t,e){const r=[...t],n=D1e(e);for(let i=r.length-1;i>0;i--){const a=Math.floor(n()*(i+1));[r[i],r[a]]=[r[a],r[i]]}return r}x(O1e,"deterministicShuffle");function $1e(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}x($1e,"sourceDistance");function K$(t,e){const r=new Map;for(const[i,a]of t.entries())r.set(a,i);let n=0;for(const{a:i,b:a,weight:s}of e){const o=r.get(i),l=r.get(a);o==null||l==null||(n+=s*Math.abs(o-l))}return n}x(K$,"laneArrangementCost");function P1e(t){const e=tL(t);if(e.length<2)return[];const r=new Map(e.map((a,s)=>[a,s])),n=Wh(t),i=new Map;for(const a of t.layout.edges??[]){if(a.isLayoutOnly)continue;const s=typeof a.start=="string"?a.start:void 0,o=typeof a.end=="string"?a.end:void 0;if(!s||!o||!t.nodeById.has(s)||!t.nodeById.has(o))continue;const l=n(s),u=n(o);if(!l||!u||l===u)continue;const h=r.get(l),d=r.get(u);if(h==null||d==null)continue;const[f,p]=h<=d?[l,u]:[u,l],g=`${f}\0${p}`,m=i.get(g);m?m.weight++:i.set(g,{a:f,b:p,weight:1})}return[...i.values()]}x(P1e,"buildWeightedLaneEdges");function Z$(t,e,r){const n=[...t];let i=K$(n,e),a=!0,s=0;const o=Math.max(1,n.length);for(;a&&si.a===a.a?i.b.localeCompare(a.b):i.a.localeCompare(a.a)).map(({a:i,b:a,weight:s})=>`${i}:${a}:${s}`).join("|");return N1e(`${t.join("|")}#${n}#${r}`)}x(F1e,"seedForRestart");function z1e(t,e={}){const r=tL(t);if(r.length<2)return r;const n=P1e(t);if(n.length===0)return r;const i=new Map(r.map((o,l)=>[o,l]));let a=Z$(r,n,i);const s=Math.max(0,e.restarts??I1e);for(let o=0;oFr&&l*3>=o?s>0?"bottom":"top":o>Fr?a>0?"right":"left":r}x(Q$,"chooseOrthogonalSide");function J$(t,e){return Math.abs(t.to-e.from)se.isGroup&&!se.parentId);for(const se of u){const de={id:se.id},Te=x(ae=>{s.set(ae.id,de),r.filter(he=>he.parentId===ae.id).forEach(Te)},"assignLane");Te(se)}const h=r.filter(se=>!se.isGroup&&!se.isEdgeLabel).map(se=>{const de=se.width??10,Te=se.height??10,ae=se.x??0,he=se.y??0,W=yut;return{nodeId:se.id,minX:ae-de/2-W,maxX:ae+de/2+W,minY:he-Te/2-W,maxY:he+Te/2+W,visualXHalfExtent:l?Te/2+W:de/2+W}}),d=x((se,de,Te,ae)=>{let he=o.find(W=>W.orientation===se&&Math.abs(W.coord-de)<1);return he||(he={id:`pipe-${se}-${de.toFixed(0)}`,orientation:se,coord:de,spanMin:Te,spanMax:ae,tracks:[]},o.push(he)),he.spanMin=Math.min(he.spanMin,Te),he.spanMax=Math.max(he.spanMax,ae),he},"getOrAddPipe"),f=x((se,de)=>{const Te=se.width??10,ae=se.height??10,he=se.x??0,W=se.y??0;switch(de){case"top":return{x:he,y:W-ae/2};case"bottom":return{x:he,y:W+ae/2};case"left":return{x:he-Te/2,y:W};case"right":return{x:he+Te/2,y:W}}},"portForSide"),p=x((se,de,Te)=>f(se,Q$(se,de,Te?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],y=new Set,v=1e3,T=x((se,de,Te)=>{if(g.length===0)return 0;const ae=Math.abs(de.y-Te.y)ue||X.from-Fr<=ne&&X.to+Fr>=ne&&(W+=v)}else if(he){const ne=de.x,j=Math.min(de.y,Te.y)-Fr,ue=Math.max(de.y,Te.y)+Fr;if(ue<=j)return 0;for(const X of g)X.edgeIndex===se||X.orientation!=="horizontal"||X.pipe.coordue||X.from-Fr<=ne&&X.to+Fr>=ne&&(W+=v)}return W},"crossingPenalty"),b=i.map((se,de)=>{if(!se.start||!se.end)return{idx:de,crossLane:0,dx:0,dy:0};const Te=a.get(se.start),ae=a.get(se.end),he=s.get(se.start),W=s.get(se.end),ne=he&&W&&he.id!==W.id?1:0,j=Te&&ae?Math.abs((ae.x??0)-(Te.x??0)):0,ue=Te&&ae?Math.abs((ae.y??0)-(Te.y??0)):0;return{idx:de,crossLane:ne,dx:j,dy:ue}}).sort((se,de)=>{if(se.crossLane!==de.crossLane)return de.crossLane-se.crossLane;const Te=se.dx+se.dy,ae=de.dx+de.dy;return Math.abs(Te-ae)>1?Te-ae:se.idx-de.idx}).map(se=>se.idx),w=x((se,de,Te,ae)=>{const he=Math.min(se.x,de.x),W=Math.max(se.x,de.x),ne=Math.min(se.y,de.y),j=Math.max(se.y,de.y);return!!h.find(X=>Te&&X.nodeId===Te||ae&&X.nodeId===ae?!1:Math.abs(se.x-de.x)>Fr?X.minYse.y&&X.maxX>he&&X.minXse.x&&X.maxY>ne&&X.minYQ$(se,de,"bottom"),"determineSide"),E=new Map;for(const[se,de]of i.entries()){if(!de.start||!de.end||de.start===de.end||de.points&&de.points.length>0)continue;const Te=a.get(de.start),ae=a.get(de.end);if(!Te||!ae)continue;const he=(ae.x??0)-(Te.x??0),W=(ae.y??0)-(Te.y??0);E.set(se,{edgeIdx:se,srcId:de.start,dstId:de.end,srcSide:k(Te,{x:ae.x??0,y:ae.y??0}),dstSide:k(ae,{x:Te.x??0,y:Te.y??0}),absDx:Math.abs(he),absDy:Math.abs(W),dxSign:Math.sign(he),dySign:Math.sign(W)})}const _=x(se=>se.srcSide==="top"||se.srcSide==="bottom"?se.absDx===0?1/0:se.absDy/se.absDx:se.absDy===0?1/0:se.absDx/se.absDy,"preferenceStrength"),M=x(se=>se.srcSide==="top"||se.srcSide==="bottom"?se.dxSign>=0?"right":"left":se.dySign>=0?"bottom":"top","secondarySide"),L=new Map;for(const se of E.values()){const de=`${se.srcId}:${se.srcSide}`;L.has(de)||L.set(de,[]),L.get(de).push(se)}const P=new Map,D=x((se,de)=>`${se}:${de}`,"loadKey");for(const se of E.values())P.set(D(se.srcId,se.srcSide),(P.get(D(se.srcId,se.srcSide))??0)+1),P.set(D(se.dstId,se.dstSide),(P.get(D(se.dstId,se.dstSide))??0)+1);for(const se of L.values())if(!(se.length<2)){se.sort((de,Te)=>{const ae=_(de),he=_(Te);return Math.abs(ae-he)>1e-9?he-ae:de.edgeIdx-Te.edgeIdx});for(let de=1;de=he||(P.set(D(Te.srcId,Te.srcSide),he-1),P.set(D(Te.srcId,ae),W+1),Te.srcSide=ae)}}const R=x(se=>{const de=se==null?void 0:se.shape;return de==="question"||de==="diamond"},"isDiamondNode"),I=new Map;for(const se of E.values())I.has(se.dstId)||I.set(se.dstId,new Set),I.get(se.dstId).add(se.dstSide);for(const se of E.values()){if(!R(a.get(se.srcId)))continue;const de=I.get(se.srcId);if(!(de!=null&&de.has(se.srcSide)))continue;const Te=M(se);if(de.has(Te)||(P.get(D(se.srcId,Te))??0)>0)continue;const ae=P.get(D(se.srcId,se.srcSide))??0;P.set(D(se.srcId,se.srcSide),Math.max(0,ae-1)),P.set(D(se.srcId,Te),1),se.srcSide=Te}for(const se of E.values()){const{edgeIdx:de,srcId:Te,dstId:ae,srcSide:he,dstSide:W}=se,ne=a.get(Te),j=a.get(ae),ue=`${Te}:${he}:src`,X=he==="top"||he==="bottom"?j.x??0:j.y??0;C.has(ue)||C.set(ue,[]),C.get(ue).push({edgeIdx:de,oppositeCoord:X});const Oe=`${ae}:${W}:dst`,xe=W==="top"||W==="bottom"?ne.x??0:ne.y??0;C.has(Oe)||C.set(Oe,[]),C.get(Oe).push({edgeIdx:de,oppositeCoord:xe})}const $=new Map,O=8;for(const[se,de]of C){if(de.length<2)continue;de.sort((He,De)=>He.oppositeCoord-De.oppositeCoord);const Te=se.split(":"),ae=Te.slice(0,-2).join(":"),he=Te[Te.length-2],W=Te[Te.length-1],ne=a.get(ae);if(!ne)continue;const ue=he==="left"||he==="right"?ne.height??10:ne.width??10,X=ne.shape,xe=X==="question"||X==="diamond"?ue*.3:ue,_e=Math.min(20,Math.max(O,xe/(de.length+1))),Me=-(_e*(de.length-1))/2;for(const[He,De]of de.entries()){const Ke=Me+He*_e,Ae=`${De.edgeIdx}:${W}`;$.set(Ae,Ke)}}const N=x(se=>{var de;return!!((de=i[se])!=null&&de.labelNodeId)},"edgeHasLabelNode"),F=x((se,de)=>se?(C.get(`${se}:${de}:src`)??[]).some(({edgeIdx:Te})=>N(Te))||(C.get(`${se}:${de}:dst`)??[]).some(({edgeIdx:Te})=>N(Te)):!1,"faceHasLabelNode"),z=x((se,de,Te)=>de==="top"||de==="bottom"?{x:se.x+Te,y:se.y}:{x:se.x,y:se.y+Te},"applyPortOffset"),V=x((se,de,Te)=>{const ae=E.get(se),he={x:Te.x??0,y:Te.y??0},W={x:de.x??0,y:de.y??0},ne=(ae==null?void 0:ae.srcSide)??k(de,he),j=(ae==null?void 0:ae.dstSide)??k(Te,W);let ue=ae?f(de,ae.srcSide):p(de,he,!0),X=ae?f(Te,ae.dstSide):p(Te,W,!1);const Oe=$.get(`${se}:src`),xe=$.get(`${se}:dst`);return Oe!==void 0&&(ue=z(ue,ne,Oe)),xe!==void 0&&(X=z(X,j,xe)),{pSrcPort:ue,pDstPort:X,srcSide:ne,dstSide:j}},"portsForEdge");for(const se of b){const de=i[se];if(m[se]=[],!de.start||!de.end||de.points&&de.points.length>0||de.start===de.end)continue;const Te=a.get(de.start),ae=a.get(de.end);if(!Te||!ae)continue;const{pSrcPort:he,pDstPort:W,srcSide:ne,dstSide:j}=V(se,Te,ae),ue={...he},X={...W},Oe=ne==="top"||ne==="bottom",xe=j==="top"||j==="bottom";if(Oe){const Qe=he.y>(Te.y??0);ue.y=Qe?he.y+Jo:he.y-Jo}else{const Qe=he.x>(Te.x??0);ue.x=Qe?he.x+Jo:he.x-Jo}if(xe){const Qe=W.y>(ae.y??0);X.y=Qe?W.y+Jo:W.y-Jo}else{const Qe=W.x>(ae.x??0);X.x=Qe?W.x+Jo:W.x-Jo}const Ge=x((Qe,ct)=>{for(const It of h)if(!ct.includes(It.nodeId)&&Qe.x>It.minX&&Qe.xIt.minY&&Qe.y{if(Or){const xt=Qe.y>(ct.y??0);return{x:(It.x??0)>=Qe.x?cr.maxX+jf:cr.minX-jf,y:xt?cr.maxY+Xg:cr.minY-Xg,leavesPositiveSide:xt}}const yt=Qe.x>(ct.x??0),it=(It.y??0)>=Qe.y;return{x:yt?cr.maxX+jf:cr.minX-jf,y:it?cr.maxY+Xg:cr.minY-Xg,leavesPositiveSide:yt}},"obstacleDetour");let $e=[];const Me=[de.start,de.end],He=Ge(ue,Me);if(He.inside&&He.obstacle){const Qe=He.obstacle;if(Oe){const ct=_e(he,Te,ae,Qe,!0);ue.x=ct.x,ue.y=ct.y;const It=ct.leavesPositiveSide?Math.min(Qe.minY-2,he.y+Jo):Math.max(Qe.maxY+2,he.y-Jo);$e=[{x:he.x,y:It},{x:ct.x,y:It},{x:ct.x,y:ct.y}]}else{const ct=_e(he,Te,ae,Qe,!1),It=ct.leavesPositiveSide?Math.min(Qe.minX-2,he.x+Jo):Math.max(Qe.maxX+2,he.x-Jo);ue.x=ct.x,ue.y=ct.y,$e=[{x:It,y:he.y},{x:It,y:ct.y},{x:ct.x,y:ct.y}]}}let De=[];const Ke=Ge(X,Me);if(Ke.inside&&Ke.obstacle){const Qe=Ke.obstacle;if(xe){const ct=_e(W,ae,Te,Qe,!0);X.x=ct.x,X.y=ct.y,De=[{x:ct.x,y:ct.y},{x:W.x,y:ct.y}]}else{const ct=_e(W,ae,Te,Qe,!1);X.x=ct.x,X.y=ct.y,De=[{x:ct.x,y:ct.y},{x:ct.x,y:W.y}]}}if($e.length===0&&De.length===0){const Qe=jf,ct=Math.abs(ue.x-X.x)1||yt>1,xt=S.get(de.start??"")??0,nt=S.get(de.end??"")??0,Ht=Or>1&&F(de.start,ne)||yt>1&&F(de.end,j),ke=Or<=1||xt<=2,rn=yt<=1||nt<=2;if((ct||It)&&!cr&&(!it||it&&!Ht&&ke&&rn)&&!w(he,W,de.start,de.end)){de.points=[{...he},{...ue},{...X},{...W}],y.add(se);const nn=It?"horizontal":"vertical",Bi=It?he.y:he.x,Qr=It?Math.min(he.x,W.x):Math.min(he.y,W.y),bn=It?Math.max(he.x,W.x):Math.max(he.y,W.y),Yr={id:`fast-path-${nn}-${Bi.toFixed(0)}-${se}`,orientation:nn,coord:Bi,spanMin:Qr,spanMax:bn,tracks:[]};g.push({edgeIndex:se,segmentIndex:0,orientation:nn,pipe:Yr,trackIndex:0,from:Qr,to:bn});continue}}const Ae=d("vertical",ue.x,ue.y,ue.y);ue.x=Ae.coord;const at=d("vertical",X.x,X.y,X.y);X.x=at.coord;let Ee=Math.min(ue.x,X.x)-50,pt=Math.max(ue.x,X.x)+50,ht=Math.min(ue.y,X.y)-50,rt=Math.max(ue.y,X.y)+50;for(const Qe of h){const ct=Math.min(ue.x,X.x),It=Math.max(ue.x,X.x),cr=Math.min(ue.y,X.y),Or=Math.max(ue.y,X.y);Qe.minXct&&Qe.minYcr&&(Ee=Math.min(Ee,Qe.minX-qE),pt=Math.max(pt,Qe.maxX+qE),ht=Math.min(ht,Qe.minY-qE),rt=Math.max(rt,Qe.maxY+qE))}for(const Qe of h){if(Qe.maxXpt||Qe.maxYrt)continue;const ct=jf;d("horizontal",Qe.minY-ct,Ee,pt),d("horizontal",Qe.maxY+ct,Ee,pt);const It=Xg;d("vertical",Qe.minX-It,ht,rt),d("vertical",Qe.maxX+It,ht,rt)}d("horizontal",ue.y,Ee,pt),d("horizontal",X.y,Ee,pt);const Et=o.filter(Qe=>Qe.orientation==="horizontal"&&Qe.coord>=ht&&Qe.coord<=rt),vt=o.filter(Qe=>Qe.orientation==="vertical"&&Qe.coord>=Ee&&Qe.coord<=pt),ot=x((Qe,ct)=>`${Qe.toFixed(1)},${ct.toFixed(1)}`,"getKey"),pe=ot(ue.x,ue.y),Ct=ot(X.x,X.y),lt=new Map,st=new Map,mt=new Map,_r=new Set,Se=[];lt.set(pe,0),mt.set(pe,"n"),Se.push({key:pe,f:Math.hypot(X.x-ue.x,X.y-ue.y),pt:ue}),_r.add(pe);let Ue=[];const tt=x((Qe,ct)=>w(Qe,ct,de.start,de.end),"checkSegmentBlocked"),kt={x:X.x,y:ue.y},Nt=tt(ue,kt),sr=tt(kt,X),Qt=Nt||sr,vr={x:ue.x,y:X.y},nr=tt(ue,vr),Rr=tt(vr,X);if(Qt?nr||Rr||(Math.abs(ue.x-X.x)0;){Se.sort((nt,Ht)=>nt.f-Ht.f);const Qe=Se.shift();if(_r.delete(Qe.key),Qe.key===Ct){let nt=Ct,Ht=X;for(Ue=[Ht];st.has(nt);){const ke=st.get(nt);Ue.unshift(ke),Ht=ke,nt=ot(ke.x,ke.y)}break}const ct=Qe.pt.x,It=Qe.pt.y,cr=vt.sort((nt,Ht)=>nt.coord-Ht.coord),Or=cr.findIndex(nt=>Math.abs(nt.coord-ct)<1),yt=Et.sort((nt,Ht)=>nt.coord-Ht.coord),it=yt.findIndex(nt=>Math.abs(nt.coord-It)<1),xt=[];Or>0&&xt.push({x:cr[Or-1].coord,y:It}),Or>=0&&Or0&&xt.push({x:ct,y:yt[it-1].coord}),it>=0&&itdt.nodeId===de.start||dt.nodeId===de.end?!1:Ht!==ke?dt.minYIt&&dt.maxX>Ht&&dt.minXct&&dt.maxY>rn&&dt.minY10&&xu<-5||Da<-10&&xu>5)&&(bn=Math.abs(xu)*100),(Yr>10&&gc<-5||Yr<-10&&gc>5)&&(bn+=Math.abs(gc)*50);let Vf=0;const Tu=mt.get(Qe.key)??"n",wu=Math.abs(gc)>Fr?"h":"v";Tu!=="n"&&Tu!==wu&&(Vf=50);const wt=Bi+Qr+bn+Vf,Le=(lt.get(Qe.key)??1/0)+wt,je=Math.abs(X.x-nt.x)+Math.abs(X.y-nt.y);if(Le<(lt.get(nn)??1/0))if(st.set(nn,Qe.pt),lt.set(nn,Le),mt.set(nn,wu),!_r.has(nn))Se.push({key:nn,f:Le+je,pt:nt}),_r.add(nn);else{const dt=Se.findIndex(Ft=>Ft.key===nn);dt!==-1&&(Se[dt].f=Le+je)}}}if(Ue.length===0&&(Ue=[ue,{x:ue.x,y:X.y},X]),Ue.length>4){const Qe=Ue[0],ct=Ue[Ue.length-1];let It=Math.min(Qe.x,ct.x),cr=Math.max(Qe.x,ct.x),Or=Math.min(Qe.y,ct.y),yt=Math.max(Qe.y,ct.y);for(const rn of Ue)It=Math.min(It,rn.x),cr=Math.max(cr,rn.x),Or=Math.min(Or,rn.y),yt=Math.max(yt,rn.y);const it=cr>Math.max(Qe.x,ct.x),xt=ItQr.minXNe&&Qr.minYMr);if(Bi.length>0){let Qr=Math.max(Qe.x,ct.x);for(const bn of Bi){const Yr=(bn.minX+bn.maxX)/2;if(bn.visualXHalfExtent===void 0||isNaN(bn.visualXHalfExtent))continue;const Da=Yr+bn.visualXHalfExtent+rn;Qr=Math.max(Qr,Da)}isNaN(Qr)||(cr=Qr)}}if(xt){const Ne=h.filter(Mr=>Mr.minXMath.min(Qe.y,ct.y));if(Ne.length>0){let Mr=Math.min(Qe.x,ct.x);for(const nn of Ne){const Qr=(nn.minX+nn.maxX)/2-nn.visualXHalfExtent-rn;Mr=Math.min(Mr,Qr)}It=Mr}}}const nt=x(rn=>{const Ne=ct.y>Qe.y,Mr=h.filter(Qr=>{const bn=Math.min(Qe.x,ct.x)Qr.minX,Yr=Math.min(Qe.y,ct.y)Qr.minY;return bn&&Yr});let nn=Mr;if(l&&Mr.length>0){const Qr=Mr.filter(bn=>bn.minXrn);Qr.length>0&&(nn=Qr)}if(nn.length===0)return ct.y;const Bi=jf;if(Ne){const bn=Math.max(...nn.map(Yr=>Yr.maxY))+Bi;if(bnYr.minY))-Bi;if(bn>ct.y+Fr)return bn}return ct.y},"findBestReturnY"),Ht=x(rn=>{const Ne=nt(rn),Mr={x:rn,y:Qe.y},nn={x:rn,y:Ne},Bi={x:ct.x,y:Ne},Qr=tt(Qe,Mr),bn=tt(Mr,nn),Yr=tt(nn,Bi),Da=Ne!==ct.y?tt(Bi,ct):!1;return!Qr&&!bn&&!Yr&&!Da?Math.abs(Ne-ct.y)=3){const Qe=gr[gr.length-1],ct=gr[gr.length-2],It=gr[gr.length-3],cr=Math.abs(It.y-ct.y)Math.abs(Qe.x-It.x)&&gr.splice(-2,1)}else if(Or){const yt=Math.sign(ct.y-It.y),it=Math.sign(Qe.y-It.y);yt!==0&&yt===it&&Math.abs(ct.y-It.y)>Math.abs(Qe.y-It.y)&&gr.splice(-2,1)}}const Dr=[gr[0]];for(let Qe=1;Qect.x,yt=cr.x>It.x;if(Or!==yt){Dr.push(It);continue}continue}if(Math.abs(ct.x-It.x)ct.y,yt=cr.y>It.y;if(Or!==yt){Dr.push(It);continue}continue}Dr.push(It)}Dr.push(gr[gr.length-1]);for(let Qe=0;Qese.from{const he=!ae.segments.some(ne=>(ne.edgeIndex!==de.edgeIndex||ne.segmentIndex!==de.segmentIndex)&&B(ne,se)),W=!Te.segments.some(ne=>(ne.edgeIndex!==se.edgeIndex||ne.segmentIndex!==se.segmentIndex)&&B(ne,de));return he&&W?(se.trackIndex=ae.index,de.trackIndex=Te.index,Te.segments=[...Te.segments.filter(ne=>ne.edgeIndex!==se.edgeIndex||ne.segmentIndex!==se.segmentIndex),{edgeIndex:de.edgeIndex,segmentIndex:de.segmentIndex,from:de.from,to:de.to}],ae.segments=[...ae.segments.filter(ne=>ne.edgeIndex!==de.edgeIndex||ne.segmentIndex!==de.segmentIndex),{edgeIndex:se.edgeIndex,segmentIndex:se.segmentIndex,from:se.from,to:se.to}],!0):!1},"trySwapSegmentsAcrossTracks"),H=x(se=>{const de=se.tracks.length;return se.tracks[de]={index:de,coord:se.coord,segments:[]},de},"createNewTrack"),q=x((se,de)=>{const Te=se.pipe.tracks[se.trackIndex];Te.segments=Te.segments.filter(he=>he.edgeIndex!==se.edgeIndex||he.segmentIndex!==se.segmentIndex),se.trackIndex=de,se.pipe.tracks[de].segments.push({edgeIndex:se.edgeIndex,segmentIndex:se.segmentIndex,from:se.from,to:se.to})},"moveSegmentToTrack"),Z=x((se,de)=>{const Te=m[se.edgeIndex];for(const ae of Te){const he=g[ae];he.pipe===se.pipe&&q(he,de)}},"moveSegmentChainToTrack"),Y=x(se=>{const de=m[se.edgeIndex],Te=de.indexOf(g.indexOf(se)),ae=[];return Te>0&&ae.push(g[de[Te-1]]),Te{if(se.orientation===de.orientation)return!1;const Te=se.orientation==="horizontal"?se:de,ae=se.orientation==="horizontal"?de:se;return ae.pipe.coord>Te.from&&ae.pipe.coordae.from&&Te.pipe.coord{for(const Te of se.tracks)if(!Te.segments.some(he=>(he.edgeIndex!==de.edgeIndex||he.segmentIndex!==de.segmentIndex)&&B(he,de)))return Te.index;return-1},"findAvailableTrack"),Q=x((se,de)=>{if(se.trackIndex===de.trackIndex)return B(se,de);const Te=Y(se),ae=Y(de);return Te.some(he=>ae.some(W=>ie(he,W)))},"segmentsConflict"),te=x((se,de,Te)=>{if(G(se,de,se.pipe.tracks[se.trackIndex],de.pipe.tracks[de.trackIndex]))return;const ae=K(se.pipe,de);Te(de,ae!==-1?ae:H(se.pipe))},"resolveTrackConflict"),J=x(se=>{let de=0;for(let Te=0;Te{if(ge.has(se))return ge.get(se);const de=m[se];if(de.length===0){const j={dest:0,deviation:0,base:0,delta:0};return ge.set(se,j),j}const ae=g[de[0]].pipe.coord;let he=ae;for(let j=1;jMath.abs(Oe-ae)?X:Oe;break}}const W=Math.abs(he-ae),ne={dest:he,deviation:W,base:ae,delta:he-ae};return ge.set(se,ne),ne},"getDestInfo"),Re=x(()=>{let se=0;const de=new Map;for(const[ae,he]of i.entries())m[ae].length!==0&&he.start&&(de.has(he.start)||de.set(he.start,[]),de.get(he.start).push(ae));const Te=x(ae=>{const he=i[ae];if(!he.start||!he.end)return 0;const W=a.get(he.start),ne=a.get(he.end);if(!W||!ne)return 0;const j=(ne.x??0)-(W.x??0),ue=(ne.y??0)-(W.y??0);return Math.abs(j)+Math.abs(ue)},"getEdgeDistance");for(const ae of de.values()){ae.sort((W,ne)=>{const j=ee(W),ue=ee(ne);if(Math.abs(j.deviation-ue.deviation)>1)return j.deviation-ue.deviation;if(Math.abs(j.dest-ue.dest)>1)return j.dest-ue.dest;const X=Te(W),Oe=Te(ne);if(Math.abs(X-Oe)>1)return Oe-X;const xe=m[W].length,Ge=m[ne].length;if(xe!==Ge)return xe-Ge;if(xe===1){const _e=m[W][0],$e=m[ne][0];if(g[_e]&&g[$e]){const Me=g[_e],He=g[$e],De=Math.abs(Me.to-Me.from),Ke=Math.abs(He.to-He.from);if(Math.abs(De-Ke)>1)return De-Ke}}return 0});const he=ae.map(W=>g[m[W][0]]);se+=J(he)}return se},"fixSourceHandleCrossings"),Ie=x(()=>{let se=0;const de=new Map;for(const[Te,ae]of i.entries())m[Te].length!==0&&ae.end&&(de.has(ae.end)||de.set(ae.end,[]),de.get(ae.end).push(Te));for(const Te of de.values()){Te.sort((he,W)=>{const ne=x(X=>{const Oe=m[X];if(Oe.length<2)return 0;const xe=g[Oe[Oe.length-2]];return Math.abs(xe.to-xe.from)},"getDist"),j=ne(he),ue=ne(W);return Math.abs(j-ue)>.1?j-ue:he-W});const ae=Te.map(he=>g[m[he][m[he].length-1]]);se+=J(ae)}return se},"fixTargetHandleCrossings"),Be=x(()=>{let se=0;for(const de of o){const Te=[];for(const ae of de.tracks)for(const he of ae.segments){const W=m[he.edgeIndex].find(ne=>g[ne].segmentIndex===he.segmentIndex);W!==void 0&&Te.push(g[W])}Te.sort((ae,he)=>ae.edgeIndex-he.edgeIndex||ae.segmentIndex-he.segmentIndex);for(let ae=0;ae{ae.segments.forEach(he=>{de.push({edgeIndex:he.edgeIndex,segmentIndex:he.segmentIndex,trackIndex:ae.index,from:he.from,to:he.to})})}),de.sort((ae,he)=>ae.from-he.from);const Te=[];if(de.length>0){let ae=[de[0]],he=de[0].to;for(let W=1;Whe.add(_e.trackIndex));const W=new Map;ae.forEach(_e=>{const $e=ee(_e.edgeIndex);W.set(_e.trackIndex,(W.get(_e.trackIndex)??0)+$e.delta)});const ne=[...he].filter(_e=>(W.get(_e)??0)<-1),j=[...he].filter(_e=>(W.get(_e)??0)>1),ue=[...he].filter(_e=>Math.abs(W.get(_e)??0)<=1);ne.sort((_e,$e)=>(W.get($e)??0)-(W.get(_e)??0)),j.sort((_e,$e)=>(W.get(_e)??0)-(W.get($e)??0));const X=x((_e,$e)=>{ae.filter(Me=>Me.trackIndex===_e).forEach(Me=>{const He=y.has(Me.edgeIndex)?se.coord:$e;be.set(`${Me.edgeIndex}-${Me.segmentIndex}`,He)})},"assignCoord");let Oe=0;for(const _e of ne)Oe++,X(_e,se.coord-Oe*MI);if(ue.length===0&&he.size>0){const _e=[...he].sort((He,De)=>Math.abs(W.get(He)??0)-Math.abs(W.get(De)??0))[0],$e=ne.indexOf(_e);$e!==-1&&ne.splice($e,1);const Me=j.indexOf(_e);Me!==-1&&j.splice(Me,1),ue.push(_e)}let xe=0;for(const _e of ue){if(xe===0)X(_e,se.coord);else{const $e=xe%2===1?1:-1,Me=Math.ceil(xe/2);X(_e,se.coord+$e*Me*MI*.5)}xe++}let Ge=0;for(const _e of j)Ge++,X(_e,se.coord+Ge*MI)}}for(const[se,de]of i.entries()){const Te=m[se]??[];if(Te.length===0)continue;const ae=[],he=a.get(de.start),W=a.get(de.end),{pSrcPort:ne,pDstPort:j}=V(se,he,W),ue=Te.map(xe=>{const Ge=g[xe],_e=be.get(`${Ge.edgeIndex}-${Ge.segmentIndex}`)??Ge.pipe.coord;return{orient:Ge.orientation,coord:_e,from:Ge.from,to:Ge.to}});ae.push(ne);for(let xe=0;xeFr&&ae.push(lp(Ge,$e)),De&&He.orient===Ge.orient)if(Math.abs(Ge.coord-He.coord)>Fr){const Ke=Ge.orient==="vertical"?($e+He.from)/2:J$(Ge,He);ae.push(lp(Ge,Ke),lp(He,Ke))}else(xe===0||xe===ue.length-2)&&ae.push(lp(Ge,J$(Ge,He)));else if(De)ae.push(lp(Ge,He.coord));else{const Ke=Math.abs(Ge.from-$e)Fr||Math.abs(X.y-j.y)>Fr)&&ae.push(j);const Oe=[];ae.length>0&&Oe.push(ae[0]);for(let xe=1;xeFr||Math.abs(Ge.y-_e.y)>Fr)&&Oe.push(Ge)}de.points=Oe}for(const se of i){const de=se.__originalEdge;de&&se.points&&(de.points=se.points)}t.edges=(t.edges??[]).filter(se=>!se.isLayoutOnly);const fe=x((se,de)=>{const Te=de.x??0,ae=de.y??0,he=de.width??0,W=de.height??0;if(he<=0||W<=0)return se;const ne=Te-he/2,j=Te+he/2,ue=ae-W/2,X=ae+W/2;if(se.xj||se.yX)return se;const Oe=se.x-ne,xe=j-se.x,Ge=se.y-ue,_e=X-se.y,$e=Math.min(Oe,xe,Ge,_e);return $e===Oe?{x:ne,y:se.y}:$e===xe?{x:j,y:se.y}:$e===Ge?{x:se.x,y:ue}:{x:se.x,y:X}},"nodeBoundaryClamp");for(const se of t.edges){const de=se.points;if(!de||de.length<2)continue;const Te=se.start,ae=se.end,he=Te?a.get(Te):void 0,W=ae?a.get(ae):void 0;he&&(de[0]=fe(de[0],he)),W&&(de[de.length-1]=fe(de[de.length-1],W))}return t}x(G1e,"routeEdgesOrthogonal");function W1e(t){return t.direction??"TB"}x(W1e,"getSwimlaneDirection");function H1e(t){var h,d,f,p,g;const e=Eye(t),r=((h=t.config.flowchart)==null?void 0:h.nodeSpacing)??40,n=((d=t.config.flowchart)==null?void 0:d.rankSpacing)??100,i=((f=t.config.swimlane)==null?void 0:f.ignoreCrossLaneEdges)??!0,a=((p=t.config.swimlane)==null?void 0:p.optimizeRanksByCrossings)??!0,s=((g=t.config.swimlane)==null?void 0:g.automaticLaneOrdering)??!1,o=W1e(t),{ordered:l,coordinates:u}=V1e(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:s,direction:o});Aye(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;G1e(t,o);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return a1e(t,o),i1e(t),o}x(H1e,"runSwimlaneLayoutCore");async function q1e(t,e){const r=e.select("g");LV(r,t.markers,t.type,t.diagramId),Bpe(),zpe(),yfe(),Wme(),Sye(t);const n=_ye(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await hye(r,t);H1e(t),await wye(t,i)}x(q1e,"render");const vut=Object.freeze(Object.defineProperty({__proto__:null,render:q1e},Symbol.toStringTag,{value:"Module"}));function eP(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw a}}}}function U1e(t,e,r){return(e=Y1e(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wut(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Cut(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function kut(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sut(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zi(t,e){return but(t)||Cut(t,e)||FG(t,e)||kut()}function u_(t){return xut(t)||wut(t)||FG(t)||Sut()}function Eut(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Y1e(t){var e=Eut(t,"string");return typeof e=="symbol"?e:e+""}function ca(t){"@babel/helpers - typeof";return ca=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ca(t)}function FG(t,e){if(t){if(typeof t=="string")return eP(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?eP(t,e):void 0}}var ra=typeof window>"u"?null:window,jQ=ra?ra.navigator:null;ra&&ra.document;var Aut=ca(""),X1e=ca({}),_ut=ca(function(){}),Rut=typeof HTMLElement>"u"?"undefined":ca(HTMLElement),hS=function(e){return e&&e.instanceString&&gi(e.instanceString)?e.instanceString():null},or=function(e){return e!=null&&ca(e)==Aut},gi=function(e){return e!=null&&ca(e)===_ut},Nn=function(e){return!Po(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},ln=function(e){return e!=null&&ca(e)===X1e&&!Nn(e)&&e.constructor===Object},Lut=function(e){return e!=null&&ca(e)===X1e},Dt=function(e){return e!=null&&ca(e)===ca(1)&&!isNaN(e)},Mut=function(e){return Dt(e)&&Math.floor(e)===e},h_=function(e){if(Rut!=="undefined")return e!=null&&e instanceof HTMLElement},Po=function(e){return dS(e)||j1e(e)},dS=function(e){return hS(e)==="collection"&&e._private.single},j1e=function(e){return hS(e)==="collection"&&!e._private.single},zG=function(e){return hS(e)==="core"},K1e=function(e){return hS(e)==="stylesheet"},Iut=function(e){return hS(e)==="event"},lf=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Nut=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Dut=function(e){return ln(e)&&Dt(e.x1)&&Dt(e.x2)&&Dt(e.y1)&&Dt(e.y2)},Out=function(e){return Lut(e)&&gi(e.then)},$ut=function(){return jQ&&jQ.userAgent.match(/msie|trident|edge/i)},Wb=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;sr?1:0},Wut=function(e,r){return-1*Q1e(e,r)},dr=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(y-=1),y<1/6?g+(m-g)*6*y:y<1/2?m:y<2/3?g+(m-g)*(2/3-y)*6:g}var d=new RegExp("^"+Fut+"$").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)o=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;o=Math.round(255*h(p,f,n+1/3)),l=Math.round(255*h(p,f,n)),u=Math.round(255*h(p,f,n-1/3))}r=[o,l,u,s]}return r},Uut=function(e){var r,n=new RegExp("^"+Put+"$").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 o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},Yut=function(e){return Xut[e.toLowerCase()]},J1e=function(e){return(Nn(e)?e:null)||Yut(e)||Hut(e)||Uut(e)||qut(e)},Xut={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]},eve=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||R<0||T&&I>=f}function E(){var D=e();if(k(D))return _(D);g=setTimeout(E,S(D))}function _(D){return g=void 0,b&&h?w(D):(h=d=void 0,p)}function M(){g!==void 0&&clearTimeout(g),y=0,h=m=d=g=void 0}function L(){return g===void 0?p:_(e())}function P(){var D=e(),R=k(D);if(h=arguments,d=this,m=D,R){if(g===void 0)return C(m);if(T)return clearTimeout(g),g=setTimeout(E,l),w(m)}return g===void 0&&(g=setTimeout(E,l)),p}return P.cancel=M,P.flush=L,P}return qI=s,qI}var iht=nht(),mS=fS(iht),UI=ra?ra.performance:null,nve=UI&&UI.now?function(){return UI.now()}:function(){return Date.now()},aht=(function(){if(ra){if(ra.requestAnimationFrame)return function(t){ra.requestAnimationFrame(t)};if(ra.mozRequestAnimationFrame)return function(t){ra.mozRequestAnimationFrame(t)};if(ra.webkitRequestAnimationFrame)return function(t){ra.webkitRequestAnimationFrame(t)};if(ra.msRequestAnimationFrame)return function(t){ra.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(nve())},1e3/60)}})(),d_=function(e){return aht(e)},Th=nve,Ep=9261,ive=65599,Tm=5381,ave=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ep,n=r,i;i=e.next(),!i.done;)n=n*ive+i.value|0;return n},JC=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ep;return r*ive+e|0},ek=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tm;return(r<<5)+r+e|0},sht=function(e,r){return e*2097152+r},ad=function(e){return e[0]*2097152+e[1]},YE=function(e,r){return[JC(e[0],r[0]),ek(e[1],r[1])]},hJ=function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},qG=function(e){e.splice(0,e.length)},mht=function(e,r){for(var n=0;n"u"?"undefined":ca(Set))!==vht?Set:bht,iL=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!zG(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 Rx,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,o=e.pan(),l=e.zoom();a.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];Nn(r.classes)?u=r.classes:or(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hT?1:0},h=function(v,T,b,w,C){var S;if(b==null&&(b=0),C==null&&(C=n),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=v.length);bM;0<=M?_++:_--)E.push(_);return E}).apply(this).reverse(),k=[],w=0,C=S.length;wL;0<=L?++E:--E)P.push(s(v,b));return P},m=function(v,T,b,w){var C,S,k;for(w==null&&(w=n),C=v[b];b>T;){if(k=b-1>>1,S=v[k],w(C,S)<0){v[b]=S,b=k;continue}break}return v[b]=C},y=function(v,T,b){var w,C,S,k,E;for(b==null&&(b=n),C=v.length,E=T,S=v[T],w=2*T+1;w0;){var S=T.pop(),k=y(S),E=S.id();if(f[E]=k,k!==1/0)for(var _=S.neighborhood().intersect(g),M=0;M<_.length;M++){var L=_[M],P=L.id(),D=C(S,L),R=k+D.dist;R0)for(N.unshift(O);d[z];){var V=d[z];N.unshift(V.edge),N.unshift(V.node),F=V.node,z=F.id()}return o.spawn(N)}}}},Eht={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),o=n,l=function(w){for(var C=0;C0;){if(C(),k++,w===h){for(var E=[],_=a,M=h,L=v[M];E.unshift(_),L!=null&&E.unshift(L),_=y[M],_!=null;)M=_.id(),L=v[M];return{found:!0,distance:d[w],path:this.spawn(E),steps:k}}p[w]=!0;for(var P=b._private.edges,D=0;DL&&(g[M]=L,T[M]=_,b[M]=C),!a){var P=_*h+E;!a&&g[P]>L&&(g[P]=L,T[P]=E,b[P]=C)}}}for(var D=0;D1&&arguments[1]!==void 0?arguments[1]:s,be=b(ce),fe=[],Pe=be;;){if(Pe==null)return r.spawn();var ve=T(Pe),Ce=ve.edge,Ve=ve.pred;if(fe.unshift(Pe[0]),Pe.same(oe)&&fe.length>0)break;Ce!=null&&fe.unshift(Ce),Pe=Ve}return l.spawn(fe)},S=0;S=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===o&&r[p]===l||r[f]===l&&r[p]===o)&&u.splice(h,1)}for(var g=0;gi;){var a=Math.floor(Math.random()*r.length);r=Dht(a,e,r),n--}return r},Oht={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(N){return N.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/Nht);if(a<2){oi("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=r;a1&&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;s1&&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):(n0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}a&&e.sort(function(f,p){return f-p});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},Vht=function(e){return Math.PI*e/180},XE=function(e,r){return Math.atan2(r,e)-Math.PI/2},UG=Math.log2||function(t){return Math.log(t)/Math.log(2)},YG=function(e){return e>0?1:e<0?-1:0},V0=function(e,r){return Math.sqrt(cp(e,r))},cp=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},Ght=function(e){for(var r=e.length,n=0,i=0;i=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}}},Hht=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},qht=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Uht=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},dve=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},o3=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},l3=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 o=zi(r,4);n=o[0],i=o[1],a=o[2],s=o[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},yJ=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},XG=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},Dd=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},vJ=function(e,r){return Dd(e,r.x,r.y)},fve=function(e,r){return Dd(e,r.x1,r.y1)&&Dd(e,r.x2,r.y2)},Yht=(jI=Math.hypot)!==null&&jI!==void 0?jI:function(t,e){return Math.sqrt(t*t+e*e)};function Xht(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(E,_){return{x:E.x+_.x,y:E.y+_.y}},n=function(E,_){return{x:E.x-_.x,y:E.y-_.y}},i=function(E,_){return{x:E.x*_,y:E.y*_}},a=function(E,_){return E.x*_.y-E.y*_.x},s=function(E){var _=Yht(E.x,E.y);return _===0?{x:0,y:0}:{x:E.x/_,y:E.y/_}},o=function(E){for(var _=0,M=0;M7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?uf(a,s):l,h=a/2,d=s/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-o,y=i-d-o,v=n+h-u+o,T=y;if(g=Od(e,r,n,i,m,y,v,T,!1),g.length>0)return g}if(p){var b=n+h+o,w=i-d+u-o,C=b,S=i+d-u+o;if(g=Od(e,r,n,i,b,w,C,S,!1),g.length>0)return g}if(f){var k=n-h+u-o,E=i+d+o,_=n+h-u+o,M=E;if(g=Od(e,r,n,i,k,E,_,M,!1),g.length>0)return g}if(p){var L=n-h-o,P=i-d+u-o,D=L,R=i+d-u+o;if(g=Od(e,r,n,i,L,P,D,R,!1),g.length>0)return g}var I;{var $=n-h+u,O=i-d+u;if(I=JT(e,r,n,i,$,O,u+o),I.length>0&&I[0]<=$&&I[1]<=O)return[I[0],I[1]]}{var N=n+h-u,F=i-d+u;if(I=JT(e,r,n,i,N,F,u+o),I.length>0&&I[0]>=N&&I[1]<=F)return[I[0],I[1]]}{var z=n+h-u,V=i+d-u;if(I=JT(e,r,n,i,z,V,u+o),I.length>0&&I[0]>=z&&I[1]>=V)return[I[0],I[1]]}{var B=n-h+u,G=i+d-u;if(I=JT(e,r,n,i,B,G,u+o),I.length>0&&I[0]<=B&&I[1]>=G)return[I[0],I[1]]}return[]},Kht=function(e,r,n,i,a,s,o){var l=o,u=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,s),f=Math.max(i,s);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},Zht=function(e,r,n,i,a,s,o,l,u){var h={x1:Math.min(n,o,a)-u,x2:Math.max(n,o,a)+u,y1:Math.min(i,l,s)-u,y2:Math.max(i,l,s)+u};return!(eh.x2||rh.y2)},Qht=function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var s=Math.sqrt(a),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},Jht=function(e,r,n,i,a){var s=1e-5;e===0&&(e=s),r/=e,n/=e,i/=e;var o,l,u,h,d,f,p,g;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,a[1]=0,p=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),a[0]=-p+d+f,p+=(d+f)/2,a[4]=a[2]=-p,p=Math.sqrt(3)*(-f+d)/2,a[3]=p,a[5]=-p;return}if(a[5]=a[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),a[0]=-p+2*g,a[4]=a[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),a[0]=-p+g*Math.cos(h/3),a[2]=-p+g*Math.cos((h+2*Math.PI)/3),a[4]=-p+g*Math.cos((h+4*Math.PI)/3)},edt=function(e,r,n,i,a,s,o,l){var u=1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+i*i-4*i*s+2*i*l+4*s*s-4*s*l+l*l,h=9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*i*s-3*i*i-3*i*l-6*s*s+3*s*l,d=3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*i*i-6*i*s+i*l-i*r+2*s*s+2*s*r-l*r,f=1*n*a-n*n+n*e-a*e+i*s-i*i+i*r-s*r,p=[];Jht(u,h,d,f,p);for(var g=1e-7,m=[],y=0;y<6;y+=2)Math.abs(p[y+1])=0&&p[y]<=1&&m.push(p[y]);m.push(1),m.push(0);for(var v=-1,T,b,w,C=0;C=0?wu?(e-a)*(e-a)+(r-s)*(r-s):h-f},fo=function(e,r,n){for(var i,a,s,o,l,u=0,h=0;h=e&&e>=s||i<=e&&e<=s)l=(e-i)/(s-i)*(o-a)+a,l>r&&u++;else continue;return u%2!==0},wh=function(e,r,n,i,a,s,o,l,u){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),p=Math.sin(-d),g=0;g0){var y=g_(h,-u);m=p_(y)}else m=h;return fo(e,r,m)},rdt=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h=0&&y<=1&&T.push(y),v>=0&&v<=1&&T.push(v),T.length===0)return[];var b=T[0]*l[0]+e,w=T[0]*l[1]+r;if(T.length>1){if(T[0]==T[1])return[b,w];var C=T[1]*l[0]+e,S=T[1]*l[1]+r;return[b,w,C,S]}else return[b,w]},KI=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Od=function(e,r,n,i,a,s,o,l,u){var h=e-a,d=n-e,f=o-a,p=r-s,g=i-r,m=l-s,y=f*p-m*h,v=d*p-g*h,T=m*d-f*g;if(T!==0){var b=y/T,w=v/T,C=.001,S=0-C,k=1+C;return S<=b&&b<=k&&S<=w&&w<=k?[e+b*d,r+b*g]:u?[e+b*d,r+b*g]:[]}else return y===0||v===0?KI(e,n,o)===o?[o,l]:KI(e,n,a)===a?[a,s]:KI(a,o,n)===n?[n,i]:[]:[]},idt=function(e,r,n,i,a){var s=[],o=i/2,l=a/2,u=r,h=n;s.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d0){var m=g_(d,-l);p=p_(m)}else p=d}else p=n;for(var y,v,T,b,w=0;w2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),y=1;yh&&(h=w)},get:function(b){return u[b]}},f=0;f0?I=R.edgesTo(D)[0]:I=D.edgesTo(R)[0];var $=i(I);D=D.id(),k[D]>k[L]+$&&(k[D]=k[L]+$,E.nodes.indexOf(D)<0?E.push(D):E.updateItem(D),S[D]=0,C[D]=[]),k[D]==k[L]+$&&(S[D]=S[D]+S[L],C[D].push(L))}else for(var O=0;O0;){for(var V=w.pop(),B=0;B0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},bdt=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:wdt,o=i,l,u,h=0;h=2?dT(e,r,n,0,CJ,Cdt):dT(e,r,n,0,wJ)},squaredEuclidean:function(e,r,n){return dT(e,r,n,0,CJ)},manhattan:function(e,r,n){return dT(e,r,n,0,wJ)},max:function(e,r,n){return dT(e,r,n,-1/0,kdt)}};Hb["squared-euclidean"]=Hb.squaredEuclidean;Hb.squaredeuclidean=Hb.squaredEuclidean;function sL(t,e,r,n,i,a){var s;return gi(t)?s=t:s=Hb[t]||Hb.euclidean,e===0&&gi(t)?s(i,a):s(e,r,n,i,a)}var Sdt=ts({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),KG=function(e){return Sdt(e)},m_=function(e,r,n,i,a){var s=a!=="kMedoids",o=s?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return sL(e,i.length,o,l,u,h)},QI=function(e,r,n){for(var i=n.length,a=new Array(i),s=new Array(i),o=new Array(r),l=null,u=0;un)return!1}return!0},_dt=function(e,r,n){for(var i=0;io&&(o=r[u][h],l=h);a[l].push(e[u])}for(var d=0;d=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],m=r[i[s]],y;a.mode==="dendrogram"?y={left:g,right:m,key:g.key}:y={value:g.value.concat(m.value),key:g.key},e[g.index]=y,e.splice(m.index,1),r[g.key]=y;for(var v=0;vn[m.key][T.key]&&(l=n[m.key][T.key])):a.linkage==="max"?(l=n[g.key][T.key],n[g.key][T.key]0&&i.push(a);return i},RJ=function(e,r,n){for(var i=[],a=0;ao&&(s=u,o=r[a*e+u])}s>0&&i.push(s)}for(var h=0;hu&&(l=h,u=d)}n[a]=s[l]}return i=RJ(e,r,n),i},LJ=function(e){for(var r=this.cy(),n=this.nodes(),i=zdt(e),a={},s=0;s=L?(P=L,L=R,D=I):R>P&&(P=R);for(var $=0;$0?1:0;k[_%i.minIterations*o+B]=G,V+=G}if(V>0&&(_>=i.minIterations-1||_==i.maxIterations-1)){for(var H=0,q=0;q1||S>1)&&(o=!0),d[b]=[],T.outgoers().forEach(function(E){E.isEdge()&&d[b].push(E.id())})}else f[b]=[void 0,T.target().id()]}):s.forEach(function(T){var b=T.id();if(T.isNode()){var w=T.degree(!0);w%2&&(l?u?o=!0:u=b:l=b),d[b]=[],T.connectedEdges().forEach(function(C){return d[b].push(C.id())})}else f[b]=[T.source().id(),T.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(a){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=s[0].id());var g=function(b){for(var w=b,C=[b],S,k,E;d[w].length;)S=d[w].shift(),k=f[S][0],E=f[S][1],w!=E?(d[E]=d[E].filter(function(_){return _!=S}),w=E):!a&&w!=k&&(d[k]=d[k].filter(function(_){return _!=S}),w=k),C.unshift(S),C.unshift(w);return C},m=[],y=[];for(y=g(h);y.length!=1;)d[y[0]].length==0?(m.unshift(s.getElementById(y.shift())),m.unshift(s.getElementById(y.shift()))):y=g(y.shift()).concat(y);m.unshift(s.getElementById(y.shift()));for(var v in d)if(d[v].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},KE=function(){var e=this,r={},n=0,i=0,a=[],s=[],o={},l=function(f,p){for(var g=s.length-1,m=[],y=e.spawn();s[g].x!=f||s[g].y!=p;)m.push(s.pop().edge),g--;m.push(s.pop().edge),m.forEach(function(v){var T=v.connectedNodes().intersection(e);y.merge(v),T.forEach(function(b){var w=b.id(),C=b.connectedEdges().intersection(e);y.merge(b),r[w].cutVertex?y.merge(C.filter(function(S){return S.isLoop()})):y.merge(C)})}),a.push(y)},u=function(f,p,g){f===g&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var m=e.getElementById(p).connectedEdges().intersection(e);if(m.size()===0)a.push(e.spawn(e.getElementById(p)));else{var y,v,T,b;m.forEach(function(w){y=w.source().id(),v=w.target().id(),T=y===p?v:y,T!==g&&(b=w.id(),o[b]||(o[b]=!0,s.push({x:p,y:T,edge:w})),T in r?r[p].low=Math.min(r[p].low,r[T].id):(u(f,T,p),r[p].low=Math.min(r[p].low,r[T].low),r[p].id<=r[T].low&&(r[p].cutVertex=!0,l(p,T))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var h=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:a}},Xdt={hopcroftTarjanBiconnected:KE,htbc:KE,htb:KE,hopcroftTarjanBiconnectedComponents:KE},ZE=function(){var e=this,r={},n=0,i=[],a=[],s=e.spawn(e),o=function(u){a.push(u),r[u]={index:n,low:n++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var y=m.target().id();y!==u&&(y in r||o(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=a.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=d.edgesWith(d),g=d.merge(p);i.push(g),s=s.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:i}},jdt={tarjanStronglyConnected:ZE,tsc:ZE,tscc:ZE,tarjanStronglyConnectedComponents:ZE},Tve={};[tk,Sht,Eht,_ht,Lht,Iht,Oht,ldt,xy,Ty,nP,Tdt,Ddt,Bdt,qdt,Ydt,Xdt,jdt].forEach(function(t){dr(Tve,t)});/*! +Parent cluster`,i.height),e.setNode(i.id,w),e.parent(T)||(le.trace("Setting parent",T,i.id),e.setParent(T,i.id,w))}if(le.info("(Insert) Node XXX"+T+": "+JSON.stringify(e.node(T))),b!=null&&b.clusterNode){le.info("Cluster identified XBX",T,b.width,e.node(T));const{ranksep:w,nodesep:C}=e.graph();b.graph.setGraph({...b.graph.graph(),ranksep:w+25,nodesep:C});const S=await hye(d,b.graph,r,n,e.node(T),a),k=S.elem;Kt(b,k),b.diff=S.diff||0,le.info("New compound node after recursive render XAX",T,"width",b.width,"height",b.height),tKe(k,b)}else e.children(T).length>0?(le.trace("Cluster - the non recursive path XBX",T,b.id,b,b.width,"Graph:",e),le.trace(zb(b.id,e)),Lr.set(b.id,{id:zb(b.id,e),node:b})):(le.trace("Node - the non recursive path XAX",T,d,e.node(T),s),await rS(d,e.node(T),{config:a,dir:s}))})),await x(async()=>{const T=e.edges().map(async function(b){const w=e.edge(b.v,b.w,b.name);if(le.info("Edge "+b.v+" -> "+b.w+": "+JSON.stringify(b)),le.info("Edge "+b.v+" -> "+b.w+": ",b," ",JSON.stringify(e.edge(b))),le.info("Fix",Lr,"ids:",b.v,b.w,"Translating: ",Lr.get(b.v),Lr.get(b.w)),f&&w.selfLoop){if(w.selfLoop.order!==1)return;const C=w.id;w.id=w.selfLoop.id,await zA(h,w),w.id=C;return}await zA(h,w)});await Promise.all(T)},"processEdges")(),le.info("Graph before layout:",JSON.stringify(fh(e))),le.info("############################################# XXX"),le.info("### Layout ### XXX"),le.info("############################################# XXX"),cye(e),le.info("Graph after layout:",JSON.stringify(fh(e)));let g=0,{subGraphTitleTotalMargin:m}=vx(a);await Promise.all(glt(e).map(async function(T){var w;const b=e.node(T);if(le.info("Position XBX => "+T+": ("+b.x,","+b.y,") width: ",b.width," height: ",b.height),b!=null&&b.clusterNode)b.y+=m,le.info("A tainted cluster node XBX1",T,b.id,b.width,b.height,b.x,b.y,e.parent(T)),Lr.get(b.id).node=b,FA(b);else if(e.children(T).length>0){le.info("A pure cluster node XBX1",T,b.id,b.x,b.y,b.width,b.height,e.parent(T)),b.height+=m,e.node(b.parentId);const C=(b==null?void 0:b.padding)/2||0,S=((w=b==null?void 0:b.labelBBox)==null?void 0:w.height)||0,k=S-C||0;le.debug("OffsetY",k,"labelHeight",S,"halfPadding",C),await xR(l,b),Lr.get(b.id).node=b}else{const C=e.node(b.parentId);b.y+=m/2,le.info("A regular node XBX1 - using the padding",b.id,"parent",b.parentId,b.width,b.height,b.x,b.y,"offsetY",b.offsetY,"parent",C,C==null?void 0:C.offsetY,b),FA(b)}}));const y=m/2;return uye(e,y,{mergeSelfLoops:f}).forEach(function({edge:T,start:b,end:w}){le.info("Edge "+b+" -> "+w+": "+JSON.stringify(T),T),T.points.forEach(E=>E.y+=y);const C=e.node(b),S=e.node(w),k=RV(u,T,Lr,r,C,S,n);Gpe(T,k)}),e.nodes().forEach(function(T){const b=e.node(T);le.info(T,b.type,b.diff),b.isGroup&&(g=b.diff)}),le.warn("Returning from recursive render XAX",o,g),{elem:o,diff:g}},"recursiveRender"),lut=x(async(t,e)=>{var a,s,o,l,u,h;const r=new ms({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((a=t.config)==null?void 0:a.nodeSpacing)||((o=(s=t.config)==null?void 0:s.flowchart)==null?void 0:o.nodeSpacing)||t.nodeSpacing,ranksep:((l=t.config)==null?void 0:l.rankSpacing)||((h=(u=t.config)==null?void 0:u.flowchart)==null?void 0:h.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");LV(n,t.markers,t.type,t.diagramId),Fpe(),Vpe(),vfe(),Hme(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),le.debug("Edges:",t.edges),t.edges.forEach(d=>{if(d.start===d.end){const f=d.start,p=f+"---"+f+"---1",g=f+"---"+f+"---2",m=r.node(f);r.setNode(p,{domId:p,id:p,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(p,m.parentId),r.setNode(g,{domId:g,id:g,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,m.parentId);const y=structuredClone(d),v=structuredClone(d),T=structuredClone(d),b=structuredClone(d);v.originalEdge=y,v.selfLoop={id:y.id,order:0},T.originalEdge=y,T.selfLoop={id:y.id,order:1},b.originalEdge=y,b.selfLoop={id:y.id,order:2},v.label="",v.arrowTypeEnd="none",v.endLabelLeft="",v.endLabelRight="",v.startLabelLeft="",v.id=f+"-cyclic-special-1",T.startLabelRight="",T.startLabelLeft="",T.endLabelLeft="",T.endLabelRight="",T.arrowTypeStart="none",T.arrowTypeEnd="none",T.id=f+"-cyclic-special-mid",b.label="",b.startLabelRight="",b.startLabelLeft="",b.arrowTypeStart="none",m.isGroup&&(v.fromCluster=f,b.toCluster=f),b.id=f+"-cyclic-special-2",b.arrowTypeStart="none",r.setEdge(f,p,v,f+"-cyclic-special-0"),r.setEdge(p,g,T,f+"-cyclic-special-1"),r.setEdge(g,f,b,f+"-cyclic-special-2")}else r.setEdge(d.start,d.end,{...d},d.id)}),le.warn("Graph at first:",JSON.stringify(fh(r))),plt(r),le.warn("Graph after XAX:",JSON.stringify(fh(r)));const i=Fe();await hye(n,r,t.type,t.diagramId,void 0,i)},"render");const cut=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:uye,render:lut},Symbol.toStringTag,{value:"Module"}));async function dye(t,e){const r=new ms({multigraph:!0,compound:!0}),n=[...e.edges],i=Fe(),a=t.insert("g").attr("class","root"),s=a.insert("g").attr("class","clusters"),o=a.insert("g").attr("class","edges edgePath"),l=a.insert("g").attr("class","edgeLabels"),u=a.insert("g").attr("class","nodes"),h=new Map,d=t.node()!=null;await Promise.all(e.nodes.map(async f=>{var p;if(f.isGroup)r.setNode(f.id,{...f});else{if(d){const g=await rS(u,f,{config:i,dir:f.dir}),m=((p=g.node())==null?void 0:p.getBBox())??{width:0,height:0};h.set(f.id,g),f.width=m.width,f.height=m.height}r.setNode(f.id,{...f})}}));for(const f of n)r.setEdge(f.start,f.end,{...f},f.id),e.edges.some(g=>g.id===f.id)||e.edges.push(f);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:f}=await tr(async()=>{const{captureNodeSizes:p}=await Promise.resolve().then(()=>cPt);return{captureNodeSizes:p}},void 0,import.meta.url);f(t,e)}return{graph:r,groups:{clusters:s,edgePaths:o,edgeLabels:l,nodes:u,rootGroups:a},nodeElements:h}}x(dye,"createGraphWithElements");var HQ=5,VE=1e-5,GE=1e-6;function e_(t){const e=[];for(let r=0;r=1-GE||f<=GE||f>=1-GE?null:{point:{x:t.x+d*i,y:t.y+d*a},tA:d,tB:f}}x(fye,"segmentIntersection");function T$(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}x(T$,"isHorizontalSeg");function pye(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}x(gye,"getArcSweepFlag");var uut=.001;function mye(t,e){if(t.length<2)return t.map(a=>({...a}));const r=t.map(a=>({...a})),n=e.arrowTypeStart&&ya[e.arrowTypeStart];if(n){const a=t[0],s=t[1],o=Math.atan2(s.y-a.y,s.x-a.x);r[0].x=a.x+n*Math.cos(o),r[0].y=a.y+n*Math.sin(o)}const i=e.arrowTypeEnd&&ya[e.arrowTypeEnd];if(i){const a=t.length,s=t[a-2],o=t[a-1],l=Math.atan2(o.y-s.y,o.x-s.x);r[a-1].x=o.x-i*Math.cos(l),r[a-1].y=o.y-i*Math.sin(l)}return r}x(mye,"applyMarkerOffsets");function yye(t,e,r,n,i){const a=t.point.x,s=t.point.y,o={x:a-e*t.r,y:s-r*t.r},l={x:a+e*t.r,y:s+r*t.r},u=[`L${yy(o)}`];return i==="arc"?u.push(`A${Vl(t.r)},${Vl(t.r)} 0 0 ${n} ${yy(l)}`):u.push(`M${yy(l)}`),u}x(yye,"emitJump");function w$(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=r.x-e.x,o=r.y-e.y,l=Math.hypot(i,a),u=Math.hypot(s,o);if(l0){const b=w$(i[u-1],i[u],i[u+1]??i[u],HQ);b&&(m=b.cutLen)}let y=d,v=null;a&&ub.t-w.t);for(const b of T)b.r=Math.min(b.r,b.d-m,y-b.d);for(let b=0;bw){const C=w/2;T[b].r=Math.min(T[b].r,C),T[b+1].r=Math.min(T[b+1].r,C)}}for(const b of T)b.r=2?n:null}catch{return null}}x(Tye,"decodeDataPoints");function wye(t,e,r){if(!r.enabled)return;const n=t.node();if(!n)return;const i=new Map;for(const u of e)i.set(u.id,u);const a=[],s=new Map;for(const u of e){const h=typeof CSS<"u"&&CSS.escape?CSS.escape(u.id):u.id,d=n.querySelector(`path[data-id="${h}"]`);if(!d)continue;s.set(u.id,d);const p=Tye(d.getAttribute("data-points"))??u.points;a.push({...u,points:p})}const o=pye(a);if(o.length===0)return;const l=new Map;for(const u of o){const h=l.get(u.jumpEdgeId)??[];h.push(u),l.set(u.jumpEdgeId,h)}for(const u of a){const h=l.get(u.id);if(!h||h.length===0)continue;const d=i.get(u.id),f=d==null?void 0:d.curve;if(f!==void 0&&!xye(f))continue;const p=s.get(u.id);if(!p)continue;if(f===void 0){const b=p.getAttribute("d")??"";if(!bye(b))continue}const g=p.getAttribute("style")??"",m=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(g),y=m?Number.parseFloat(m[1]):null,v=m?Number.parseFloat(m[2]):null,T=vye(u,h,r);if(p.setAttribute("d",T),y!==null&&v!==null&&typeof p.getTotalLength=="function"){const b=p.getTotalLength(),w=Math.max(0,b-y-v),C=`0 ${y} ${w} ${v}`,S=g.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${C};`).replace(/;\s*;+/g,";");p.setAttribute("style",S)}}}x(wye,"applyLineJumpsToSvg");async function Cye(t,e){var i,a;for(const s of t.nodes)s.isGroup?await xR(e.clusters,s):FA(s);const r=new Map;for(const s of t.nodes)s!=null&&s.id&&r.set(s.id,s);for(const s of t.edges){const o=s.start?r.get(s.start)??{}:{},l=s.end?r.get(s.end)??{}:{},u=RV(e.edgePaths,{...s},{},t.type,o,l,t.diagramId);s.label&&await zA(e.rootGroups,s),s.label&&kye(s,u)}const n=(a=(i=t.config)==null?void 0:i.swimlane)==null?void 0:a.lineHops;if(n!==!1){const s=n==="gap"?"gap":"arc",o=t.edges.filter(l=>Array.isArray(l.points)&&l.points.length>=2).map(l=>({id:l.id,points:l.points,curve:l.curve,arrowTypeStart:l.arrowTypeStart,arrowTypeEnd:l.arrowTypeEnd}));wye(e.edgePaths,o,{enabled:!0,jumpRadius:6,jumpStyle:s})}}x(Cye,"adjustLayout");function kye(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=Xt(),{subGraphTitleTotalMargin:i}=vx({flowchart:n.flowchart??{}});if(t.label){const a=zC.get(t.id);let s=t.x,o=t.y;if(r){const l=yr.calcLabelPosition(r);le.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t!=null&&t.startLabelLeft){const a=Li.get(t.id).startLeft;let s=t==null?void 0:t.x,o=t==null?void 0:t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=Li.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=Li.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=Li.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}}x(kye,"positionEdgeLabel");var _I="__swimlane_default__",hut=21,qQ=20;function C$(t){return Math.max(t.padding??qQ,qQ)}x(C$,"topLaneHorizontalPadding");function Sye(t){const{x:e,y:r,width:n,height:i}=t,a=t.swimlaneContentTop;if(typeof e!="number"||typeof r!="number"||typeof n!="number"||typeof i!="number"||typeof a!="number"||!Number.isFinite(e)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(a)||n<=0||i<=0){delete t.groupTitleRect;return}const s=r-i/2,o=Math.min(a,r+i/2),l=Math.min(hut,Math.max(0,o-s)),u=s+l;if(u<=s){delete t.groupTitleRect;return}t.groupTitleRect={left:e-n/2,right:e+n/2,top:s,bottom:u}}x(Sye,"assignTopLaneTitleRect");function Eye(t){const e=t.direction,r=t.nodes??(t.nodes=[]);for(const a of t.nodes??[])a.isGroup&&!a.parentId&&(a.shape="swimlane",e&&(a.direction=e));const n=r.filter(a=>!a.isGroup&&!a.parentId);if(n.length===0)return;let i=r.find(a=>a.id===_I);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:_I,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const a of n)a.parentId=_I}x(Eye,"prepareLayoutForSwimlanes");function Aye(t){const e=new Map;for(const l of t.nodes??[])e.set(l.id,l);const r=[];for(const l of t.edges??[]){const u=typeof l.start=="string"?l.start:void 0,h=typeof l.end=="string"?l.end:void 0;!u||!h||l.labelNodeId||r.push({id:l.id,src:u,dst:h,ref:l})}const n=t.nodes??[],i=n.filter(l=>l.isGroup),a=n.filter(l=>!l.isGroup);return{nodes:[...[...i].reverse(),...a].map(l=>l.id),edges:r,layout:t,nodeById:e}}x(Aye,"toGraphView");function _ye(t,e,r,n){const{layout:i}=t,a=t.nodeById,s=(n==null?void 0:n.layerGap)??100,o=(n==null?void 0:n.nodeGap)??40;let l=0;for(const f of e.layers){let p=0;for(const g of f){const m=a.get(g);if(!m){p++;continue}m.layer=l,m.order=p;const y=r.x[g]??p*o,v=r.y[g]??l*s;m.x=y,m.y=v,p++}l++}const u=i.nodes??[],h=new Map,d=[];for(const f of u){if(!(f!=null&&f.isGroup))continue;f.parentId||d.push(f);const p=u.filter(T=>T.parentId===f.id);let g=1/0,m=-1/0,y=1/0,v=-1/0;for(const T of p){const b=T.x??r.x[T.id],w=T.y??r.y[T.id],C=T.width??0,S=T.height??0;b!=null&&w!=null&&(g=Math.min(g,b-C/2),m=Math.max(m,b+C/2),y=Math.min(y,w-S/2),v=Math.max(v,w+S/2))}if(g===1/0||y===1/0)f.x=f.x??0,f.y=f.y??0,f.width=f.width??0,f.height=f.height??0;else{const T=f.padding??20,b=f.parentId?T:2*C$(f),w=T,C=Math.max(0,m-g)+b,S=Math.max(0,v-y)+w,k=(g+m)/2,E=(y+v)/2;f.x=k,f.y=E,f.width=C,f.height=S,h.set(f.id,{minX:g,maxX:m,minY:y,maxY:v})}}if(d.length>0&&h.size>0){let f=1/0,p=-1/0,g=0;for(const m of d){const y=m.padding??20;y>g&&(g=y);const v=h.get(m.id);v&&(f=Math.min(f,v.minY),p=Math.max(p,v.maxY))}if(f!==1/0&&p!==-1/0){const m=Math.max(0,p-f),v=Math.max(g,36),T=m+2*v,b=(f+p)/2;for(const _ of d)_.y=b,_.height=T,_.swimlaneContentTop=f;const w=[...d].sort((_,M)=>{const L=_.x??0,P=M.x??0;return L-P}),C=[],S=[],k=[];for(const _ of w){const M=h.get(_.id);if(!M)continue;const L=Math.max(0,M.maxX-M.minX)+2*C$(_),P=(M.minX+M.maxX)/2;C.push(_.id),S.push(P),k.push(L)}const E=C.length;if(E>0){const _=new Map;if(E===1)_.set(C[0],k[0]);else{const M=[];for(let I=0;I0&&i>0?{cx:e,cy:r,rect:vy(e,r,n,i)}:void 0}x(bG,"measuredNodeRect");function xG(t){if(t.isGroup)return;const e=bG(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}x(xG,"nodeBoundsInfoFor");function wl(t,e,r=Aa){return Math.abs(t.x-e.x)r}x(xi,"isHorizontalSegment");function Ti(t,e,r=Aa){return qr(t,e,r)&&Math.abs(t.y-e.y)>r}x(Ti,"isVerticalSegment");function qs(t,e,r,n){return Math.max(0,Math.min(Math.max(t,e),Math.max(r,n))-Math.max(Math.min(t,e),Math.min(r,n)))}x(qs,"overlapLength");function Uc(t,e,r=Aa){return t.horizontal&&e.horizontal&&Kr(t.a,e.a,r)?qs(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&qr(t.a,e.a,r)?qs(t.a.y,t.b.y,e.a.y,e.b.y):0}x(Uc,"sameAxisSegmentOverlapLength");function Vb(t,e=Aa){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!wl(i,n,e))&&r.push({x:n.x,y:n.y})}return r}x(on,"dedupeConsecutivePoints");function TG(t,e=Aa){if(!t||t.length!==4)return;const[r,n,i,a]=t;return xi(r,n,e)&&Ti(n,i,e)&&xi(i,a,e)?{kind:"HVH",p0:r,p1:n,p2:i,p3:a}:Ti(r,n,e)&&xi(n,i,e)&&Ti(i,a,e)?{kind:"VHV",p0:r,p1:n,p2:i,p3:a}:void 0}x(TG,"classifyThreeSegmentRoute");function QR(t,e,r,n=0){const i=Math.min(t.x,e.x),a=Math.max(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.y,e.y);return a>r.left-n&&ir.top-n&&se.left+r&&t.xe.top+r&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}x(Lye,"rectContainsRect");function t_(t,e){return t.lefte.left&&t.tope.top}x(t_,"rectsOverlap");function k$(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}x(k$,"inflateRect");function vy(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}x(vy,"rectFromCenterSize");function To(t){var e;return(e=bG(t))==null?void 0:e.rect}x(To,"rectOfNodeBounds");function Qp(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}x(Qp,"portForRectSide");function CG(t,e,r,n,i,a=Aa){const s=e==="left"||e==="right",o=n==="left"||n==="right";if(s&&o){if(e==="right"&&n==="left"&&t.xr.x){if(Kr(t,r,a))return[t,r];const d=(t.x+r.x)/2;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}if(e===n){if(Kr(t,r,a))return;const d=e==="left"?Math.min(t.x,r.x)-i:Math.max(t.x,r.x)+i;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}return}if(!s&&!o){if(e===n){if(qr(t,r,a))return;const f=e==="top"?Math.min(t.y,r.y)-i:Math.max(t.y,r.y)+i;return[t,{x:t.x,y:f},{x:r.x,y:f},r]}if(!(e==="bottom"&&n==="top"&&t.yr.y))return;if(qr(t,r,a))return[t,r];const d=(t.y+r.y)/2;return[t,{x:t.x,y:d},{x:r.x,y:d},r]}if(s&&!o){const h=e==="right"&&r.x>t.x||e==="left"&&r.xr.y;return h&&d?[t,{x:r.x,y:t.y},r]:void 0}const l=e==="bottom"&&r.y>t.y||e==="top"&&r.yr.x;return l&&u?[t,{x:t.x,y:r.y},r]:void 0}x(CG,"buildOrthogonalPortPath");function kG(t,e,r,n){return e==="left"||e==="right"?[t,{x:n,y:t.y},{x:n,y:r.y},r]:[t,{x:t.x,y:n},{x:r.x,y:n},r]}x(kG,"buildSameSideTrackPath");function JR(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=xG(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}x(JR,"collectRealNodeBounds");function Ef(t){const e=[],r=[];for(const n of t){const i=xG(n);if(!i)continue;const a={id:i.id,rect:i.rect};n.isEdgeLabel?r.push(a):e.push(a)}return{realNodeRects:e,labelNodeRects:r}}x(Ef,"collectNodeRectEntries");function Mye(t,{includeEdgeLabels:e=!0}={}){const r=[];for(const n of t){if(n.isGroup||!e&&n.isEdgeLabel)continue;const i=n.x??0,a=n.y??0,s=n.width??0,o=n.height??0;r.push({nodeId:n.id,...vy(i,a,s,o)})}return r}x(Mye,"collectLayoutNodeRects");function SG(t,e,r=Aa){const n=t.start,i=t.end;if(!n||!i)return;const a=e.get(n),s=e.get(i);if(!(!a||!s))return{srcId:n,dstId:i,srcInfo:a,dstInfo:s,collinearX:Math.abs(a.cx-s.cx)g||fv)return!1;const T=Math.abs(m-h.a.x)i:a&&o&&Kr(t,r,i)?qs(t.x,e.x,r.x,n.x)>i:!1}x(Iye,"sameAxisSegmentsOverlap");function r_(t,e,r,n,{epsilon:i=Aa,skipDegenerateOther:a=!1}={}){for(const s of r){if(s===n||s.isLayoutOnly)continue;const o=s.points;if(!(!o||o.length<2))for(let l=0;lf+i&&gm+i&&dn+Aa&&t=2?e[e.length-2]:void 0,l=(s?qr(s,i):!1)?{x:i.x,y:a.y}:{x:a.x,y:i.y};e.push(l)}e.push(a)}const r=[];for(const n of e){const i=r[r.length-1];(!i||!wl(i,n))&&r.push(n)}return r}x(n_,"orthogonalizePolyline");function Qc(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=Dye(e);if(e=n.points,!n.changed)break}return e}x(Qc,"simplifyPolyline");var br=.001,fut=.5,UQ=4;function AG(t,e,r){const n=t;if(n.isLayoutOnly||!n.points||n.points.length=0&&i=t.length)return t;const a=i-n;if(a<0||a>=t.length)return t;const s=Oye(t[i],t[a],e);return r?[s,...t.slice(i)]:[...t.slice(0,i+1),s]}x(E$,"clipEndpoint");function $ye(t,e){for(const r of t){const n=AG(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=E$(i,n.srcRect,!0)),n.dstRect&&(i=E$(i,n.dstRect,!1)),i=Qc(n_(i)),i=_G(i,n.srcRect,n.dstRect),n.edge.points=Qc(n_(i))}}x($ye,"clipEdgeEndpointsToNodeBoundaries");function A$(t,e,r,n=!1){if(Kr(t,e,br)){if(e.yr.bottom+br)return e;if(n){if(t.xr.right+br)return{x:r.right,y:t.y}}return{x:Math.abs(e.x-r.left)<=Math.abs(e.x-r.right)?r.left:r.right,y:t.y}}if(qr(t,e,br)){if(e.xr.right+br)return e;if(n){if(t.yr.bottom+br)return{x:t.x,y:r.bottom}}const i=Math.abs(e.y-r.top)<=Math.abs(e.y-r.bottom);return{x:t.x,y:i?r.top:r.bottom}}return e}x(A$,"snapEndpointToBoundary");function i_(t,e,r){const n=t[e];for(let i=e+r;i>=0&&in.lo)),r=Math.min(...t.map(n=>n.hi));if(!(e>r))return{lo:e,hi:r}}x(Pye,"intersectRanges");function R$(t,e){return e==="left"||e==="right"?a_(t.top,t.bottom):a_(t.left,t.right)}x(R$,"clearanceRangeForSide");function s_(t,e,r){const n=t.y>=r.top-br&&t.y<=r.bottom+br,i=t.x>=r.left-br&&t.x<=r.right+br;if(Kr(t,e,br)&&n){if(Math.abs(t.x-r.left)0?Pye(a):void 0}x(Bye,"straightClearanceRange");function L$(t,e,r,n,i){const a=Bye(t,e,r,n,i);if(!a)return;const s=i?t.y:t.x,o=Math.min(a.hi,Math.max(a.lo,s));if(!(Math.abs(o-s)({...o}));for(let o=e;o>=0&&o=r.left-br&&Math.max(t.x,e.x)<=r.right+br,i=Math.min(t.y,e.y)>=r.top-br&&Math.max(t.y,e.y)<=r.bottom+br;if(Math.abs(t.y-r.top)n.bottom+br;case"left":return Kr(e,r,br)&&r.xn.right+br}}x(N$,"leavesOutward");function D$(t,e,r){if(t.length<3)return t;if(r){const a=I$(t[0],t[1],e);return a&&N$(a,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=I$(t[n-1],t[n],e);return i&&N$(i,t[n-1],t[n-2],e)?t.slice(0,n):t}x(D$,"collapseOwnBorderStub");function Vye(t,e,r){let n=t;if(e){const a=i_(n,0,1);if(a){const s=A$(a,n[0],e);s!==n[0]&&(n=[s,...n.slice(1)])}n=D$(n,e,!0)}if(r){const a=n.length-1,s=i_(n,a,-1);if(s){const o=A$(s,n[a],r,!0);o!==n[a]&&(n=[...n.slice(0,a),o])}n=D$(n,r,!1)}const i=_G(n,e,r);return i!==n||n.length===2?i:(e&&(n=M$(n,e,!0)),r&&(n=M$(n,r,!1)),n)}x(Vye,"snapAndCollapseEndpoints");function O$(t,e){for(const r of t){const n=AG(r,e,2);if(!n)continue;const i=on(n.points,br),a=Vye(i,n.srcRect,n.dstRect);if(a.length<3){n.edge.points=a;continue}const s=[a[0],{...a[0]},...a.slice(1,-1),a[a.length-1],{...a[a.length-1]}];n.edge.points=s}}x(O$,"prepareEdgeEndpointsForRenderer");function RG(t){return new Map(t.map(e=>[e.id,e]))}x(RG,"buildNodeMap");function Gye(t,e){let r=t.parentId,n=null;for(;r;){const i=e.get(r);if(!(i!=null&&i.isGroup))break;n=i.id,r=i.parentId}return n}x(Gye,"resolveTopLevelGroupId");function $$(t,e){let r=0,n=t.parentId;for(;n;){const i=e.get(n);if(!(i!=null&&i.isGroup))break;r++,n=i.parentId}return r}x($$,"groupDepth");function LG(t){let e=1/0,r=-1/0,n=1/0,i=-1/0;for(const a of t){const s=a.x,o=a.y;if(typeof s!="number"||typeof o!="number")continue;const l=a.width??0,u=a.height??0;e=Math.min(e,s-l/2),r=Math.max(r,s+l/2),n=Math.min(n,o-u/2),i=Math.max(i,o+u/2)}return e===1/0||n===1/0?null:{minX:e,maxX:r,minY:n,maxY:i}}x(LG,"boundsForChildren");function Wye(t,e){const r=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+r,t.height=Math.max(0,e.maxY-e.minY)+r}x(Wye,"applyGroupBounds");function Hye(t){const e=RG(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>$$(i,e)-$$(n,e));for(const n of r){const i=t.filter(s=>s.parentId===n.id),a=LG(i);a&&Wye(n,a)}}x(Hye,"recomputeNestedGroupBounds");function o_(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(l=>!l.isGroup);let a=1/0,s=-1/0;for(const l of i){const u=l[e];typeof u=="number"&&(a=Math.min(a,u),s=Math.max(s,u))}if(!Number.isFinite(a)||!Number.isFinite(s))return!1;const o=x(l=>a+s-l,"mirror");for(const l of r){const u=l[e];typeof u=="number"&&(l[e]=o(u));const h=l.groupTitleRect;h&&(l.groupTitleRect=e==="x"?{...h,left:o(h.right),right:o(h.left)}:{...h,top:o(h.bottom),bottom:o(h.top)})}for(const l of n)for(const u of l.points??[])u[e]=o(u[e]);return!0}x(o_,"mirrorAxis");function qye(t){return(t.nodes??[]).some(r=>!r.isGroup)?o_(t,"y"):!0}x(qye,"applyBtDirectionTransform");function Uye(t,e="LR"){const r=t.nodes??[],n=t.edges??[],i=r.filter(D=>!D.isGroup);let a=1/0,s=1/0;for(const D of i){const R=D.x??0,I=D.y??0;R0?Math.max(1,h/d):1;for(const D of i){const R=D.x??0,$=((D.y??0)-s)*f+o,O=R-a;D.x=$,D.y=O}for(const D of n)if(D.points)for(const R of D.points){const I=R.x,O=(R.y-s)*f+o,N=I-a;R.x=O,R.y=N}Hye(r);const p=r.filter(D=>D.isGroup&&!D.parentId);if(p.length===0)return e==="RL"&&o_(t,"x"),!0;const g=RG(r),m=new Map;for(const D of r){if(D.isGroup)continue;const R=Gye(D,g);if(!R)continue;const I=m.get(R)??[];I.push(D),m.set(R,I)}let y=0;for(const D of p){const R=D.padding??0;R>y&&(y=R)}const v=[];let T=1/0,b=-1/0;for(const D of p){const R=m.get(D.id)??[],I=LG(R);I&&(T=Math.min(T,I.minX),b=Math.max(b,I.maxX),v.push({lane:D,contentTop:I.minY,contentBottom:I.maxY,centerY:(I.minY+I.maxY)/2}))}if(T===1/0||b===-1/0)return!0;const w=Math.max(0,b-T),C=Math.max(y,10),S=w+2*C,k=o+S,M=(T+b)/2-S/2-o,L=M+k/2,P=Math.max(y,o);v.sort((D,R)=>D.centerY-R.centerY);for(let D=0;Df.cy?v.bottom:v.top,P=f.cx+T;if(P<=v.left+_l||P>=v.right-_l)continue;b={x:P,y:L},w={x:P,y:o.y},C={x:o.x,y:o.y}}else{const L=p.cx>f.cx?v.right:v.left,P=f.cy+T;if(P<=v.top+_l||P>=v.bottom-_l)continue;b={x:L,y:P},w={x:o.x,y:P},C={x:o.x,y:o.y}}const S=wl(b,w,_l),k=wl(w,C,_l);if(S&&k||!S&&Oi(b,w,n,[h],1)||!k&&Oi(w,C,n,[d],1))continue;const E=!S&&r_(b,w,t,i,{epsilon:_l,skipDegenerateOther:!0}),_=!k&&r_(w,C,t,i,{epsilon:_l,skipDegenerateOther:!0});if(!(E||_)){S?y=[w,C]:k?y=[b,w]:y=[b,w,C];break}}y&&(i.points=y)}}x(Yye,"portSwapToLShape");function Xye(t,e){const{realNodeRects:a,labelNodeRects:s}=Ef(e.values());for(const o of t){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<4)continue;const u=on(l,.001);if(u.length<4)continue;const h=u.length-1,d=u[h],f=u[h-1],p=u[h-2],g=d.x-f.x,m=d.y-f.y,y=Math.hypot(g,m);if(y>=10||y<.001)continue;const v=f.x-p.x,T=f.y-p.y;if(Math.hypot(v,T)<.001)continue;const w=xi(f,d,.001),C=Ti(f,d,.001),S=xi(p,f,.001),k=Ti(p,f,.001);if(!(w&&k||C&&S))continue;const E=o.end,_=o.start,M=E?e.get(E):void 0;if(!M)continue;const L=M.x??0,P=M.y??0,D=To(M);if(!D)continue;let R,I;if(k){const B=T<0;R={x:L,y:p.y},I={x:L,y:B?D.bottom:D.top}}else{const B=v>0;R={x:p.x,y:P},I={x:B?D.right:D.left,y:P}}if(Oi(R,I,a,E?[E]:[],-2)||Oi(R,I,s,[],-2))continue;if(_){const B=e.get(_),G=B?To(B):void 0;if(G&&wG(R,G,2))continue}const $=x((B,G)=>`${B.x.toFixed(3)},${B.y.toFixed(3)}|${G.x.toFixed(3)},${G.y.toFixed(3)}`,"ownSegmentKey"),O=new Set;for(let B=0;B{for(const H of t){if(H===o||H.isLayoutOnly)continue;const q=H.points;if(!(!q||q.length<2))for(let Z=0;Z=0){const B=u[h-3],G=[_,E].filter(H=>!!H);if(Oi(B,R,a,G,-2)||N(B,R))continue}const z=[...u.slice(0,h-2),R,I];o.points=z;const V=o.labelNodeId;if(V){const B=e.get(V);if(B){const G=B.width??0,H=B.height??0;if(G>0&&H>0){let q,Z,Y=-1;for(let ie=0;ie=G+2||ge&&te>=H+2)&&te>Y&&(Y=te,q=(K.x+Q.x)/2,Z=(K.y+Q.y)/2)}q!==void 0&&Z!==void 0&&(B.x=q,B.y=Z)}}}}}x(Xye,"collapseShortTerminalStub");var Yt=.001,Sa=8,$r=Vb,RI=x((t,e)=>qr(t,e,Yt)||Kr(t,e,Yt),"orthogonallyAligned");function jye(t,e){const i=x((p,g)=>{const m=p.x??0,y=p.y??0,v=g.x-m,T=g.y-y;let b=(p.width??0)/2,w=(p.height??0)/2;return Math.abs(T)*b>Math.abs(v)*w?(T<0&&(w=-w),{x:m+(T===0?0:w*v/T),y:y+w}):(v<0&&(b=-b),{x:m+b,y:y+(v===0?0:b*T/v)})},"rectIntersect"),a=x((p,g)=>{const m=on(p.points??[]);if(m.length<2)return;const y=g?p.start:p.end,v=y?e.get(y):void 0,T=v?To(v):void 0;if(!v||!y||!T)return;const b=g?m[0]:m[m.length-1],w=g?m[1]:m[m.length-2],C=i(v,b);let S=b;if(RI(w,C)&&(S=w),qr(C,S,Yt))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"V",coord:C.x,min:Math.min(C.y,S.y),max:Math.max(C.y,S.y),boundary:C,railEnd:S,rect:T};if(Kr(C,S,Yt))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"H",coord:C.y,min:Math.min(C.x,S.x),max:Math.max(C.x,S.x),boundary:C,railEnd:S,rect:T}},"terminalLaneFor"),s=x((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),o=x((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:p.orientation==="H"?(Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1)&&qr(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&Kr(p.boundary,g.boundary,1),"sameTerminalFace"),l=x((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:s(p,g)>=Sa&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=x((p,g)=>{if(p.nodeId!==g.nodeId||p.orientation!==g.orientation||p.orientation!=="H"||p.atStart===g.atStart)return!1;const m=s(p,g);if(m2*y?!1:o(p,g)&&Math.abs(p.coord-g.coord)<16},"nearTerminalLaneConflict"),h=x((p,g)=>{const m=on(p.edge.points??[]);if(m.length<2)return;const y=p.orientation==="V"?{x:p.boundary.x+g,y:p.boundary.y}:{x:p.boundary.x,y:p.boundary.y+g},v=p.orientation==="V"?{x:p.railEnd.x+g,y:p.railEnd.y}:{x:p.railEnd.x,y:p.railEnd.y+g};if(!x(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?Kr(y,p.boundary,Yt)&&y.x>=p.rect.left+1&&y.x<=p.rect.right-1:Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1?qr(y,p.boundary,Yt)&&y.y>=p.rect.top+1&&y.y<=p.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(p.atStart){const S=m.length>1&&wl(m[1],p.railEnd,Yt),k=m.slice(S?2:1),E=k[0];return E&&!RI(E,v)?void 0:[y,v,...k]}const b=m.length>1&&wl(m[m.length-2],p.railEnd,Yt),w=m.slice(0,b?-2:-1),C=w[w.length-1];if(!(C&&!RI(C,v)))return[...w,v,y]},"shiftedCandidate"),d=x(p=>{const g=p.edge,m=on(g.points??[]);if(m.length!==2)return!1;const y=g.start,v=g.end,T=y?e.get(y):void 0,b=v?e.get(v):void 0;if(!T||!b)return!1;const w=T.x??0,C=T.y??0,S=b.x??0,k=b.y??0,[E,_]=m;return Kr(E,_,Yt)&&Math.abs(C-k)<1&&Math.abs(w-S)>1||qr(E,_,Yt)&&Math.abs(w-S)<1&&Math.abs(C-k)>1},"laneIsStraightCollinearConnector"),f=[-7,7,-14,14,-21,21];for(let p=0;p<8;p++){const g=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[a(y,!0),a(y,!1)]).filter(y=>!!y);let m=!1;for(let y=0;y{const E=d(S),_=d(k);return E!==_?Number(E)-Number(_):+!k.atStart-+!S.atStart});for(const S of C){for(const k of f){const E=h(S,k);if(!E)continue;const _=a({...S.edge,points:E},S.atStart);if(!(!_||g.some(M=>M.edge!==S.edge&&(l(_,M)||w&&u(_,M))))){S.edge.points=E,m=!0;break}}if(m)break}}if(!m)return}}x(jye,"separateSharedRenderedTerminalLanes");function Kye(t,e){const{realNodeRects:n,labelNodeRects:i}=Ef(e.values()),a=x((o,l)=>{const u=o.start,h=o.end,d=$r(l);if(d.length!==l.length-1)return!1;const f=[u,h].filter(p=>!!p);for(const p of d)if(Oi(p.a,p.b,n,f,-2)||Oi(p.a,p.b,i,[],-2))return!1;for(const p of t){if(p===o||p.isLayoutOnly)continue;const g=p.points;if(!(!g||g.length<2)){for(const m of d)for(const y of $r(on(g)))if(Uc(m,y,.5)>=Sa||Gh(m.a,m.b,y.a,y.b,Yt))return!1}}return!0},"candidateIsSafe"),s=x((o,l)=>{if(l+4>=o.length)return;const u=o[l],h=o[l+1],d=o[l+2],f=o[l+3],p=o[l+4],g=xi(u,h)&&Ti(h,d)&&xi(d,f)&&Ti(f,p)&&qr(u,f,Yt)&&qr(u,p,Yt)&&qr(h,d,Yt)&&(h.x-u.x)*(f.x-d.x)<0,m=Ti(u,h)&&xi(h,d)&&Ti(d,f)&&xi(f,p)&&Kr(u,f,Yt)&&Kr(u,p,Yt)&&Kr(h,d,Yt)&&(h.y-u.y)*(f.y-d.y)<0;if(g||m)return on([...o.slice(0,l+1),p,...o.slice(l+5)]);if(l+5>=o.length)return;const y=o[l+5],v=Ti(u,h)&&xi(h,d)&&Ti(d,f)&&xi(f,p)&&Ti(p,y)&&qr(u,p,Yt)&&qr(u,y,Yt)&&qr(d,f,Yt)&&(d.x-h.x)*(p.x-f.x)<0,T=xi(u,h)&&Ti(h,d)&&xi(d,f)&&Ti(f,p)&&xi(p,y)&&Kr(u,p,Yt)&&Kr(u,y,Yt)&&Kr(d,f,Yt)&&(d.y-h.y)*(p.y-f.y)<0;if(!(!v&&!T))return on([...o.slice(0,l+1),y,...o.slice(l+6)])},"withoutDogleg");for(let o=0;o<8;o++){let l=!1;for(const u of t){if(u.isLayoutOnly)continue;const h=on(u.points??[]);for(let d=0;d<=h.length-5;d++){const f=s(h,d);if(!(!f||!a(u,f))){u.points=f,l=!0;break}}if(l)break}if(!l)return}}x(Kye,"collapseRedundantRectangularDoglegs");function P$(t,e){const{realNodeRects:a,labelNodeRects:s}=Ef(e.values()),o=t.filter(g=>!g.isLayoutOnly),l=x((g,m,y)=>on(g===m?y??[]:g.points??[]),"pointsFor"),u=x((g,m)=>{let y=0;for(let v=0;v{const m=$r(g);if(m.length!==3)return;const y=m[1];if(!(m[0].horizontal===y.horizontal||m[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),d=x((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);return a.filter(v=>{if(y.includes(v.id))return!1;const T=v.rect;return m.horizontal?qs(m.a.x,m.b.x,T.left,T.right)>=Sa&&m.a.y>=T.top-2&&m.a.y<=T.bottom+2:qs(m.a.y,m.b.y,T.top,T.bottom)>=Sa&&m.a.x>=T.left-2&&m.a.x<=T.right+2})},"blockingRectsFor"),f=x((g,m,y)=>{const v=g.map(b=>({...b}));if(m.horizontal)v[m.index].y=y,v[m.index+1].y=y;else if(m.vertical)v[m.index].x=y,v[m.index+1].x=y;else return;const T=Qc(on(v));return $r(T).length===T.length-1?T:void 0},"candidateByMovingRail"),p=x((g,m,y)=>{const v=[g.start,g.end].filter(b=>!!b),T=$r(m);if(T.length!==m.length-1)return!1;for(const b of T)if(Oi(b.a,b.b,a,v,-2)||Oi(b.a,b.b,s,[],-2))return!1;for(const b of o)if(b!==g){for(const w of T)for(const C of $r(l(b)))if(Uc(w,C,.5)>=Sa)return!1}return u(g,m)<=y},"candidateIsSafe");for(let g=0;g<8;g++){const m=u();let y=!1;for(const v of o){const T=l(v),b=h(T);if(!b)continue;const w=d(v,b.segment);if(w.length===0)continue;const C=b.horizontal?[Math.min(...w.map(S=>S.rect.top))-20,Math.max(...w.map(S=>S.rect.bottom))+20]:[Math.min(...w.map(S=>S.rect.left))-20,Math.max(...w.map(S=>S.rect.right))+20];for(const S of C){const k=f(T,b.segment,S);if(!(!k||!p(v,k,m))){v.points=k,y=!0;break}}if(y)break}if(!y)return}}x(P$,"liftObstacleHuggingSameSideRails");function B$(t,e){const n=x(l=>{const u=l.groupTitleRect;if(!(!u||typeof u.left!="number"||typeof u.right!="number"||typeof u.top!="number"||typeof u.bottom!="number"||!Number.isFinite(u.left)||!Number.isFinite(u.right)||!Number.isFinite(u.top)||!Number.isFinite(u.bottom)||u.right<=u.left||u.bottom<=u.top))return{left:u.left,right:u.right,top:u.top,bottom:u.bottom}},"validTitleRect"),i=x(l=>{if(!l.isGroup||l.parentId)return;const u=l.direction,h=typeof u=="string"?u.toUpperCase():"";if(h==="LR"||h==="RL"||h==="BT")return;const d=n(l),f=l.y,p=l.height;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(m<=0||g{if(!l.horizontal)return!1;const h=l.a.y;return h<=u.top+Yt||h>=u.bottom-Yt?!1:qs(l.a.x,l.b.x,u.left,u.right)>=Sa},"horizontalSegmentIntersectsTitle"),s=[...e.values()].map(i).filter(l=>!!l);if(s.length===0)return;let o=0;for(const l of t){if(l.isLayoutOnly)continue;const u=on(l.points??[]);for(const h of $r(u))for(const d of s)a(h,d.rect)&&(o=Math.max(o,d.rect.bottom-h.a.y+4))}if(!(o<=Yt))for(const l of s){const u=l.node.y,h=l.node.height;typeof u!="number"||typeof h!="number"||!Number.isFinite(u)||!Number.isFinite(h)||h<=0||(l.node.y=u-o/2,l.node.height=h+o,l.node.groupTitleRect={...l.rect,top:l.rect.top-o,bottom:l.rect.bottom-o})}}x(B$,"liftTopLaneTitleBandsAboveRails");function F$(t,e){const n=x(u=>{const h=u.groupTitleRect;if(!(!h||typeof h.left!="number"||typeof h.right!="number"||typeof h.top!="number"||typeof h.bottom!="number"||!Number.isFinite(h.left)||!Number.isFinite(h.right)||!Number.isFinite(h.top)||!Number.isFinite(h.bottom)||h.right<=h.left||h.bottom<=h.top))return{left:h.left,right:h.right,top:h.top,bottom:h.bottom}},"validTitleRect"),i=x(u=>{if(!u.isGroup||u.parentId||u.direction!=="LR")return;const d=n(u),f=u.x,p=u.width;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(g<=0||m{if(!u.vertical)return!1;const d=u.a.x;return d<=h.left+Yt||d>=h.right-Yt?!1:qs(u.a.y,u.b.y,h.top,h.bottom)>=Sa},"verticalSegmentIntersectsTitle"),s=x((u,h)=>{if(!u.horizontal)return!1;const d=u.a.y;return d<=h.top+Yt||d>=h.bottom-Yt?!1:qs(u.a.x,u.b.x,h.left,h.right)>=Sa},"horizontalSegmentIntersectsTitle"),o=[...e.values()].map(i).filter(u=>!!u);if(o.length===0)return;let l=0;for(const u of t){if(u.isLayoutOnly)continue;const h=on(u.points??[]);for(const d of $r(h))for(const f of o)if(a(d,f.rect))l=Math.max(l,f.rect.right-d.a.x+4);else if(s(d,f.rect)){const p=Math.min(d.a.x,d.b.x);l=Math.max(l,f.rect.right-p+4)}}if(!(l<=Yt))for(const u of o){const h=u.node.x,d=u.node.width;typeof h!="number"||typeof d!="number"||!Number.isFinite(h)||!Number.isFinite(d)||d<=0||(u.node.x=h-l/2,u.node.width=d+l,u.node.groupTitleRect={...u.rect,left:u.rect.left-l,right:u.rect.right-l})}}x(F$,"shiftLeftLaneTitleBandsLeftOfRails");function Zye(t,e){const{realNodeRects:n}=Ef(e.values()),i=t.filter(g=>!g.isLayoutOnly),a=x((g,m=new Map)=>on(m.get(g)??g.points??[]),"replacementPointsFor"),s=x((g=new Map)=>{let m=0;for(let y=0;yi.reduce((m,y)=>m+Mo(a(y,g)),0),"totalBends"),l=x(g=>{const m=a(g);if(m.length<4)return;const y=m[m.length-2],v=m[m.length-1];if(!(!xi(y,v,Yt)&&!Ti(y,v,Yt)))return{tailStart:y,terminal:v}},"terminalTailFor"),u=x((g,m)=>{const y=a(g);if(y.length<3)return;const v=y[0],T=y[1];let b;if(xi(v,T,Yt))b={x:T.x,y:m.tailStart.y};else if(Ti(v,T,Yt))b={x:m.tailStart.x,y:T.y};else return;const w=Qc(on([v,T,b,m.tailStart,m.terminal]));return $r(w).length===w.length-1?w:void 0},"candidateWithDestinationTail"),h=x((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);for(const v of $r(m))if(Oi(v.a,v.b,n,y,-2))return!0;return!1},"pathHasNodeHit"),d=x((g,m,y)=>{for(const v of i)if(v!==g){for(const T of $r(m))for(const b of $r(a(v,y)))if(Uc(T,b,.5)>=Sa)return!0}return!1},"pathHasSharedTrack"),f=x((g,m,y)=>!h(g,m)&&!d(g,m,y),"candidateIsSafe"),p=x(()=>{const g=new Map;for(const m of i){const y=m.end;if(!y||!e.has(y)||a(m).length<4)continue;const T=g.get(y)??[];T.push(m),g.set(y,T)}return g},"edgesByDestination");for(let g=0;g<4;g++){const m=s();if(m===0)return;const y=o();let v,T=m,b=y;for(const w of p().values())for(let C=0;C=m||R>T||R===T&&I>=b||(v=D,T=R,b=I)}if(!v)return;for(const[w,C]of v)w.points=C}}x(Zye,"swapDestinationTerminalTailsToReduceCrossings");function Qye(t,e){const{realNodeRects:a,labelNodeRects:s}=Ef(e.values()),o=t.filter(w=>!w.isLayoutOnly),l=x((w,C=new Map)=>on(C.get(w)??w.points??[]),"replacementPointsFor"),u=x((w=new Map)=>{let C=0;for(let S=0;So.reduce((C,S)=>C+Mo(l(S,w)),0),"totalBends"),d=x(w=>{const C=w.start,S=w.end,k=C?e.get(C):void 0,E=S?e.get(S):void 0,_=k?To(k):void 0,M=E?To(E):void 0;return _&&M?{src:_,dst:M}:void 0},"endpointRectsFor"),f=x((w,C,S)=>{if(S.index<=0||S.index+1>=C.length-1)return;const k=d(w);if(k){if(S.vertical){const E=S.a.x,_=Math.min(k.src.left,k.dst.left),M=Math.max(k.src.right,k.dst.right),L=E<_-Yt?"left":E>M+Yt?"right":void 0;return L?{edge:w,points:C,segmentIndex:S.index,axis:"vertical",side:L,coord:E,min:Math.min(S.a.y,S.b.y),max:Math.max(S.a.y,S.b.y)}:void 0}if(S.horizontal){const E=S.a.y,_=Math.min(k.src.top,k.dst.top),M=Math.max(k.src.bottom,k.dst.bottom),L=E<_-Yt?"top":E>M+Yt?"bottom":void 0;return L?{edge:w,points:C,segmentIndex:S.index,axis:"horizontal",side:L,coord:E,min:Math.min(S.a.x,S.b.x),max:Math.max(S.a.x,S.b.x)}:void 0}}},"externalRailForSegment"),p=x(()=>{const w=[];for(const C of o){const S=l(C);for(const k of $r(S)){const E=f(C,S,k);E&&w.push(E)}}return w},"collectExternalRails"),g=x((w,C)=>w.edge!==C.edge&&w.axis===C.axis&&w.side===C.side&&qs(w.min,w.max,C.min,C.max)>=Sa,"railsInteract"),m=x(w=>{const C=[],S=new Set;for(const k of w){if(S.has(k))continue;const E=[k],_=[];for(S.add(k);E.length>0;){const M=E.pop();_.push(M);for(const L of w)!S.has(L)&&g(M,L)&&(S.add(L),E.push(L))}_.length>1&&C.push(_)}return C},"connectedComponents"),y=x(w=>{const C=[];for(const S of w)C.some(k=>Math.abs(k-S.coord){const C=w.map(E=>E.coord),S=y(w),k=[];if(w.length<=6){const E=new Array(S.length).fill(!1),_=[],M=x(()=>{if(_.length===w.length){_.some((L,P)=>Math.abs(L-C[P])>=Yt)&&k.push([..._]);return}for(const[L,P]of S.entries())E[L]||(E[L]=!0,_.push(P),M(),_.pop(),E[L]=!1)},"visit");return M(),k}for(let E=0;E{const S=new Map;for(const[E,_]of w.entries()){const M=C[E],L=S.get(_.edge)??_.points.map(P=>({x:P.x,y:P.y}));_.axis==="vertical"?(L[_.segmentIndex].x=M,L[_.segmentIndex+1].x=M):(L[_.segmentIndex].y=M,L[_.segmentIndex+1].y=M),S.set(_.edge,L)}const k=new Map;for(const[E,_]of S){const M=Qc(on(_));if($r(M).length!==M.length-1)return;k.set(E,M)}return k},"replacementsForAssignment"),b=x(w=>{for(const[C,S]of w){const k=[C.start,C.end].filter(E=>!!E);for(const E of $r(S))if(Oi(E.a,E.b,a,k,-2)||Oi(E.a,E.b,s,[],-2))return!1}for(let C=0;C=Sa)return!1}}return!0},"candidateIsSafe");for(let w=0;w<4;w++){const C=u();if(C===0)return;let S,k=C,E=h(),_=Number.POSITIVE_INFINITY;for(const M of m(p()))for(const L of v(M)){const P=T(M,L);if(!P||!b(P))continue;const D=u(P);if(D>=C)continue;const R=h(P),I=M.reduce(($,O,N)=>$+Math.abs(L[N]-O.coord),0);D>k||D===k&&(R>E||R===E&&I>=_)||(S=P,k=D,E=R,_=I)}if(!S)return;for(const[M,L]of S)M.points=L}}x(Qye,"reassignCrossingExternalRailChannels");function Jye(t,e){const{realNodeRects:n,labelNodeRects:i}=Ef(e.values()),a=t.filter(p=>!p.isLayoutOnly),s=x((p,g,m)=>on(p===g?m??[]:p.points??[]),"pointsFor"),o=x(p=>$r(p).reduce((g,m)=>{const y=m.a.x-m.b.x,v=m.a.y-m.b.y;return g+Math.hypot(y,v)},0),"pathLength"),l=x((p,g)=>{let m=0;for(let y=0;y{if(p.horizontal){const m=p.a.y;return(Math.abs(m-g.top)<1||Math.abs(m-g.bottom)<1)&&qs(p.a.x,p.b.x,g.left,g.right)>=Sa}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&qs(p.a.y,p.b.y,g.top,g.bottom)>=Sa}return!1},"segmentRunsAlongRectBorder"),h=x(p=>{const g=[p.start,p.end].filter(y=>!!y),m=[];for(const y of g){const v=e.get(y),T=v?To(v):void 0;T&&m.push(T)}return m},"endpointRectsFor"),d=x((p,g)=>{if(g+3>=p.length)return[];const m=p[g],y=p[g+1],v=p[g+2],T=p[g+3],b=xi(m,y,Yt)&&Ti(y,v,Yt)&&xi(v,T,Yt),w=Ti(m,y,Yt)&&xi(y,v,Yt)&&Ti(v,T,Yt);if(!b&&!w)return[];if(!(b?Math.sign(y.x-m.x)!==Math.sign(T.x-v.x):Math.sign(y.y-m.y)!==Math.sign(T.y-v.y)))return[];const S=qr(m,T,Yt)||Kr(m,T,Yt)?[]:[{x:m.x,y:T.y},{x:T.x,y:m.y}],k=S.length===0?[[...p.slice(0,g+1),...p.slice(g+3)]]:S.map(_=>[...p.slice(0,g+1),_,...p.slice(g+3)]),E=new Set;return k.map(_=>Qc(on(_))).filter(_=>{if($r(_).length!==_.length-1||!_.some(L=>wl(L,T,Yt)))return!1;const M=_.map(L=>`${L.x.toFixed(3)},${L.y.toFixed(3)}`).join("|");return E.has(M)?!1:(E.add(M),!0)})},"shortcutCandidatesAt"),f=x((p,g,m)=>{const y=[p.start,p.end].filter(T=>!!T),v=h(p);for(const T of $r(g))if(Oi(T.a,T.b,n,y,-2)||Oi(T.a,T.b,i,[],-2)||v.some(b=>u(T,b)))return!1;for(const T of a)if(T!==p){for(const b of $r(g))for(const w of $r(s(T)))if(Uc(b,w,.5)>=Sa)return!1}return l(p,g)<=m},"candidateIsSafe");for(let p=0;p<8;p++){const g=l();let m,y,v=g,T=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY;for(const w of a){const C=s(w),S=Mo(C,Yt),k=o(C);for(let E=0;E<=C.length-4;E++)for(const _ of d(C,E)){const M=Mo(_,Yt),L=o(_);if(!(Mv||D===v&&(M>T||M===T&&L>=b)||(m=w,y=_,v=D,T=M,b=L)}}if(!m||!y)return;m.points=y}}x(Jye,"shortcutRedundantOrthogonalJogs");function e1e(t,e){const s=[];for(const ce of e.values()){if(ce.isGroup||ce.isEdgeLabel)continue;const oe=ce.x??0,be=ce.y??0,fe=To(ce);fe&&s.push({id:String(ce.id??""),cx:oe,cy:be,rect:fe})}if(s.length===0)return;const o=new Map(s.map(ce=>[ce.id,ce])),l=s.map(ce=>({id:ce.id,rect:ce.rect})),u=["top","bottom","left","right"],h={top:Math.min(...s.map(ce=>ce.rect.top))-20,bottom:Math.max(...s.map(ce=>ce.rect.bottom))+20,left:Math.min(...s.map(ce=>ce.rect.left))-20,right:Math.max(...s.map(ce=>ce.rect.right))+20},d=t.filter(ce=>!ce.isLayoutOnly),f=new Map(d.map((ce,oe)=>[ce,oe])),p=x(ce=>{const oe=ce==="left"||ce==="top"?-1:1,be=[];for(let fe=0;fe<=2;fe++)be.push(h[ce]+oe*20*fe);return be},"outwardTracksForSide"),g=x((ce,oe=new Map)=>on(oe.get(ce)??ce.points??[]),"replacementPointsFor"),m=x((ce,oe)=>{let be=0;for(const fe of ce)for(const Pe of oe)Gh(fe.a,fe.b,Pe.a,Pe.b,Yt)&&be++;return be},"crossingCountBetweenSegments"),y=x((ce,oe)=>m($r(ce),$r(oe)),"crossingCountBetweenPaths"),v=x((ce=new Map)=>{let oe=0;const be=[],fe=new Set,Pe=[],ve=x(Ce=>{fe.has(Ce)||(fe.add(Ce),Pe.push(Ce))},"addEdge");for(let Ce=0;Ce0&&(oe+=ae,be.push({first:Ve,second:Te,count:ae}),ve(Ve),ve(Te))}}return Pe.sort((Ce,Ve)=>(f.get(Ce)??0)-(f.get(Ve)??0)),{count:oe,pairs:be,edgeSet:fe,edges:Pe}},"crossingSnapshot"),T=x((ce,oe)=>{const be=new Set(oe.keys());if(be.size===0)return ce.count;let fe=0;for(const ve of ce.pairs)(be.has(ve.first)||be.has(ve.second))&&(fe+=ve.count);let Pe=0;for(let ve=0;ve{const oe=new Map;for(const Pe of ce.pairs){const ve=oe.get(Pe.first)??new Set;ve.add(Pe.second),oe.set(Pe.first,ve);const Ce=oe.get(Pe.second)??new Set;Ce.add(Pe.first),oe.set(Pe.second,Ce)}const be=[],fe=new Set;for(const Pe of ce.edges){if(fe.has(Pe))continue;const ve=[Pe],Ce=[];for(fe.add(Pe);ve.length>0;){const Ve=ve.pop();Ce.push(Ve);for(const se of oe.get(Ve)??[])fe.has(se)||(fe.add(se),ve.push(se))}Ce.sort((Ve,se)=>(f.get(Ve)??0)-(f.get(se)??0)),Ce.length>1&&be.push(Ce)}return be},"crossingComponents"),w=x(ce=>[ce.start,ce.end].filter(oe=>!!oe),"endpointIdsFor"),C=x(ce=>{const oe=[];for(const be of b(ce)){const fe=new Set(be),Pe=new Set(be.flatMap(Ce=>w(Ce))),ve=[...be];for(const Ce of d)fe.has(Ce)||w(Ce).some(Ve=>Pe.has(Ve))&&ve.push(Ce);ve.sort((Ce,Ve)=>(f.get(Ce)??0)-(f.get(Ve)??0)),oe.push(ve)}return oe},"pairSearchGroups"),S=x((ce,oe,be)=>T(ce,new Map([[oe,be]])),"crossingCountWithSingleReplacement"),k=x(ce=>{const oe=new Map;for(const be of ce.pairs)oe.set(be.first,(oe.get(be.first)??0)+be.count),oe.set(be.second,(oe.get(be.second)??0)+be.count);return oe},"currentCrossingsByEdge"),E=x(ce=>ce.slice(1).reduce((oe,be,fe)=>{const Pe=ce[fe];return oe+Math.abs(be.x-Pe.x)+Math.abs(be.y-Pe.y)},0),"pathLength"),_=x((ce=new Map)=>d.reduce((oe,be)=>oe+Mo(g(be,ce)),0),"totalBends"),M=x((ce=new Map)=>d.reduce((oe,be)=>oe+E(g(be,ce)),0),"totalLength"),L=x((ce,oe,be=new Map)=>{const fe=$r(oe);for(const Pe of d)if(Pe!==ce){for(const ve of fe)for(const Ce of $r(g(Pe,be)))if(Uc(ve,Ce,.5)>=Sa)return!0}return!1},"pathHasSegmentConflict"),P=x((ce,oe)=>{const be=[ce.start,ce.end].filter(fe=>!!fe);for(const fe of $r(oe))if(Oi(fe.a,fe.b,l,be,-2))return!0;return!1},"pathHitsNode"),D=x((ce,oe)=>{const be=Qc(on(oe));$r(be).length===be.length-1&&ce.push(be)},"pushOrthogonalCandidate"),R=x(ce=>ce==="left"||ce==="right","sideIsHorizontal"),I=x((ce,oe,be)=>{switch(oe){case"left":return Math.min(ce.x,be.x)-20;case"right":return Math.max(ce.x,be.x)+20;case"top":return Math.min(ce.y,be.y)-20;case"bottom":return Math.max(ce.y,be.y)+20}},"localTrackForSameSide"),$=x((ce,oe,be,fe)=>{const Pe=be==="left"||be==="top"?-1:1,ve=[I(oe,be,fe),h[be]];for(const Ce of ve)for(let Ve=0;Ve<=2;Ve++)D(ce,kG(oe,be,fe,Ce+Pe*20*Ve))},"addSameSideCandidates"),O=x((ce,oe,be,fe,Pe)=>{for(const ve of p(be))for(const Ce of p(Pe))D(ce,[oe,{x:ve,y:oe.y},{x:ve,y:Ce},{x:fe.x,y:Ce},fe])},"addHorizontalToVerticalCandidates"),N=x((ce,oe,be,fe,Pe)=>{for(const ve of p(be))for(const Ce of p(Pe))D(ce,[oe,{x:oe.x,y:ve},{x:Ce,y:ve},{x:Ce,y:fe.y},fe])},"addVerticalToHorizontalCandidates"),F=x((ce,oe,be,fe,Pe)=>{const ve=[...p("top"),...p("bottom")];for(const Ce of p(be))for(const Ve of p(Pe))for(const se of ve)D(ce,[oe,{x:Ce,y:oe.y},{x:Ce,y:se},{x:Ve,y:se},{x:Ve,y:fe.y},fe])},"addHorizontalPairCandidates"),z=x((ce,oe,be,fe,Pe)=>{const ve=[...p("left"),...p("right")];for(const Ce of p(be))for(const Ve of p(Pe))for(const se of ve)D(ce,[oe,{x:oe.x,y:Ce},{x:se,y:Ce},{x:se,y:Ve},{x:fe.x,y:Ve},fe])},"addVerticalPairCandidates"),V=x(ce=>{const oe=new Set;return ce.map(be=>on(be)).filter(be=>{const fe=be.map(Pe=>`${Pe.x.toFixed(3)},${Pe.y.toFixed(3)}`).join("|");return oe.has(fe)||be.length<2?!1:(oe.add(fe),!0)})},"dedupeCandidatePaths"),B=x((ce,oe,be,fe)=>{const Pe=[],ve=CG(ce,oe,be,fe,20,Yt);ve&&D(Pe,ve),oe===fe&&$(Pe,ce,oe,be);const Ce=R(oe),Ve=R(fe);return Ce&&!Ve?O(Pe,ce,oe,be,fe):!Ce&&Ve?N(Pe,ce,oe,be,fe):Ce?F(Pe,ce,oe,be,fe):z(Pe,ce,oe,be,fe),V(Pe)},"buildCandidatesForSides"),G=x((ce,oe,be,fe)=>{const Pe=[...p("left"),...p("right")],ve=[...p("top"),...p("bottom")];for(const Ce of u){const Ve=Qp(fe,Ce),se=Ce==="top"||Ce==="bottom"?p(Ce):ve;for(const de of Pe){D(ce,[oe,be,{x:de,y:be.y},{x:de,y:Ve.y},Ve]);for(const Te of se)D(ce,[oe,be,{x:de,y:be.y},{x:de,y:Te},{x:Ve.x,y:Te},Ve])}}},"addVerticalDepartureOuterTrackCandidates"),H=x((ce,oe,be,fe)=>{const Pe=[...p("left"),...p("right")],ve=[...p("top"),...p("bottom")];for(const Ce of u){const Ve=Qp(fe,Ce),se=Ce==="left"||Ce==="right"?p(Ce):Pe;for(const de of ve){D(ce,[oe,be,{x:be.x,y:de},{x:Ve.x,y:de},Ve]);for(const Te of se)D(ce,[oe,be,{x:be.x,y:de},{x:Te,y:de},{x:Te,y:Ve.y},Ve])}}},"addHorizontalDepartureOuterTrackCandidates"),q=x(ce=>{const oe=ce.start,be=ce.end,fe=be?o.get(be):void 0;if(!oe||!fe)return[];const Pe=on(ce.points??[]);if(Pe.length<4)return[];const ve=Pe[0],Ce=Pe[1],Ve=[];return Ti(ve,Ce,Yt)?G(Ve,ve,Ce,fe):xi(ve,Ce,Yt)&&H(Ve,ve,Ce,fe),Ve},"terminalPreservingOuterTrackCandidates"),Z=x(ce=>{const oe=ce.start,be=ce.end,fe=oe?o.get(oe):void 0,Pe=be?o.get(be):void 0;if(!fe||!Pe)return[];const ve=[];for(const Ce of u){const Ve=Qp(fe,Ce);for(const se of u)ve.push(...B(Ve,Ce,Qp(Pe,se),se))}return ve.push(...q(ce)),ve},"candidatePathsFor"),Y=x(()=>new Map(d.map(ce=>[ce,$r(g(ce))])),"currentSegmentsByEdge"),ie=x((ce,oe,be)=>{const fe=new Set;for(const Pe of d){if(Pe===ce)continue;const ve=be.get(Pe)??$r(g(Pe));oe.some(Ce=>ve.some(Ve=>Uc(Ce,Ve,.5)>=Sa))&&fe.add(Pe)}return fe},"sharedTrackConflictsFor"),K=x((ce,oe,be,fe)=>{const Pe=new Set;return Z(ce).map(Ce=>Qc(on(Ce))).filter(Ce=>{if(P(ce,Ce))return!1;const Ve=Ce.map(se=>`${se.x.toFixed(3)},${se.y.toFixed(3)}`).join("|");return Pe.has(Ve)||Ce.length<2?!1:(Pe.add(Ve),!0)}).map(Ce=>{const Ve=$r(Ce);let se=0;for(const de of d)de!==ce&&(se+=m(Ve,be.get(de)??$r(g(de))));return{candidate:Ce,candidateSegments:Ve,crossings:oe.count-(fe.get(ce)??0)+se,bends:Mo(Ce,Yt),totalBends:Mo(Ce),length:E(Ce)}}).filter(({crossings:Ce})=>Ce<=oe.count).sort((Ce,Ve)=>Ce.crossings-Ve.crossings||Ce.bends-Ve.bends||Ce.length-Ve.length).slice(0,48).map(Ce=>({path:Ce.candidate,segments:Ce.candidateSegments,sharedTrackConflicts:ie(ce,Ce.candidateSegments,be),totalBends:Ce.totalBends,length:Ce.length}))},"pairCandidatesFor"),Q=x((ce,oe,be,fe,Pe,ve)=>{let Ce=0;for(const se of ce.pairs)(se.first===oe||se.second===oe||se.first===fe||se.second===fe)&&(Ce+=se.count);let Ve=m(be.segments,Pe.segments);for(const se of d){if(se===oe||se===fe)continue;const de=ve.get(se)??$r(g(se));Ve+=m(be.segments,de)+m(Pe.segments,de)}return ce.count-Ce+Ve},"pairCrossingCount"),te=x((ce,oe)=>{for(const be of ce.sharedTrackConflicts)if(be!==oe)return!1;return!0},"conflictsOnlyWith"),J=x((ce,oe)=>ce.segments.some(be=>oe.segments.some(fe=>Uc(be,fe,.5)>=Sa)),"candidatesShareTrack"),ge=x((ce,oe,be,fe)=>te(oe,be.edge)&&te(fe,ce.edge)&&!J(oe,fe),"pairCandidatesAreCompatible"),ee=x((ce,oe,be,fe,Pe)=>{const ve=Q(ce.current,oe.edge,be,fe.edge,Pe,ce.baseSegments);if(!(ve>=ce.current.count))return{replacements:new Map([[oe.edge,be.path],[fe.edge,Pe.path]]),crossings:ve,bends:ce.currentBends-(ce.baseBendsByEdge.get(oe.edge)??0)-(ce.baseBendsByEdge.get(fe.edge)??0)+be.totalBends+Pe.totalBends,length:ce.currentLength-(ce.baseLengthByEdge.get(oe.edge)??0)-(ce.baseLengthByEdge.get(fe.edge)??0)+be.length+Pe.length}},"scorePairReplacement"),Re=x((ce,oe)=>ce.crossings{let Pe=fe;for(const ve of oe.candidates)for(const Ce of be.candidates){if(!ge(oe,ve,be,Ce))continue;const Ve=ee(ce,oe,ve,be,Ce);Ve&&Re(Ve,Pe)&&(Pe=Ve)}return Pe},"bestScoreForOptionPair"),Be=x(ce=>{const oe=_(),be=M(),fe=Y(),Pe=k(ce),ve=new Map(d.map(ae=>[ae,Mo(g(ae))])),Ce=new Map(d.map(ae=>[ae,E(g(ae))])),Ve=new Map,se=C(ce);for(const ae of se)for(const he of ae){if(Ve.has(he))continue;const W=K(he,ce,fe,Pe);W.length>0&&Ve.set(he,{edge:he,candidates:W})}let de={replacements:new Map,crossings:ce.count,bends:oe,length:be};const Te={current:ce,currentBends:oe,currentLength:be,baseBendsByEdge:ve,baseLengthByEdge:Ce,baseSegments:fe};for(const ae of se){const he=new Set(ae.filter(ne=>ce.edgeSet.has(ne))),W=ae.map(ne=>Ve.get(ne)).filter(ne=>!!ne);for(let ne=0;ne0?de.replacements:void 0},"bestPairedReplacement");for(let ce=0;ce<4;ce++){const oe=v(),be=oe.count;if(be===0)return;let fe,Pe,ve=be,Ce=Number.POSITIVE_INFINITY;for(const se of oe.edges){const de=Mo(g(se),Yt);for(const Te of Z(se)){const ae=P(se,Te),he=!ae&&L(se,Te),W=S(oe,se,Te),ne=Mo(Te,Yt);ae||he||!(Wve||W===ve&&ne>=Ce||(fe=se,Pe=Te,ve=W,Ce=ne)}}if(fe&&Pe){fe.points=Pe;continue}const Ve=Be(oe);if(!Ve)return;for(const[se,de]of Ve)se.points=de}}x(e1e,"resolveRenderedOrthogonalCrossings");var id=.001,mut=8;function t1e(t,e){const{nodeInfoById:r,realNodeRects:n}=JR(e),i=["top","bottom","left","right"],a=20,s={top:Math.min(...n.map(m=>m.rect.top))-a,bottom:Math.max(...n.map(m=>m.rect.bottom))+a,left:Math.min(...n.map(m=>m.rect.left))-a,right:Math.max(...n.map(m=>m.rect.right))+a},o=x((m,y,v,T)=>{const b=[],w=CG(m,y,v,T,a,id);return w&&b.push(w),y===T&&b.push(kG(m,y,v,s[y])),b},"buildOrthogonalPathCandidates"),l=x((m,y)=>{for(let v=0;v{let T=0;const b=Vb(m,id),w=y.start,C=y.end;for(const S of t){if(S===y||S.isLayoutOnly)continue;const k=S.start,E=S.end;if(!v&&w&&C&&(k===w||k===C||E===w||E===C))continue;const _=S.points;if(!(!_||_.length<2))for(const M of b)for(const L of Vb(_,id)){if(EG(M.a,M.b,L.a,L.b,id,id)){T++;continue}Uc(M,L,id)>=mut&&T++}}return T},"pathConflictCount"),h=4,d=x((m,y)=>{const v=Math.abs(m.y-y.rect.top),T=Math.abs(m.y-y.rect.bottom),b=Math.abs(m.x-y.rect.left),w=Math.abs(m.x-y.rect.right);let C="top",S=v;return T{const T=f.get(m)??[];T.push({side:y,edgeId:v}),f.set(m,T)},"addFaceClaim");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points??[];if(y.length<1)continue;const v=m.id??"",T=m.start,b=m.end;if(T){const w=r.get(T);w&&p(T,d(y[0],w),v)}if(b){const w=r.get(b);w&&p(b,d(y[y.length-1],w),v)}}const g=x((m,y,v)=>{var T;return((T=f.get(m))==null?void 0:T.some(b=>b.edgeId!==v&&b.side===y))??!1},"faceIsClaimed");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points;if(!y||y.length<2)continue;const v=Mo(y,id);if(v0){const N=u($,m,!0);if(N>M||N===M&&O>=L)continue;M=N,L=O,_=$;continue}u($,m)>E||OR.edgeId!==S));const D=f.get(b);D&&f.set(b,D.filter(R=>R.edgeId!==S)),p(T,d(_[0],w),S),p(b,d(_[_.length-1],C),S)}}}x(t1e,"simplifyDetouredEdges");var oo=.001,YQ=10,HE=7;function z$(t,e){const r=e?0:t.length-1,n=e?1:-1,i=t[r],a=t[r+n];if(!i||!a)return;const s=a.x-i.x,o=a.y-i.y;if(!(Math.abs(s)+Math.abs(o)a&&t_(t,r1e(a)))}x(V$,"labelOverlapsOwnMarker");function i3(t,e){const r=[];for(const g of t){if(g.isLayoutOnly)continue;const m=g.points;if(!(!m||m.length<2))for(let y=0;y{const y=k$(m,a);for(const{nodeId:v,rect:T}of n)if(v!==g&&t_(y,T))return!0;return!1},"labelOverlapsForeignNode"),u=x((g,m)=>{const y=k$(m,a);for(const v of r)if(v.edgeId!==g&&QR(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),h=x((g,m,y)=>l(g,y)||u(m,y),"labelOverlapsAnything"),d=[],f=x(g=>{for(const{id:m,rect:y}of i)if(Lye(y,g))return m},"findContainingLane"),p=x((g,m)=>d.some(y=>y.labelId!==g&&t_(m,y.rect)),"overlapsPlacedLabel");for(const g of t){if(g.isLayoutOnly)continue;const m=g.labelNodeId;if(!m)continue;const y=e.get(m);if(!y)continue;const v=g.points;if(!v||v.length<2)continue;const T=y.width??0,b=y.height??0;if(T<=0||b<=0)continue;const w=[];for(let V=0;V=oo&&q>=oo||w.push({idx:V,length:H+q,orientation:H>=oo?"horizontal":"vertical",midX:(B.x+G.x)/2,midY:(B.y+G.y)/2})}if(w.length===0)continue;const C=w.length>=3?w.filter(V=>V.idx>0&&V.idx0?C:w,k=T>=b?"horizontal":"vertical",E=x(V=>[...V].sort((B,G)=>{const H=B.orientation===k,q=G.orientation===k;if(H!==q)return H?-1:1;const Z=B.length>=(B.orientation==="horizontal"?T:b)+2,Y=G.length>=(G.orientation==="horizontal"?T:b)+2;return Z!==Y?Z?-1:1:G.length-B.length}),"rankSegments"),_=w[0],M=w[w.length-1],L=[.5,.25,.75,.05,.95,.15,.85,.1,.9],P=x((V,B)=>{const G=v[V.idx],H=v[V.idx+1];return{midX:G.x+(H.x-G.x)*B,midY:G.y+(H.y-G.y)*B}},"anchorAtT"),D=x((V,B,G)=>Math.min(G,Math.max(B,V)),"clamp"),R=x((V,B)=>V.midX>=B.left-oo&&V.midX<=B.right+oo&&V.midY>=B.top-oo&&V.midY<=B.bottom+oo,"pointInsideRectInclusive"),I=x(V=>{const B=vy(V.midX,V.midY,T,b),G=f(B);if(G)return{laneId:G,anchor:V,rect:B};const H=i.find(({rect:te})=>R(V,te));if(!H)return;const q=H.rect.left+T/2+s,Z=H.rect.right-T/2-s,Y=H.rect.top+b/2+s,ie=H.rect.bottom-b/2-s;if(q>Z||Y>ie)return;const K={midX:D(V.midX,q,Z),midY:D(V.midY,Y,ie)},Q=vy(K.midX,K.midY,T,b);return R(V,Q)?{laneId:H.id,anchor:K,rect:Q}:void 0},"placementForAnchor"),$=x((V,B,G)=>V.orientation==="horizontal"?Math.abs(B.midX-G.x):Math.abs(B.midY-G.y),"distanceAlongSegment"),O=x((V,B)=>{const H=(V.orientation==="horizontal"?T/2:b/2)+o;if(V===_){const q=v[V.idx];if($(V,B,q)+oo{const B=E(V);for(const G of B)for(const H of L){const q=P(G,H);if(!O(G,q))continue;const Z=I(q);if(Z&&!V$(Z.rect,v)&&!p(m,Z.rect)&&!h(m,g.id,Z.rect))return{laneId:Z.laneId,anchor:Z.anchor}}},"tryPool"),F=x((V,B,G=!1)=>{const H=E(V);for(const q of H){const Z={midX:q.midX,midY:q.midY};if(B&&!O(q,Z))continue;const Y=I(Z);if(Y&&!V$(Y.rect,v)&&!p(m,Y.rect)&&!l(m,Y.rect)&&(G||!u(g.id,Y.rect)))return{laneId:Y.laneId,anchor:Y.anchor}}},"findLaneContainingFallback"),z=N(S)??(S.lengthG.labelId===m);B>=0?d[B]={labelId:m,rect:V}:d.push({labelId:m,rect:V})}}}x(i3,"anchorLabelsToPolyline");var LI=1e-6,yut=8,XQ=yut/2,vut=3;function G$(t,e){return t{const h=G$(o,l);let d=0;const f=x(p=>{if(!p)return;const g=i.get(p);if(!g)return;const m=u==="x"?g.w/2:g.h/2;m>d&&(d=m)},"consider");f(s.labelNodeId);for(const p of t){if(p===s||p.isLayoutOnly)continue;const g=p.start,m=p.end;!g||!m||G$(g,m)===h&&f(p.labelNodeId)}return d>0?d+vut:0},"labelClearanceFor");for(const s of t){if(s.isLayoutOnly)continue;const o=s.points;if(!TG(o,LI))continue;const l=SG(s,r,LI);if(!l)continue;const{srcId:u,dstId:h,srcInfo:d,dstInfo:f,collinearX:p,collinearY:g}=l;if(p===g)continue;let m,y;if(p){const C=f.cy>d.cy;m={x:d.cx,y:C?d.rect.bottom:d.rect.top},y={x:f.cx,y:C?f.rect.top:f.rect.bottom}}else{const C=f.cx>d.cx;m={x:C?d.rect.right:d.rect.left,y:d.cy},y={x:C?f.rect.left:f.rect.right,y:f.cy}}if(Oi(m,y,n,[u,h],1))continue;const T=a(s,u,h,p?"x":"y"),b=T>XQ?T:XQ,w=[0,b,-b];for(const C of w){const S={...m},k={...y};if(p){if(S.x+=C,k.x+=C,S.x<=d.rect.left||S.x>=d.rect.right||k.x<=f.rect.left||k.x>=f.rect.right)continue}else if(S.y+=C,k.y+=C,S.y<=d.rect.top||S.y>=d.rect.bottom||k.y<=f.rect.top||k.y>=f.rect.bottom)continue;if(!Oi(S,k,n,[u,h],1)&&!r_(S,k,t,s,{epsilon:LI})){s.points=[S,k];break}}}}x(n1e,"straightenCollinearSiblingDetours");function W$(t,e){const{realNodeRects:l,labelNodeRects:u}=Ef(e.values()),h=x((C,S)=>Vb(S,.001).map(k=>({...k,edge:C,interior:k.index>=1&&k.index<=S.length-3})),"segmentsFor"),d=x(()=>{const C=[];for(const S of t){if(S.isLayoutOnly)continue;const k=S.points;!k||k.length<2||C.push(...h(S,on(k)))}return C},"allSegments"),f=x((C,S)=>C.horizontal&&S.horizontal?qs(C.a.x,C.b.x,S.a.x,S.b.x)>=8&&Math.abs(C.a.y-S.a.y)<7:C.vertical&&S.vertical?qs(C.a.y,C.b.y,S.a.y,S.b.y)>=8&&Math.abs(C.a.x-S.a.x)<7:!1,"hasCrowdedParallelTrack"),p=x((C,S)=>{const k=C.start,E=C.end,_=h(C,S);if(_.length!==S.length-1)return!1;const M=[k,E].filter(P=>!!P),L=C.labelNodeId?[C.labelNodeId]:[];for(const P of _)if(Oi(P.a,P.b,l,M,-2)||Oi(P.a,P.b,u,L,-2))return!1;for(const P of t){if(P===C||P.isLayoutOnly)continue;const D=P.points;if(!(!D||D.length<2)){for(const R of _)for(const I of h(P,on(D)))if(f(R,I)||Gh(R.a,R.b,I.a,I.b,.001))return!1}}return!0},"candidateIsSafe"),g=x((C,S)=>{const k=on(C.edge.points??[]);if(k.length<4||C.index>=k.length-1)return;const E=k.map(_=>({..._}));if(C.horizontal)E[C.index].y+=S,E[C.index+1].y+=S;else if(C.vertical)E[C.index].x+=S,E[C.index+1].x+=S;else return;return h(C.edge,E).length===E.length-1?E:void 0},"shiftedCandidate"),m=x((C,S)=>({x:C.x??(S.left+S.right)/2,y:C.y??(S.top+S.bottom)/2}),"nodeCenter"),y=x(C=>{const S=C.edge,k=on(S.points??[]);if(k.length!==4||C.index!==1)return;const E=S.start?e.get(S.start):void 0,_=S.end?e.get(S.end):void 0,M=E?To(E):void 0,L=_?To(_):void 0,P=k.slice(C.index+2);if(!(!E||!_||!M||!L||P.length===0))return{sourceCenter:m(E,M),targetCenter:m(_,L),sourceRect:M,tail:P}},"sourceDetourContextFor"),v=x((C,S,k,E,_,M)=>{const L=E.y>=k.y,P=L?_.bottom:_.top,D=P+(L?20:-20);if(L&&C.b.y<=D+.001||!L&&C.b.y>=D-.001)return;const R=C.a.x+S;return on([{x:k.x,y:P},{x:k.x,y:D},{x:R,y:D},{x:R,y:C.b.y},...M],.001)},"verticalSourceDetour"),T=x((C,S,k,E,_,M)=>{const L=E.x>=k.x,P=L?_.right:_.left,D=P+(L?20:-20);if(L&&C.b.x<=D+.001||!L&&C.b.x>=D-.001)return;const R=C.a.y+S;return on([{x:P,y:k.y},{x:D,y:k.y},{x:D,y:R},{x:C.b.x,y:R},...M],.001)},"horizontalSourceDetour"),b=x((C,S)=>{const k=y(C);if(k){if(C.vertical)return v(C,S,k.sourceCenter,k.targetCenter,k.sourceRect,k.tail);if(C.horizontal)return T(C,S,k.sourceCenter,k.targetCenter,k.sourceRect,k.tail)}},"sourceDetourCandidate"),w=[-7,7,-14,14,-21,21];for(let C=0;C<12;C++){const S=d();let k=!1;for(let E=0;ED.interior);for(const D of P){for(const R of w){const I=g(D,R);if(I&&p(D.edge,I)){D.edge.points=I,k=!0;break}const $=b(D,R);if($&&p(D.edge,$)){D.edge.points=$,k=!0;break}}if(k)break}}if(!k)return}}x(W$,"nudgeSharedInteriorSubpaths");function i1e(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=n.x-r.x,o=n.y-r.y,l=i*o-a*s;if(Math.abs(l)<1e-10)return!1;const u=r.x-t.x,h=r.y-t.y,d=(u*o-h*s)/l,f=(u*a-h*i)/l,p=.01;return d>p&&d<1-p&&f>p&&f<1-p}x(i1e,"segmentsIntersect");function a1e(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=Mye(e),a=[];for(const o of r){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<2)continue;const u=o.start,h=o.end,d=o.labelNodeId,f=o.id??`${u}->${h}`;for(const p of i)if(!(p.nodeId===u||p.nodeId===h)&&!(d&&p.nodeId===d)){for(let g=0;g0){const o=n.filter(u=>u.type==="edge-node-overlap").length,l=n.filter(u=>u.type==="edge-edge-crossing").length;le.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${o} edge-node overlap(s), ${l} edge crossing(s)`);for(const u of n)le.warn(`[SWIMLANE_VALIDATE] ${u.type}: ${u.detail}`)}return n}x(a1e,"validateSwimlanesLayout");function s1e(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(o=>!o.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!Uye(t,e)||e==="BT"&&i.length>0&&!qye(t))return;for(const o of n){if(o.isLayoutOnly)continue;const l=o.points;!l||l.length<2||(o.points=Qc(n_(l)))}t1e(n,r),n1e(n,r),Yye(n,r);const a=new Map;for(const o of r)a.set(String(o.id),o);i3(n,a),$ye(n,a),Xye(n,a),W$(n,a),jye(n,a),Kye(n,a),P$(n,a),Zye(n,a);const s=x(()=>{e1e(n,a),Qye(n,a),Jye(n,a),i3(n,a),O$(n,a),P$(n,a),i3(n,a),O$(n,a)},"finalizeRenderedEdges");s(),W$(n,a),s(),B$(n,a),F$(n,a),B$(n,a),F$(n,a)}x(s1e,"postProcessSwimlaneLayout");function Af(t){const e=new Map(t.nodeById),r=new Set,n=[];for(const a of t.edges){if(!e.has(a.src)||!e.has(a.dst))continue;const s=`${a.id}:${a.src}->${a.dst}`;r.has(s)||(r.add(s),n.push(a))}return{nodes:[...e.keys()],edges:n,layout:t.layout,nodeById:e}}x(Af,"normalizeGraph");function MG(t,e){return t.edges.filter(r=>r.dst===e)}x(MG,"incoming");function o1e(t){const e=new Map;for(const r of t.nodes)e.set(r,[]);for(const r of t.edges)e.get(r.src).push(r.dst);return e}x(o1e,"buildSuccessorMap");function IG(t){const e=o1e(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}x(IG,"buildSortedSuccessorMap");function NG(t){const e=new Map;for(const r of t.nodes)e.set(r,0);for(const r of t.edges)e.set(r.dst,(e.get(r.dst)??0)+1);return e}x(NG,"buildInDegreeMap");function DG(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}x(DG,"sortedZeroInDegreeNodes");function eL(t,e=()=>!0){const r=new Map,n=new Map;for(const i of t.nodes)r.set(i,[]),n.set(i,[]);for(const i of t.edges)e(i)&&(n.get(i.src).push(i.dst),r.get(i.dst).push(i.src));return{preds:r,succs:n}}x(eL,"buildPredecessorSuccessorMaps");function OG(t,e,r,n){var s,o;let i=0;for(const l of t.nodes)n!=null&&n.skipGroups&&((s=t.nodeById.get(l))!=null&&s.isGroup)||(i=Math.max(i,r[l]??0));const a=Array.from({length:i+1},()=>[]);for(const l of e)n!=null&&n.skipGroups&&((o=t.nodeById.get(l))!=null&&o.isGroup)||a[Math.max(0,r[l]??0)].push(l);return a}x(OG,"buildLayersFromRanks");function uS(t){const e=NG(t),r=DG(e),n=[],i=IG(t);for(;r.length;){const a=r.shift();n.push(a);for(const s of i.get(a)??[])if(e.set(s,(e.get(s)??0)-1),(e.get(s)??0)===0){let o=0;for(;o{if(i-n<=1)return 0;const a=n+i>>1;let s=r(n,a)+r(a,i),o=n,l=a,u=n;for(;o=i||od.dst===f.dst?d.id.localeCompare(f.id):d.dst.localeCompare(f.dst));const n=Object.create(null);for(const h of e.nodes)n[h]=0;const i=[],a=x(h=>{n[h]=1;for(const d of r.get(h)??[]){const f=d.dst;n[f]===0?a(f):n[f]===1&&i.push(d)}n[h]=2},"dfs"),s=[...e.nodes].sort((h,d)=>h.localeCompare(d));for(const h of s)n[h]===0&&a(h);const o=new Set(i.map(h=>`${h.id}:${h.src}->${h.dst}`)),l=e.edges.map(h=>o.has(`${h.id}:${h.src}->${h.dst}`)?{id:h.id,src:h.dst,dst:h.src,weight:h.weight,ref:h.ref}:h);return{acyclic:{nodes:[...e.nodes],edges:l,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:i}}x(l1e,"removeCycles_DFS");function c1e(t){const e=new Map,r=x(n=>{if(e.has(n))return e.get(n);const i=t.nodeById.get(n);if(!i)return e.set(n,null),null;const a=i.parentId;if(!a)return e.set(n,null),null;const o=r(a)??a;return e.set(n,o),o},"resolve");for(const n of t.nodes)r(n);return e}x(c1e,"buildTopLaneMap");function Wh(t){const e=c1e(t);return r=>e.get(r)??null}x(Wh,"createTopLaneResolver");function tL(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}x(tL,"buildTopLaneOrder");function PG(t,e){const r=tL(t);if(!e||e.length===0)return r;const n=new Set(r),i=new Set,a=[];for(const s of e)!n.has(s)||i.has(s)||(i.add(s),a.push(s));for(const s of r)i.has(s)||a.push(s);return a}x(PG,"resolveTopLaneOrder");var but={EPSILON:1e-6},l_={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},jQ={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function u1e(t,e){const r=Af(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:a}=eL(r);for(const C of a.values())C.sort((S,k)=>S.localeCompare(k));const s=uS(r)??[...r.nodes].sort((C,S)=>C.localeCompare(S)),o=new Map;for(const[C,S]of s.entries())o.set(S,C);const l=new Map,u=new Map;for(const C of r.nodes)u.set(C,[]);for(const C of s){const S=(a.get(C)??[]).filter(k=>l.has(k));if(S.length>0){const k=h1e(C,S,{laneOf:n,rankHint:i,topoIndex:o});l.set(C,k),u.get(k).push(C)}else l.has(C)||l.set(C,null)}for(const C of r.nodes)l.has(C)||l.set(C,null);const h=new Set;for(const C of r.nodes)(l.get(C)??null)===null&&h.add(C);const d=[...h].sort((C,S)=>{const k=o.get(C)??0,E=o.get(S)??0;return k===E?C.localeCompare(S):k-E}),f=d1e(r),p=new Map;for(const[C,S]of f.entries())p.set(C,[...S].sort((k,E)=>k.localeCompare(E)));const g=f1e(p),m=p1e(p),y=new Map;for(const C of r.nodes)y.set(C,[]);for(const C of m)for(const S of C.nodes){const k=y.get(S);k?k.push(C.id):y.set(S,[C.id])}const v=[],T=[],b=new Set,w=x(C=>{if(!b.has(C)){b.add(C),v.push(C);for(const S of u.get(C)??[])w(S);T.push(C)}},"walk");for(const C of d)w(C);for(const C of s)w(C);return{parent:l,children:u,roots:d,componentOf:g,blocks:m,nodeBlocks:y,adjacency:p,preorder:v,postorder:T,topologicalOrder:s}}x(u1e,"buildDrivingTree");function h1e(t,e,r){const n=r.laneOf(t);return[...e].sort((a,s)=>{var m,y;const o=r.laneOf(a),l=r.laneOf(s),u=o!=null&&o===n,h=l!=null&&l===n;if(u!==h)return u?-1:1;const d=(m=r.rankHint)==null?void 0:m[a],f=(y=r.rankHint)==null?void 0:y[s];if(d!=null&&f!=null&&d!==f)return f-d;const p=r.topoIndex.get(a)??0,g=r.topoIndex.get(s)??0;return p!==g?p-g:a.localeCompare(s)})[0]}x(h1e,"chooseParent");function d1e(t){const e=new Map;for(const r of t.nodes)e.set(r,new Set);for(const r of t.edges)e.get(r.src).add(r.dst),e.get(r.dst).add(r.src);return e}x(d1e,"buildAdjacency");function f1e(t){const e=new Map;let r=0;for(const n of t.keys()){if(e.has(n))continue;const i=[n];for(;i.length>0;){const a=i.pop();if(!e.has(a)){e.set(a,r);for(const s of t.get(a)??[])e.has(s)||i.push(s)}}r++}return e}x(f1e,"assignComponents");function p1e(t){const e=new Map,r=new Map,n=[],i=[];let a=0;const s=x((o,l)=>{e.set(o,++a),r.set(o,a);for(const u of t.get(o)??[])u!==l&&(e.has(u)?(e.get(u)??0)<(e.get(o)??0)&&(n.push([o,u]),r.set(o,Math.min(r.get(o)??a,e.get(u)??a))):(n.push([o,u]),s(u,o),r.set(o,Math.min(r.get(o)??a,r.get(u)??a)),(r.get(u)??0)>=(e.get(o)??0)&&i.push(g1e(o,u,n,i.length))))},"visit");for(const o of t.keys())e.has(o)||s(o,null);return i}x(p1e,"computeBlocks");function g1e(t,e,r,n){const i=[],a=new Set;for(;r.length>0;){const s=r.pop();if(i.push(s),a.add(s[0]),a.add(s[1]),s[0]===t&&s[1]===e||s[0]===e&&s[1]===t)break}return{id:n,edges:i,nodes:[...a]}}x(g1e,"popBlock");function m1e(t,e,r){const n=[...t.nodes],i=new Map;for(const[T,b]of n.entries())i.set(b,T);const a=n.length,s=new Array(a).fill(-1),o=new Array(a).fill(0),l=[],u=new Set;for(const T of n){const b=r.parent.get(T)??null,w=i.get(T);w!=null&&b==null&&(s[w]=-1,o[w]=0,u.has(T)||(u.add(T),l.push(T)))}for(;l.length>0;){const T=l.shift(),b=i.get(T);if(b==null)continue;const w=r.children.get(T)??[];for(const C of w){if(u.has(C))continue;const S=i.get(C);S!=null&&(s[S]=b,o[S]=o[b]+1,u.add(C),l.push(C))}}for(const T of n){if(u.has(T))continue;const b=i.get(T);b!=null&&(s[b]=-1,o[b]=0,u.add(T))}const h=Math.max(1,Math.ceil(Math.log2(Math.max(1,a)))+1),d=Array.from({length:h},()=>new Array(a).fill(-1));for(let T=0;T{if(T===-1||b===-1)return-1;o[T]>C&1&&(T=d[C][T],T===-1))return-1;if(T===b)return T;for(let C=h-1;C>=0;C--){const S=d[C][T],k=d[C][b];S===-1||k===-1||S!==k&&(T=S,b=k)}return d[0][T]},"lcaIndex"),p=Array.from({length:a},()=>new Map);for(const T of t.edges){let b=T.src,w=T.dst,C=e[b],S=e[w];if(C==null||S==null||(C>S&&([b,w]=[w,b],[C,S]=[S,C]),C==null||S==null||C===S))continue;const k=i.get(b),E=i.get(w);if(k==null||E==null)continue;const _=f(k,E);if(_===-1)continue;const M=p[_];for(let L=C;L{if(b.size!==0)for(const[w,C]of b)T.set(w,(T.get(w)??0)+C)},"mergeInto"),y=new Set,v=x(T=>{const b=i.get(T);y.add(T);const w=b==null?void 0:p[b],C=w?new Map(w):new Map,S=r.children.get(T)??[];for(const k of S){const E=v(k),_=e[T];if(_!=null){let M=g.get(T);M||(M=new Map,g.set(T,M));let L=E.get(_)??0;const P=e[k];P!=null&&P>_&&(L+=1),M.set(k,L)}m(C,E)}return C},"dfs");for(const T of r.roots)y.has(T)||v(T);for(const T of n)y.has(T)||v(T);return g}x(m1e,"computeSubtreeCrossCounts");function y1e(t,e,r){const n=new Map,i=x(a=>{let s=r[a]??0;const o=[...e.get(a)??[]];o.sort(BG(r));for(const l of o){i(l);const u=n.get(l);u!=null&&(s=Math.min(s,u))}n.set(a,s)},"annotate");for(const a of t)i(a);return n}x(y1e,"annotateMinimumLayers");function BG(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}x(BG,"compareByRankThenId");function v1e(t,e,r,n){let i=0;for(const l of e){const u=r[l]??0;u>i&&(i=u)}const a=Array.from({length:i+1},()=>[]),s=new Set,o=x(l=>{if(s.has(l))return;s.add(l);const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l);for(const h of n(l))o(h)},"emit");for(const l of t)o(l);for(const l of e)if(!s.has(l)){const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l),s.add(l)}return a}x(v1e,"emitNodesInTreeOrder");function b1e(t){const e=[];for(const r of t){const n=new Set,i=[];for(const a of r)n.has(a)||(n.add(a),i.push(a));e.push(i)}return e}x(b1e,"deduplicateLayers");function x1e(t,e,r,n){return i=>{const a=t.get(i)??[];if(a.length===0)return[];const s=e[i]??0,o=[],l=[],u=r.get(i);for(const h of a){const d=n.get(h)??s;d>s?o.push({child:h,min:d}):l.push(h)}return o.sort((h,d)=>h.min===d.min?h.child.localeCompare(d.child):h.min-d.min),l.sort((h,d)=>{const f=(u==null?void 0:u.get(h))??0,p=(u==null?void 0:u.get(d))??0;if(f!==p)return f-p;const g=n.get(h)??s,m=n.get(d)??s;return g!==m?g-m:h.localeCompare(d)}),[...o.map(h=>h.child),...l]}}x(x1e,"createChildOrderer");function c_(t,e,r){const n=u1e(t,{rankHint:e,laneOf:r}),{children:i,roots:a}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const s=m1e(t,e,n),o=[...a].sort(BG(e)),l=y1e(o,i,e),u=x1e(i,e,s,l);let h=v1e(o,t.nodes,e,u);return h=b1e(h),h}x(c_,"buildMultitreeLayerOrder");function T1e(t,e,r){const n=new Set(t),i=new Set(e),a=Gb(e),s=[];for(const o of r)n.has(o.src)&&i.has(o.dst)&&s.push(a.get(o.dst));return $G(s)}x(T1e,"countCrossingsBetweenAdjacent");function H$(t,e,r){const n=[];for(const a of e){const s=r[a.src],o=r[a.dst];if(s==null||o==null||s===o)continue;let l=a.src,u=a.dst,h=s,d=o;s>o&&(l=a.dst,u=a.src,h=o,d=s);for(let f=h;f(r[f]??0)-(r[d]??0));for(const d of h){const f=r[d]??0;if(f===0)continue;let p=0;for(const v of n.get(d)??[])p=Math.max(p,(r[v]??0)+1);if(p>=f)continue;const g=f;r[d]=p;const m=c_(t,r,i),y=H$(m,t.edges,r);y(e[i]??0)-(e[a]??0)||i.localeCompare(a));for(const i of n){const a=r(i);if(!a)continue;const s=t.edges.filter(m=>m.src===i);if(s.length===0)continue;let o=!1,l=0;for(const m of s){const y=r(m.dst);y==null||y===a?o=!0:l++}if(l===0||o)continue;let u=0,h=!1;for(const m of t.edges){if(m.dst!==i)continue;const y=r(m.src);y&&(y===a?h=!0:u++)}if(u>0||!h)continue;const d=e[i]??0,f=d+l;let p=0;for(const m of t.edges)m.dst===i&&(p=Math.max(p,(e[m.src]??0)+1));const g=Math.max(d,p,f);g!==d&&(e[i]=g)}}x(C1e,"adjustCrossLaneSources");function k1e(t,e){const r=Af(t),n=uS(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,a=Wh(r);let s=Object.create(null);for(const l of n){const u=MG(r,l),h=e!=null&&e.ignoreCrossLaneEdges?u.filter(d=>{const f=a(d.src),p=a(l);return!f||!p?!0:f===p}):u;if(h.length===0)s[l]=0;else if(i&&h.length===1){const d=h[0].src,f=a(d),p=a(l);f!==p?s[l]=s[d]??0:s[l]=(s[d]??0)+1}else{let d=-1/0;for(const f of h)d=Math.max(d,(s[f.src]??0)+1);s[l]=d===-1/0?0:d}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(s=w1e(r,s)),e!=null&&e.ignoreCrossLaneEdges&&C1e(r,s),{layers:c_(r,s,a),rankOf:s,dummy:new Set}}x(k1e,"assignLayers_LongestPath");function S1e(t,e){const r=Af(t),i={...k1e(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},a=Wh(r),{preds:s,succs:o}=eL(r,g=>{if(e!=null&&e.ignoreCrossLaneEdges){const m=a(g.src),y=a(g.dst);if(m&&y&&m!==y)return!1}return!0}),l=uS(r)??[...r.nodes],u=[...l].reverse(),h=x((g,m)=>{let y=0;for(const b of s.get(g)??[])y=Math.max(y,(i[b]??0)+1);let v=Number.POSITIVE_INFINITY;const T=o.get(g)??[];return T.length>0&&(v=Math.min(...T.map(b=>(i[b]??0)-1))),Number.isFinite(v)||(v=Math.max(y,m)),Math.min(Math.max(m,y),v)},"clampFeasible"),d=l_.GRAVITY_ITERATIONS,f=x(g=>{let m=!1;for(const y of g){const v=s.get(y)??[],T=o.get(y)??[];if(v.length===0&&T.length===0)continue;const b=v.length>0?v.reduce((k,E)=>k+(i[E]??0)+1,0)/v.length:i[y]??0,w=T.length>0?T.reduce((k,E)=>k+(i[E]??0)-1,0)/T.length:i[y]??0,C=Math.round((b+w)/2),S=h(y,C);S!==i[y]&&(i[y]=S,m=!0)}return m},"relaxOrder");for(let g=0;g0){const y=Math.min(...m.map(v=>(i[v]??0)-1));(i[g]??0)>y&&(i[g]=y)}}return{layers:OG(r,l,i),rankOf:i,dummy:new Set}}x(S1e,"assignLayers_Gravity");function E1e(t){const e=NG(t),r=IG(t);let n=DG(e);const i=[];for(;n.length>0;){const a=[];for(const s of n){i.push(s);for(const o of r.get(s)??[])e.set(o,(e.get(o)??0)-1),(e.get(o)??0)===0&&a.push(o)}n=a.sort((s,o)=>s.localeCompare(o))}return i.length===t.nodes.length?i:null}x(E1e,"topoSortByGenerationIfAcyclic");function A1e(t,e){const r=Af(t),n=(e==null?void 0:e.direction)==="LR"?E1e(r)??[...r.nodes].sort():uS(r)??[...r.nodes].sort(),i=Wh(r),a=x(h=>i(h)??h,"laneOf"),s=Object.create(null),o=new Map,l=x((h,d)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?a(h)===a(d)?1:0:1,"edgeWeight");for(const h of n){const d=r.nodeById.get(h);if(d!=null&&d.isGroup)continue;const f=MG(r,h);let p=0;if(f.length>0)for(const v of f){const T=v.src,b=s[T]??0;p=Math.max(p,b+l(T,h))}const g=a(h),m=o.get(g)??0,y=Math.max(p,m);s[h]=y,o.set(g,y+1)}return{layers:OG(r,n,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}x(A1e,"assignLayers_LaneAwareCompact");function _1e(t,e){const r=Af(e),{rankOf:n}=t,i=t.layers.map(p=>[...p]),a=new Set(t.dummy?[...t.dummy]:[]);let s=0;const o=new Map(r.nodeById),l=x(p=>{const g=`placeholder-${s++}`,m={id:g,isGroup:!1,isDummy:!0,width:0,height:0};for(o.set(g,m),a.add(g);i.length<=p;)i.push([]);return i[p].push(g),n[g]=p,g},"addDummyAt"),u=[...r.edges].sort((p,g)=>p.id===g.id?p.src===g.src?p.dst.localeCompare(g.dst):p.src.localeCompare(g.src):p.id.localeCompare(g.id)),h=[];for(const p of u){const g=n[p.src]??0,m=n[p.dst]??0;if(m-g<=1){h.push(p);continue}let y=p.src;for(let T=g+1,b=0;T!r.nodes.includes(p))],edges:h,layout:r.layout,nodeById:o};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:f}}x(_1e,"makeProperLayering");function q$(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const r=[...t].sort((n,i)=>n-i);return e%2===1?r[(e-1)/2]:.5*(r[e/2-1]+r[e/2])}x(q$,"median");function U$(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}x(U$,"barycenter");function R1e(t,e,r,n){const i=new Map;for(const a of t)i.set(a,[]);for(const a of r)n==="down"?e.has(a.src)&&i.has(a.dst)&&i.get(a.dst).push(e.get(a.src)):e.has(a.dst)&&i.has(a.src)&&i.get(a.src).push(e.get(a.dst));return i}x(R1e,"neighborPositionsFor");function L1e(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}x(L1e,"currentOrderTieBreak");function Y$(t,e,r){const n=new Set(t),i=new Set(e),a=Gb(t),s=Gb(e),o=[];for(const u of r)n.has(u.src)&&i.has(u.dst)&&o.push({u:a.get(u.src),v:s.get(u.dst)});o.sort((u,h)=>u.u===h.u?u.v-h.v:u.u-h.u);const l=o.map(u=>u.v);return $G(l)}x(Y$,"countCrossingsBetweenAdjacent");function a3(t,e,r){return[...t].sort((n,i)=>{const a=q$(e.get(n)??[]),s=q$(e.get(i)??[]);return a===s?L1e(n,i,r):isFinite(a)?isFinite(s)?a-s:-1:1})}x(a3,"sortByHeuristic");function X$(t,e,r,n,i,a){const s=Gb(t),o=Gb(e),l=R1e(e,s,r,n);if(!i||!a||a.length===0)return a3(e,l,o);const u=new Map;for(const f of e){const p=i(f),g=u.get(p)??[];g.push(f),u.set(p,g)}const h=[];for(const f of a){const p=u.get(f);if(!p||p.length===0)continue;const g=a3(p,l,o);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=a3(d,l,o);for(const p of f){const g=U$(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[y,v]of h.entries()){const T=U$(l.get(v)??[]);if(gs.has(m.src)&&o.has(m.dst)),h=l?r.filter(m=>o.has(m.src)&&l.has(m.dst)):void 0,d=x(m=>{let y=Y$(t,m,u);return h&&n&&(y+=Y$(m,n,h)),y},"crossingScore"),f=i?new Map:null;if(i&&f)for(const m of e)f.set(m,i(m));let p=!0,g=d(a);for(;p;){p=!1;for(let m=0;m+1[...o]),i=e.edges,a=Wh(e),s=PG(e,r==null?void 0:r.laneOrder);for(let o=0;o<3;o++){for(let l=1;l=0;l--)n[l]=X$(n[l+1],n[l],i,"up",a,s),n[l]=j$(n[l+1],n[l],i,n[l-1],a)}return{layers:n}}x(M1e,"orderLayers");function I1e(t,e,r){const n=(r==null?void 0:r.layerGap)??jQ.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??jQ.DEFAULT_NODE_GAP,a=(r==null?void 0:r.laneGap)??i*2,s=(r==null?void 0:r.direction)??"TB",o=s==="LR"||s==="RL",l=t.layers,u=Object.create(null),h=Object.create(null),d=x(M=>e.nodeById.get(M),"getNode"),f=x(M=>{var L;return((L=d(M))==null?void 0:L.width)??0},"getWidth"),p=x(M=>{var L;return((L=d(M))==null?void 0:L.height)??0},"getHeight"),g=Wh(e),m=PG(e,r==null?void 0:r.laneOrder),y=l.map(M=>M.reduce((L,P)=>Math.max(L,p(P)),0)),v=[];if(o)for(let M=0;M+1Math.max(N,f(F)),0),P=l[M+1].reduce((N,F)=>Math.max(N,f(F)),0),D=y[M],R=y[M+1],I=D/2+R/2,$=(L+P)/2,O=Math.max(0,$-I-n);v.push(O)}const T=new Set;for(const M of l)for(const L of M)T.add(g(L));const b=T.has(null),w=m.filter(M=>T.has(M)),C=[...b?[null]:[],...w],S=Object.create(null);for(const M of w)S[M]=0;b&&(S.null=0);for(const M of l){const L=Object.create(null),P=[];for(const D of M){const R=g(D);R===null?P.push(D):(L[R]||(L[R]=[])).push(D)}for(const[D,R]of Object.entries(L)){const I=R.reduce(($,O)=>$+f(O),0)+i*Math.max(0,R.length-1);S[D]=Math.max(S[D]??0,I)}if(b&&P.length){const D=P.reduce((R,I)=>R+f(I),0)+i*Math.max(0,P.length-1);S.null=Math.max(S.null??0,D)}}const k=new Map;{const M=C.map(D=>(D===null?S.null:S[D])??0);let P=-(M.reduce((D,R)=>D+R,0)+a*Math.max(0,C.length-1))/2;for(let D=0;Df(V)),F=N.reduce((V,B)=>V+B,0)+i*($.length-1);let z=O-F/2;for(const[V,B]of $.entries()){const G=N[V];u[B]=z+G/2,h[B]=E+P/2,z+=G+i}}}const R=v[M]??0;E+=P+n+R}const _=new Map;for(const M of e.edges){const L=M.ref.id;_.has(L)||_.set(L,[]),_.get(L).push(M)}for(const[,M]of _){if(M.length===0)continue;const L=M[0].ref,P=L.start,D=L.end;if(P==null||D==null)continue;const R=Math.round(((u[P]??0)+(u[D]??0))/2),I=new Set;for(const $ of M)I.add($.src),I.add($.dst);for(const $ of I){if($===P||$===D)continue;const O=e.nodeById.get($);O!=null&&O.isDummy&&(u[$]=R)}}return{x:u,y:h}}x(I1e,"assignCoordinates");var N1e=8;function D1e(t){let e=2166136261;for(let r=0;r>>0}x(D1e,"hashString");function O1e(t){let e=t>>>0;return()=>{e+=1831565813;let r=e;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}x(O1e,"mulberry32");function $1e(t,e){const r=[...t],n=O1e(e);for(let i=r.length-1;i>0;i--){const a=Math.floor(n()*(i+1));[r[i],r[a]]=[r[a],r[i]]}return r}x($1e,"deterministicShuffle");function P1e(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}x(P1e,"sourceDistance");function K$(t,e){const r=new Map;for(const[i,a]of t.entries())r.set(a,i);let n=0;for(const{a:i,b:a,weight:s}of e){const o=r.get(i),l=r.get(a);o==null||l==null||(n+=s*Math.abs(o-l))}return n}x(K$,"laneArrangementCost");function B1e(t){const e=tL(t);if(e.length<2)return[];const r=new Map(e.map((a,s)=>[a,s])),n=Wh(t),i=new Map;for(const a of t.layout.edges??[]){if(a.isLayoutOnly)continue;const s=typeof a.start=="string"?a.start:void 0,o=typeof a.end=="string"?a.end:void 0;if(!s||!o||!t.nodeById.has(s)||!t.nodeById.has(o))continue;const l=n(s),u=n(o);if(!l||!u||l===u)continue;const h=r.get(l),d=r.get(u);if(h==null||d==null)continue;const[f,p]=h<=d?[l,u]:[u,l],g=`${f}\0${p}`,m=i.get(g);m?m.weight++:i.set(g,{a:f,b:p,weight:1})}return[...i.values()]}x(B1e,"buildWeightedLaneEdges");function Z$(t,e,r){const n=[...t];let i=K$(n,e),a=!0,s=0;const o=Math.max(1,n.length);for(;a&&si.a===a.a?i.b.localeCompare(a.b):i.a.localeCompare(a.a)).map(({a:i,b:a,weight:s})=>`${i}:${a}:${s}`).join("|");return D1e(`${t.join("|")}#${n}#${r}`)}x(z1e,"seedForRestart");function V1e(t,e={}){const r=tL(t);if(r.length<2)return r;const n=B1e(t);if(n.length===0)return r;const i=new Map(r.map((o,l)=>[o,l]));let a=Z$(r,n,i);const s=Math.max(0,e.restarts??N1e);for(let o=0;oFr&&l*3>=o?s>0?"bottom":"top":o>Fr?a>0?"right":"left":r}x(Q$,"chooseOrthogonalSide");function J$(t,e){return Math.abs(t.to-e.from)se.isGroup&&!se.parentId);for(const se of u){const de={id:se.id},Te=x(ae=>{s.set(ae.id,de),r.filter(he=>he.parentId===ae.id).forEach(Te)},"assignLane");Te(se)}const h=r.filter(se=>!se.isGroup&&!se.isEdgeLabel).map(se=>{const de=se.width??10,Te=se.height??10,ae=se.x??0,he=se.y??0,W=xut;return{nodeId:se.id,minX:ae-de/2-W,maxX:ae+de/2+W,minY:he-Te/2-W,maxY:he+Te/2+W,visualXHalfExtent:l?Te/2+W:de/2+W}}),d=x((se,de,Te,ae)=>{let he=o.find(W=>W.orientation===se&&Math.abs(W.coord-de)<1);return he||(he={id:`pipe-${se}-${de.toFixed(0)}`,orientation:se,coord:de,spanMin:Te,spanMax:ae,tracks:[]},o.push(he)),he.spanMin=Math.min(he.spanMin,Te),he.spanMax=Math.max(he.spanMax,ae),he},"getOrAddPipe"),f=x((se,de)=>{const Te=se.width??10,ae=se.height??10,he=se.x??0,W=se.y??0;switch(de){case"top":return{x:he,y:W-ae/2};case"bottom":return{x:he,y:W+ae/2};case"left":return{x:he-Te/2,y:W};case"right":return{x:he+Te/2,y:W}}},"portForSide"),p=x((se,de,Te)=>f(se,Q$(se,de,Te?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],y=new Set,v=1e3,T=x((se,de,Te)=>{if(g.length===0)return 0;const ae=Math.abs(de.y-Te.y)ue||X.from-Fr<=ne&&X.to+Fr>=ne&&(W+=v)}else if(he){const ne=de.x,j=Math.min(de.y,Te.y)-Fr,ue=Math.max(de.y,Te.y)+Fr;if(ue<=j)return 0;for(const X of g)X.edgeIndex===se||X.orientation!=="horizontal"||X.pipe.coordue||X.from-Fr<=ne&&X.to+Fr>=ne&&(W+=v)}return W},"crossingPenalty"),b=i.map((se,de)=>{if(!se.start||!se.end)return{idx:de,crossLane:0,dx:0,dy:0};const Te=a.get(se.start),ae=a.get(se.end),he=s.get(se.start),W=s.get(se.end),ne=he&&W&&he.id!==W.id?1:0,j=Te&&ae?Math.abs((ae.x??0)-(Te.x??0)):0,ue=Te&&ae?Math.abs((ae.y??0)-(Te.y??0)):0;return{idx:de,crossLane:ne,dx:j,dy:ue}}).sort((se,de)=>{if(se.crossLane!==de.crossLane)return de.crossLane-se.crossLane;const Te=se.dx+se.dy,ae=de.dx+de.dy;return Math.abs(Te-ae)>1?Te-ae:se.idx-de.idx}).map(se=>se.idx),w=x((se,de,Te,ae)=>{const he=Math.min(se.x,de.x),W=Math.max(se.x,de.x),ne=Math.min(se.y,de.y),j=Math.max(se.y,de.y);return!!h.find(X=>Te&&X.nodeId===Te||ae&&X.nodeId===ae?!1:Math.abs(se.x-de.x)>Fr?X.minYse.y&&X.maxX>he&&X.minXse.x&&X.maxY>ne&&X.minYQ$(se,de,"bottom"),"determineSide"),E=new Map;for(const[se,de]of i.entries()){if(!de.start||!de.end||de.start===de.end||de.points&&de.points.length>0)continue;const Te=a.get(de.start),ae=a.get(de.end);if(!Te||!ae)continue;const he=(ae.x??0)-(Te.x??0),W=(ae.y??0)-(Te.y??0);E.set(se,{edgeIdx:se,srcId:de.start,dstId:de.end,srcSide:k(Te,{x:ae.x??0,y:ae.y??0}),dstSide:k(ae,{x:Te.x??0,y:Te.y??0}),absDx:Math.abs(he),absDy:Math.abs(W),dxSign:Math.sign(he),dySign:Math.sign(W)})}const _=x(se=>se.srcSide==="top"||se.srcSide==="bottom"?se.absDx===0?1/0:se.absDy/se.absDx:se.absDy===0?1/0:se.absDx/se.absDy,"preferenceStrength"),M=x(se=>se.srcSide==="top"||se.srcSide==="bottom"?se.dxSign>=0?"right":"left":se.dySign>=0?"bottom":"top","secondarySide"),L=new Map;for(const se of E.values()){const de=`${se.srcId}:${se.srcSide}`;L.has(de)||L.set(de,[]),L.get(de).push(se)}const P=new Map,D=x((se,de)=>`${se}:${de}`,"loadKey");for(const se of E.values())P.set(D(se.srcId,se.srcSide),(P.get(D(se.srcId,se.srcSide))??0)+1),P.set(D(se.dstId,se.dstSide),(P.get(D(se.dstId,se.dstSide))??0)+1);for(const se of L.values())if(!(se.length<2)){se.sort((de,Te)=>{const ae=_(de),he=_(Te);return Math.abs(ae-he)>1e-9?he-ae:de.edgeIdx-Te.edgeIdx});for(let de=1;de=he||(P.set(D(Te.srcId,Te.srcSide),he-1),P.set(D(Te.srcId,ae),W+1),Te.srcSide=ae)}}const R=x(se=>{const de=se==null?void 0:se.shape;return de==="question"||de==="diamond"},"isDiamondNode"),I=new Map;for(const se of E.values())I.has(se.dstId)||I.set(se.dstId,new Set),I.get(se.dstId).add(se.dstSide);for(const se of E.values()){if(!R(a.get(se.srcId)))continue;const de=I.get(se.srcId);if(!(de!=null&&de.has(se.srcSide)))continue;const Te=M(se);if(de.has(Te)||(P.get(D(se.srcId,Te))??0)>0)continue;const ae=P.get(D(se.srcId,se.srcSide))??0;P.set(D(se.srcId,se.srcSide),Math.max(0,ae-1)),P.set(D(se.srcId,Te),1),se.srcSide=Te}for(const se of E.values()){const{edgeIdx:de,srcId:Te,dstId:ae,srcSide:he,dstSide:W}=se,ne=a.get(Te),j=a.get(ae),ue=`${Te}:${he}:src`,X=he==="top"||he==="bottom"?j.x??0:j.y??0;C.has(ue)||C.set(ue,[]),C.get(ue).push({edgeIdx:de,oppositeCoord:X});const Oe=`${ae}:${W}:dst`,xe=W==="top"||W==="bottom"?ne.x??0:ne.y??0;C.has(Oe)||C.set(Oe,[]),C.get(Oe).push({edgeIdx:de,oppositeCoord:xe})}const $=new Map,O=8;for(const[se,de]of C){if(de.length<2)continue;de.sort((He,De)=>He.oppositeCoord-De.oppositeCoord);const Te=se.split(":"),ae=Te.slice(0,-2).join(":"),he=Te[Te.length-2],W=Te[Te.length-1],ne=a.get(ae);if(!ne)continue;const ue=he==="left"||he==="right"?ne.height??10:ne.width??10,X=ne.shape,xe=X==="question"||X==="diamond"?ue*.3:ue,_e=Math.min(20,Math.max(O,xe/(de.length+1))),Me=-(_e*(de.length-1))/2;for(const[He,De]of de.entries()){const Ke=Me+He*_e,Ae=`${De.edgeIdx}:${W}`;$.set(Ae,Ke)}}const N=x(se=>{var de;return!!((de=i[se])!=null&&de.labelNodeId)},"edgeHasLabelNode"),F=x((se,de)=>se?(C.get(`${se}:${de}:src`)??[]).some(({edgeIdx:Te})=>N(Te))||(C.get(`${se}:${de}:dst`)??[]).some(({edgeIdx:Te})=>N(Te)):!1,"faceHasLabelNode"),z=x((se,de,Te)=>de==="top"||de==="bottom"?{x:se.x+Te,y:se.y}:{x:se.x,y:se.y+Te},"applyPortOffset"),V=x((se,de,Te)=>{const ae=E.get(se),he={x:Te.x??0,y:Te.y??0},W={x:de.x??0,y:de.y??0},ne=(ae==null?void 0:ae.srcSide)??k(de,he),j=(ae==null?void 0:ae.dstSide)??k(Te,W);let ue=ae?f(de,ae.srcSide):p(de,he,!0),X=ae?f(Te,ae.dstSide):p(Te,W,!1);const Oe=$.get(`${se}:src`),xe=$.get(`${se}:dst`);return Oe!==void 0&&(ue=z(ue,ne,Oe)),xe!==void 0&&(X=z(X,j,xe)),{pSrcPort:ue,pDstPort:X,srcSide:ne,dstSide:j}},"portsForEdge");for(const se of b){const de=i[se];if(m[se]=[],!de.start||!de.end||de.points&&de.points.length>0||de.start===de.end)continue;const Te=a.get(de.start),ae=a.get(de.end);if(!Te||!ae)continue;const{pSrcPort:he,pDstPort:W,srcSide:ne,dstSide:j}=V(se,Te,ae),ue={...he},X={...W},Oe=ne==="top"||ne==="bottom",xe=j==="top"||j==="bottom";if(Oe){const Qe=he.y>(Te.y??0);ue.y=Qe?he.y+Jo:he.y-Jo}else{const Qe=he.x>(Te.x??0);ue.x=Qe?he.x+Jo:he.x-Jo}if(xe){const Qe=W.y>(ae.y??0);X.y=Qe?W.y+Jo:W.y-Jo}else{const Qe=W.x>(ae.x??0);X.x=Qe?W.x+Jo:W.x-Jo}const Ge=x((Qe,ct)=>{for(const It of h)if(!ct.includes(It.nodeId)&&Qe.x>It.minX&&Qe.xIt.minY&&Qe.y{if(Or){const xt=Qe.y>(ct.y??0);return{x:(It.x??0)>=Qe.x?cr.maxX+jf:cr.minX-jf,y:xt?cr.maxY+Xg:cr.minY-Xg,leavesPositiveSide:xt}}const yt=Qe.x>(ct.x??0),it=(It.y??0)>=Qe.y;return{x:yt?cr.maxX+jf:cr.minX-jf,y:it?cr.maxY+Xg:cr.minY-Xg,leavesPositiveSide:yt}},"obstacleDetour");let $e=[];const Me=[de.start,de.end],He=Ge(ue,Me);if(He.inside&&He.obstacle){const Qe=He.obstacle;if(Oe){const ct=_e(he,Te,ae,Qe,!0);ue.x=ct.x,ue.y=ct.y;const It=ct.leavesPositiveSide?Math.min(Qe.minY-2,he.y+Jo):Math.max(Qe.maxY+2,he.y-Jo);$e=[{x:he.x,y:It},{x:ct.x,y:It},{x:ct.x,y:ct.y}]}else{const ct=_e(he,Te,ae,Qe,!1),It=ct.leavesPositiveSide?Math.min(Qe.minX-2,he.x+Jo):Math.max(Qe.maxX+2,he.x-Jo);ue.x=ct.x,ue.y=ct.y,$e=[{x:It,y:he.y},{x:It,y:ct.y},{x:ct.x,y:ct.y}]}}let De=[];const Ke=Ge(X,Me);if(Ke.inside&&Ke.obstacle){const Qe=Ke.obstacle;if(xe){const ct=_e(W,ae,Te,Qe,!0);X.x=ct.x,X.y=ct.y,De=[{x:ct.x,y:ct.y},{x:W.x,y:ct.y}]}else{const ct=_e(W,ae,Te,Qe,!1);X.x=ct.x,X.y=ct.y,De=[{x:ct.x,y:ct.y},{x:ct.x,y:W.y}]}}if($e.length===0&&De.length===0){const Qe=jf,ct=Math.abs(ue.x-X.x)1||yt>1,xt=S.get(de.start??"")??0,nt=S.get(de.end??"")??0,Ht=Or>1&&F(de.start,ne)||yt>1&&F(de.end,j),ke=Or<=1||xt<=2,rn=yt<=1||nt<=2;if((ct||It)&&!cr&&(!it||it&&!Ht&&ke&&rn)&&!w(he,W,de.start,de.end)){de.points=[{...he},{...ue},{...X},{...W}],y.add(se);const nn=It?"horizontal":"vertical",Bi=It?he.y:he.x,Qr=It?Math.min(he.x,W.x):Math.min(he.y,W.y),bn=It?Math.max(he.x,W.x):Math.max(he.y,W.y),Yr={id:`fast-path-${nn}-${Bi.toFixed(0)}-${se}`,orientation:nn,coord:Bi,spanMin:Qr,spanMax:bn,tracks:[]};g.push({edgeIndex:se,segmentIndex:0,orientation:nn,pipe:Yr,trackIndex:0,from:Qr,to:bn});continue}}const Ae=d("vertical",ue.x,ue.y,ue.y);ue.x=Ae.coord;const at=d("vertical",X.x,X.y,X.y);X.x=at.coord;let Ee=Math.min(ue.x,X.x)-50,pt=Math.max(ue.x,X.x)+50,ht=Math.min(ue.y,X.y)-50,rt=Math.max(ue.y,X.y)+50;for(const Qe of h){const ct=Math.min(ue.x,X.x),It=Math.max(ue.x,X.x),cr=Math.min(ue.y,X.y),Or=Math.max(ue.y,X.y);Qe.minXct&&Qe.minYcr&&(Ee=Math.min(Ee,Qe.minX-qE),pt=Math.max(pt,Qe.maxX+qE),ht=Math.min(ht,Qe.minY-qE),rt=Math.max(rt,Qe.maxY+qE))}for(const Qe of h){if(Qe.maxXpt||Qe.maxYrt)continue;const ct=jf;d("horizontal",Qe.minY-ct,Ee,pt),d("horizontal",Qe.maxY+ct,Ee,pt);const It=Xg;d("vertical",Qe.minX-It,ht,rt),d("vertical",Qe.maxX+It,ht,rt)}d("horizontal",ue.y,Ee,pt),d("horizontal",X.y,Ee,pt);const Et=o.filter(Qe=>Qe.orientation==="horizontal"&&Qe.coord>=ht&&Qe.coord<=rt),vt=o.filter(Qe=>Qe.orientation==="vertical"&&Qe.coord>=Ee&&Qe.coord<=pt),ot=x((Qe,ct)=>`${Qe.toFixed(1)},${ct.toFixed(1)}`,"getKey"),pe=ot(ue.x,ue.y),Ct=ot(X.x,X.y),lt=new Map,st=new Map,mt=new Map,_r=new Set,Se=[];lt.set(pe,0),mt.set(pe,"n"),Se.push({key:pe,f:Math.hypot(X.x-ue.x,X.y-ue.y),pt:ue}),_r.add(pe);let Ue=[];const tt=x((Qe,ct)=>w(Qe,ct,de.start,de.end),"checkSegmentBlocked"),kt={x:X.x,y:ue.y},Nt=tt(ue,kt),sr=tt(kt,X),Qt=Nt||sr,vr={x:ue.x,y:X.y},nr=tt(ue,vr),Rr=tt(vr,X);if(Qt?nr||Rr||(Math.abs(ue.x-X.x)0;){Se.sort((nt,Ht)=>nt.f-Ht.f);const Qe=Se.shift();if(_r.delete(Qe.key),Qe.key===Ct){let nt=Ct,Ht=X;for(Ue=[Ht];st.has(nt);){const ke=st.get(nt);Ue.unshift(ke),Ht=ke,nt=ot(ke.x,ke.y)}break}const ct=Qe.pt.x,It=Qe.pt.y,cr=vt.sort((nt,Ht)=>nt.coord-Ht.coord),Or=cr.findIndex(nt=>Math.abs(nt.coord-ct)<1),yt=Et.sort((nt,Ht)=>nt.coord-Ht.coord),it=yt.findIndex(nt=>Math.abs(nt.coord-It)<1),xt=[];Or>0&&xt.push({x:cr[Or-1].coord,y:It}),Or>=0&&Or0&&xt.push({x:ct,y:yt[it-1].coord}),it>=0&&itdt.nodeId===de.start||dt.nodeId===de.end?!1:Ht!==ke?dt.minYIt&&dt.maxX>Ht&&dt.minXct&&dt.maxY>rn&&dt.minY10&&xu<-5||Da<-10&&xu>5)&&(bn=Math.abs(xu)*100),(Yr>10&&gc<-5||Yr<-10&&gc>5)&&(bn+=Math.abs(gc)*50);let Vf=0;const Tu=mt.get(Qe.key)??"n",wu=Math.abs(gc)>Fr?"h":"v";Tu!=="n"&&Tu!==wu&&(Vf=50);const wt=Bi+Qr+bn+Vf,Le=(lt.get(Qe.key)??1/0)+wt,je=Math.abs(X.x-nt.x)+Math.abs(X.y-nt.y);if(Le<(lt.get(nn)??1/0))if(st.set(nn,Qe.pt),lt.set(nn,Le),mt.set(nn,wu),!_r.has(nn))Se.push({key:nn,f:Le+je,pt:nt}),_r.add(nn);else{const dt=Se.findIndex(Ft=>Ft.key===nn);dt!==-1&&(Se[dt].f=Le+je)}}}if(Ue.length===0&&(Ue=[ue,{x:ue.x,y:X.y},X]),Ue.length>4){const Qe=Ue[0],ct=Ue[Ue.length-1];let It=Math.min(Qe.x,ct.x),cr=Math.max(Qe.x,ct.x),Or=Math.min(Qe.y,ct.y),yt=Math.max(Qe.y,ct.y);for(const rn of Ue)It=Math.min(It,rn.x),cr=Math.max(cr,rn.x),Or=Math.min(Or,rn.y),yt=Math.max(yt,rn.y);const it=cr>Math.max(Qe.x,ct.x),xt=ItQr.minXNe&&Qr.minYMr);if(Bi.length>0){let Qr=Math.max(Qe.x,ct.x);for(const bn of Bi){const Yr=(bn.minX+bn.maxX)/2;if(bn.visualXHalfExtent===void 0||isNaN(bn.visualXHalfExtent))continue;const Da=Yr+bn.visualXHalfExtent+rn;Qr=Math.max(Qr,Da)}isNaN(Qr)||(cr=Qr)}}if(xt){const Ne=h.filter(Mr=>Mr.minXMath.min(Qe.y,ct.y));if(Ne.length>0){let Mr=Math.min(Qe.x,ct.x);for(const nn of Ne){const Qr=(nn.minX+nn.maxX)/2-nn.visualXHalfExtent-rn;Mr=Math.min(Mr,Qr)}It=Mr}}}const nt=x(rn=>{const Ne=ct.y>Qe.y,Mr=h.filter(Qr=>{const bn=Math.min(Qe.x,ct.x)Qr.minX,Yr=Math.min(Qe.y,ct.y)Qr.minY;return bn&&Yr});let nn=Mr;if(l&&Mr.length>0){const Qr=Mr.filter(bn=>bn.minXrn);Qr.length>0&&(nn=Qr)}if(nn.length===0)return ct.y;const Bi=jf;if(Ne){const bn=Math.max(...nn.map(Yr=>Yr.maxY))+Bi;if(bnYr.minY))-Bi;if(bn>ct.y+Fr)return bn}return ct.y},"findBestReturnY"),Ht=x(rn=>{const Ne=nt(rn),Mr={x:rn,y:Qe.y},nn={x:rn,y:Ne},Bi={x:ct.x,y:Ne},Qr=tt(Qe,Mr),bn=tt(Mr,nn),Yr=tt(nn,Bi),Da=Ne!==ct.y?tt(Bi,ct):!1;return!Qr&&!bn&&!Yr&&!Da?Math.abs(Ne-ct.y)=3){const Qe=gr[gr.length-1],ct=gr[gr.length-2],It=gr[gr.length-3],cr=Math.abs(It.y-ct.y)Math.abs(Qe.x-It.x)&&gr.splice(-2,1)}else if(Or){const yt=Math.sign(ct.y-It.y),it=Math.sign(Qe.y-It.y);yt!==0&&yt===it&&Math.abs(ct.y-It.y)>Math.abs(Qe.y-It.y)&&gr.splice(-2,1)}}const Dr=[gr[0]];for(let Qe=1;Qect.x,yt=cr.x>It.x;if(Or!==yt){Dr.push(It);continue}continue}if(Math.abs(ct.x-It.x)ct.y,yt=cr.y>It.y;if(Or!==yt){Dr.push(It);continue}continue}Dr.push(It)}Dr.push(gr[gr.length-1]);for(let Qe=0;Qese.from{const he=!ae.segments.some(ne=>(ne.edgeIndex!==de.edgeIndex||ne.segmentIndex!==de.segmentIndex)&&B(ne,se)),W=!Te.segments.some(ne=>(ne.edgeIndex!==se.edgeIndex||ne.segmentIndex!==se.segmentIndex)&&B(ne,de));return he&&W?(se.trackIndex=ae.index,de.trackIndex=Te.index,Te.segments=[...Te.segments.filter(ne=>ne.edgeIndex!==se.edgeIndex||ne.segmentIndex!==se.segmentIndex),{edgeIndex:de.edgeIndex,segmentIndex:de.segmentIndex,from:de.from,to:de.to}],ae.segments=[...ae.segments.filter(ne=>ne.edgeIndex!==de.edgeIndex||ne.segmentIndex!==de.segmentIndex),{edgeIndex:se.edgeIndex,segmentIndex:se.segmentIndex,from:se.from,to:se.to}],!0):!1},"trySwapSegmentsAcrossTracks"),H=x(se=>{const de=se.tracks.length;return se.tracks[de]={index:de,coord:se.coord,segments:[]},de},"createNewTrack"),q=x((se,de)=>{const Te=se.pipe.tracks[se.trackIndex];Te.segments=Te.segments.filter(he=>he.edgeIndex!==se.edgeIndex||he.segmentIndex!==se.segmentIndex),se.trackIndex=de,se.pipe.tracks[de].segments.push({edgeIndex:se.edgeIndex,segmentIndex:se.segmentIndex,from:se.from,to:se.to})},"moveSegmentToTrack"),Z=x((se,de)=>{const Te=m[se.edgeIndex];for(const ae of Te){const he=g[ae];he.pipe===se.pipe&&q(he,de)}},"moveSegmentChainToTrack"),Y=x(se=>{const de=m[se.edgeIndex],Te=de.indexOf(g.indexOf(se)),ae=[];return Te>0&&ae.push(g[de[Te-1]]),Te{if(se.orientation===de.orientation)return!1;const Te=se.orientation==="horizontal"?se:de,ae=se.orientation==="horizontal"?de:se;return ae.pipe.coord>Te.from&&ae.pipe.coordae.from&&Te.pipe.coord{for(const Te of se.tracks)if(!Te.segments.some(he=>(he.edgeIndex!==de.edgeIndex||he.segmentIndex!==de.segmentIndex)&&B(he,de)))return Te.index;return-1},"findAvailableTrack"),Q=x((se,de)=>{if(se.trackIndex===de.trackIndex)return B(se,de);const Te=Y(se),ae=Y(de);return Te.some(he=>ae.some(W=>ie(he,W)))},"segmentsConflict"),te=x((se,de,Te)=>{if(G(se,de,se.pipe.tracks[se.trackIndex],de.pipe.tracks[de.trackIndex]))return;const ae=K(se.pipe,de);Te(de,ae!==-1?ae:H(se.pipe))},"resolveTrackConflict"),J=x(se=>{let de=0;for(let Te=0;Te{if(ge.has(se))return ge.get(se);const de=m[se];if(de.length===0){const j={dest:0,deviation:0,base:0,delta:0};return ge.set(se,j),j}const ae=g[de[0]].pipe.coord;let he=ae;for(let j=1;jMath.abs(Oe-ae)?X:Oe;break}}const W=Math.abs(he-ae),ne={dest:he,deviation:W,base:ae,delta:he-ae};return ge.set(se,ne),ne},"getDestInfo"),Re=x(()=>{let se=0;const de=new Map;for(const[ae,he]of i.entries())m[ae].length!==0&&he.start&&(de.has(he.start)||de.set(he.start,[]),de.get(he.start).push(ae));const Te=x(ae=>{const he=i[ae];if(!he.start||!he.end)return 0;const W=a.get(he.start),ne=a.get(he.end);if(!W||!ne)return 0;const j=(ne.x??0)-(W.x??0),ue=(ne.y??0)-(W.y??0);return Math.abs(j)+Math.abs(ue)},"getEdgeDistance");for(const ae of de.values()){ae.sort((W,ne)=>{const j=ee(W),ue=ee(ne);if(Math.abs(j.deviation-ue.deviation)>1)return j.deviation-ue.deviation;if(Math.abs(j.dest-ue.dest)>1)return j.dest-ue.dest;const X=Te(W),Oe=Te(ne);if(Math.abs(X-Oe)>1)return Oe-X;const xe=m[W].length,Ge=m[ne].length;if(xe!==Ge)return xe-Ge;if(xe===1){const _e=m[W][0],$e=m[ne][0];if(g[_e]&&g[$e]){const Me=g[_e],He=g[$e],De=Math.abs(Me.to-Me.from),Ke=Math.abs(He.to-He.from);if(Math.abs(De-Ke)>1)return De-Ke}}return 0});const he=ae.map(W=>g[m[W][0]]);se+=J(he)}return se},"fixSourceHandleCrossings"),Ie=x(()=>{let se=0;const de=new Map;for(const[Te,ae]of i.entries())m[Te].length!==0&&ae.end&&(de.has(ae.end)||de.set(ae.end,[]),de.get(ae.end).push(Te));for(const Te of de.values()){Te.sort((he,W)=>{const ne=x(X=>{const Oe=m[X];if(Oe.length<2)return 0;const xe=g[Oe[Oe.length-2]];return Math.abs(xe.to-xe.from)},"getDist"),j=ne(he),ue=ne(W);return Math.abs(j-ue)>.1?j-ue:he-W});const ae=Te.map(he=>g[m[he][m[he].length-1]]);se+=J(ae)}return se},"fixTargetHandleCrossings"),Be=x(()=>{let se=0;for(const de of o){const Te=[];for(const ae of de.tracks)for(const he of ae.segments){const W=m[he.edgeIndex].find(ne=>g[ne].segmentIndex===he.segmentIndex);W!==void 0&&Te.push(g[W])}Te.sort((ae,he)=>ae.edgeIndex-he.edgeIndex||ae.segmentIndex-he.segmentIndex);for(let ae=0;ae{ae.segments.forEach(he=>{de.push({edgeIndex:he.edgeIndex,segmentIndex:he.segmentIndex,trackIndex:ae.index,from:he.from,to:he.to})})}),de.sort((ae,he)=>ae.from-he.from);const Te=[];if(de.length>0){let ae=[de[0]],he=de[0].to;for(let W=1;Whe.add(_e.trackIndex));const W=new Map;ae.forEach(_e=>{const $e=ee(_e.edgeIndex);W.set(_e.trackIndex,(W.get(_e.trackIndex)??0)+$e.delta)});const ne=[...he].filter(_e=>(W.get(_e)??0)<-1),j=[...he].filter(_e=>(W.get(_e)??0)>1),ue=[...he].filter(_e=>Math.abs(W.get(_e)??0)<=1);ne.sort((_e,$e)=>(W.get($e)??0)-(W.get(_e)??0)),j.sort((_e,$e)=>(W.get(_e)??0)-(W.get($e)??0));const X=x((_e,$e)=>{ae.filter(Me=>Me.trackIndex===_e).forEach(Me=>{const He=y.has(Me.edgeIndex)?se.coord:$e;be.set(`${Me.edgeIndex}-${Me.segmentIndex}`,He)})},"assignCoord");let Oe=0;for(const _e of ne)Oe++,X(_e,se.coord-Oe*MI);if(ue.length===0&&he.size>0){const _e=[...he].sort((He,De)=>Math.abs(W.get(He)??0)-Math.abs(W.get(De)??0))[0],$e=ne.indexOf(_e);$e!==-1&&ne.splice($e,1);const Me=j.indexOf(_e);Me!==-1&&j.splice(Me,1),ue.push(_e)}let xe=0;for(const _e of ue){if(xe===0)X(_e,se.coord);else{const $e=xe%2===1?1:-1,Me=Math.ceil(xe/2);X(_e,se.coord+$e*Me*MI*.5)}xe++}let Ge=0;for(const _e of j)Ge++,X(_e,se.coord+Ge*MI)}}for(const[se,de]of i.entries()){const Te=m[se]??[];if(Te.length===0)continue;const ae=[],he=a.get(de.start),W=a.get(de.end),{pSrcPort:ne,pDstPort:j}=V(se,he,W),ue=Te.map(xe=>{const Ge=g[xe],_e=be.get(`${Ge.edgeIndex}-${Ge.segmentIndex}`)??Ge.pipe.coord;return{orient:Ge.orientation,coord:_e,from:Ge.from,to:Ge.to}});ae.push(ne);for(let xe=0;xeFr&&ae.push(lp(Ge,$e)),De&&He.orient===Ge.orient)if(Math.abs(Ge.coord-He.coord)>Fr){const Ke=Ge.orient==="vertical"?($e+He.from)/2:J$(Ge,He);ae.push(lp(Ge,Ke),lp(He,Ke))}else(xe===0||xe===ue.length-2)&&ae.push(lp(Ge,J$(Ge,He)));else if(De)ae.push(lp(Ge,He.coord));else{const Ke=Math.abs(Ge.from-$e)Fr||Math.abs(X.y-j.y)>Fr)&&ae.push(j);const Oe=[];ae.length>0&&Oe.push(ae[0]);for(let xe=1;xeFr||Math.abs(Ge.y-_e.y)>Fr)&&Oe.push(Ge)}de.points=Oe}for(const se of i){const de=se.__originalEdge;de&&se.points&&(de.points=se.points)}t.edges=(t.edges??[]).filter(se=>!se.isLayoutOnly);const fe=x((se,de)=>{const Te=de.x??0,ae=de.y??0,he=de.width??0,W=de.height??0;if(he<=0||W<=0)return se;const ne=Te-he/2,j=Te+he/2,ue=ae-W/2,X=ae+W/2;if(se.xj||se.yX)return se;const Oe=se.x-ne,xe=j-se.x,Ge=se.y-ue,_e=X-se.y,$e=Math.min(Oe,xe,Ge,_e);return $e===Oe?{x:ne,y:se.y}:$e===xe?{x:j,y:se.y}:$e===Ge?{x:se.x,y:ue}:{x:se.x,y:X}},"nodeBoundaryClamp");for(const se of t.edges){const de=se.points;if(!de||de.length<2)continue;const Te=se.start,ae=se.end,he=Te?a.get(Te):void 0,W=ae?a.get(ae):void 0;he&&(de[0]=fe(de[0],he)),W&&(de[de.length-1]=fe(de[de.length-1],W))}return t}x(W1e,"routeEdgesOrthogonal");function H1e(t){return t.direction??"TB"}x(H1e,"getSwimlaneDirection");function q1e(t){var h,d,f,p,g;const e=Aye(t),r=((h=t.config.flowchart)==null?void 0:h.nodeSpacing)??40,n=((d=t.config.flowchart)==null?void 0:d.rankSpacing)??100,i=((f=t.config.swimlane)==null?void 0:f.ignoreCrossLaneEdges)??!0,a=((p=t.config.swimlane)==null?void 0:p.optimizeRanksByCrossings)??!0,s=((g=t.config.swimlane)==null?void 0:g.automaticLaneOrdering)??!1,o=H1e(t),{ordered:l,coordinates:u}=G1e(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:s,direction:o});_ye(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;W1e(t,o);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return s1e(t,o),a1e(t),o}x(q1e,"runSwimlaneLayoutCore");async function U1e(t,e){const r=e.select("g");LV(r,t.markers,t.type,t.diagramId),Fpe(),Vpe(),vfe(),Hme(),Eye(t);const n=Rye(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await dye(r,t);q1e(t),await Cye(t,i)}x(U1e,"render");const Tut=Object.freeze(Object.defineProperty({__proto__:null,render:U1e},Symbol.toStringTag,{value:"Module"}));function eP(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw a}}}}function Y1e(t,e,r){return(e=X1e(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sut(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Eut(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function Aut(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _ut(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zi(t,e){return wut(t)||Eut(t,e)||FG(t,e)||Aut()}function u_(t){return Cut(t)||Sut(t)||FG(t)||_ut()}function Rut(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function X1e(t){var e=Rut(t,"string");return typeof e=="symbol"?e:e+""}function ca(t){"@babel/helpers - typeof";return ca=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ca(t)}function FG(t,e){if(t){if(typeof t=="string")return eP(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?eP(t,e):void 0}}var ra=typeof window>"u"?null:window,KQ=ra?ra.navigator:null;ra&&ra.document;var Lut=ca(""),j1e=ca({}),Mut=ca(function(){}),Iut=typeof HTMLElement>"u"?"undefined":ca(HTMLElement),hS=function(e){return e&&e.instanceString&&gi(e.instanceString)?e.instanceString():null},or=function(e){return e!=null&&ca(e)==Lut},gi=function(e){return e!=null&&ca(e)===Mut},Nn=function(e){return!Po(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},ln=function(e){return e!=null&&ca(e)===j1e&&!Nn(e)&&e.constructor===Object},Nut=function(e){return e!=null&&ca(e)===j1e},Dt=function(e){return e!=null&&ca(e)===ca(1)&&!isNaN(e)},Dut=function(e){return Dt(e)&&Math.floor(e)===e},h_=function(e){if(Iut!=="undefined")return e!=null&&e instanceof HTMLElement},Po=function(e){return dS(e)||K1e(e)},dS=function(e){return hS(e)==="collection"&&e._private.single},K1e=function(e){return hS(e)==="collection"&&!e._private.single},zG=function(e){return hS(e)==="core"},Z1e=function(e){return hS(e)==="stylesheet"},Out=function(e){return hS(e)==="event"},lf=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},$ut=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Put=function(e){return ln(e)&&Dt(e.x1)&&Dt(e.x2)&&Dt(e.y1)&&Dt(e.y2)},But=function(e){return Nut(e)&&gi(e.then)},Fut=function(){return KQ&&KQ.userAgent.match(/msie|trident|edge/i)},Wb=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;sr?1:0},Uut=function(e,r){return-1*J1e(e,r)},dr=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(y-=1),y<1/6?g+(m-g)*6*y:y<1/2?m:y<2/3?g+(m-g)*(2/3-y)*6:g}var d=new RegExp("^"+Gut+"$").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)o=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;o=Math.round(255*h(p,f,n+1/3)),l=Math.round(255*h(p,f,n)),u=Math.round(255*h(p,f,n-1/3))}r=[o,l,u,s]}return r},jut=function(e){var r,n=new RegExp("^"+zut+"$").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 o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},Kut=function(e){return Zut[e.toLowerCase()]},eve=function(e){return(Nn(e)?e:null)||Kut(e)||Yut(e)||jut(e)||Xut(e)},Zut={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]},tve=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||R<0||T&&I>=f}function E(){var D=e();if(k(D))return _(D);g=setTimeout(E,S(D))}function _(D){return g=void 0,b&&h?w(D):(h=d=void 0,p)}function M(){g!==void 0&&clearTimeout(g),y=0,h=m=d=g=void 0}function L(){return g===void 0?p:_(e())}function P(){var D=e(),R=k(D);if(h=arguments,d=this,m=D,R){if(g===void 0)return C(m);if(T)return clearTimeout(g),g=setTimeout(E,l),w(m)}return g===void 0&&(g=setTimeout(E,l)),p}return P.cancel=M,P.flush=L,P}return qI=s,qI}var oht=sht(),mS=fS(oht),UI=ra?ra.performance:null,ive=UI&&UI.now?function(){return UI.now()}:function(){return Date.now()},lht=(function(){if(ra){if(ra.requestAnimationFrame)return function(t){ra.requestAnimationFrame(t)};if(ra.mozRequestAnimationFrame)return function(t){ra.mozRequestAnimationFrame(t)};if(ra.webkitRequestAnimationFrame)return function(t){ra.webkitRequestAnimationFrame(t)};if(ra.msRequestAnimationFrame)return function(t){ra.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(ive())},1e3/60)}})(),d_=function(e){return lht(e)},Th=ive,Ep=9261,ave=65599,Tm=5381,sve=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ep,n=r,i;i=e.next(),!i.done;)n=n*ave+i.value|0;return n},JC=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ep;return r*ave+e|0},ek=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tm;return(r<<5)+r+e|0},cht=function(e,r){return e*2097152+r},ad=function(e){return e[0]*2097152+e[1]},YE=function(e,r){return[JC(e[0],r[0]),ek(e[1],r[1])]},dJ=function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},qG=function(e){e.splice(0,e.length)},bht=function(e,r){for(var n=0;n"u"?"undefined":ca(Set))!==Tht?Set:wht,iL=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!zG(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 Rx,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,o=e.pan(),l=e.zoom();a.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];Nn(r.classes)?u=r.classes:or(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hT?1:0},h=function(v,T,b,w,C){var S;if(b==null&&(b=0),C==null&&(C=n),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=v.length);bM;0<=M?_++:_--)E.push(_);return E}).apply(this).reverse(),k=[],w=0,C=S.length;wL;0<=L?++E:--E)P.push(s(v,b));return P},m=function(v,T,b,w){var C,S,k;for(w==null&&(w=n),C=v[b];b>T;){if(k=b-1>>1,S=v[k],w(C,S)<0){v[b]=S,b=k;continue}break}return v[b]=C},y=function(v,T,b){var w,C,S,k,E;for(b==null&&(b=n),C=v.length,E=T,S=v[T],w=2*T+1;w0;){var S=T.pop(),k=y(S),E=S.id();if(f[E]=k,k!==1/0)for(var _=S.neighborhood().intersect(g),M=0;M<_.length;M++){var L=_[M],P=L.id(),D=C(S,L),R=k+D.dist;R0)for(N.unshift(O);d[z];){var V=d[z];N.unshift(V.edge),N.unshift(V.node),F=V.node,z=F.id()}return o.spawn(N)}}}},Rht={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),o=n,l=function(w){for(var C=0;C0;){if(C(),k++,w===h){for(var E=[],_=a,M=h,L=v[M];E.unshift(_),L!=null&&E.unshift(L),_=y[M],_!=null;)M=_.id(),L=v[M];return{found:!0,distance:d[w],path:this.spawn(E),steps:k}}p[w]=!0;for(var P=b._private.edges,D=0;DL&&(g[M]=L,T[M]=_,b[M]=C),!a){var P=_*h+E;!a&&g[P]>L&&(g[P]=L,T[P]=E,b[P]=C)}}}for(var D=0;D1&&arguments[1]!==void 0?arguments[1]:s,be=b(ce),fe=[],Pe=be;;){if(Pe==null)return r.spawn();var ve=T(Pe),Ce=ve.edge,Ve=ve.pred;if(fe.unshift(Pe[0]),Pe.same(oe)&&fe.length>0)break;Ce!=null&&fe.unshift(Ce),Pe=Ve}return l.spawn(fe)},S=0;S=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===o&&r[p]===l||r[f]===l&&r[p]===o)&&u.splice(h,1)}for(var g=0;gi;){var a=Math.floor(Math.random()*r.length);r=Pht(a,e,r),n--}return r},Bht={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(N){return N.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/$ht);if(a<2){oi("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=r;a1&&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;s1&&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):(n0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}a&&e.sort(function(f,p){return f-p});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},Hht=function(e){return Math.PI*e/180},XE=function(e,r){return Math.atan2(r,e)-Math.PI/2},UG=Math.log2||function(t){return Math.log(t)/Math.log(2)},YG=function(e){return e>0?1:e<0?-1:0},V0=function(e,r){return Math.sqrt(cp(e,r))},cp=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},qht=function(e){for(var r=e.length,n=0,i=0;i=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}}},Yht=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},Xht=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},jht=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},fve=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},o3=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},l3=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 o=zi(r,4);n=o[0],i=o[1],a=o[2],s=o[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},vJ=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},XG=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},Dd=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},bJ=function(e,r){return Dd(e,r.x,r.y)},pve=function(e,r){return Dd(e,r.x1,r.y1)&&Dd(e,r.x2,r.y2)},Kht=(jI=Math.hypot)!==null&&jI!==void 0?jI:function(t,e){return Math.sqrt(t*t+e*e)};function Zht(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(E,_){return{x:E.x+_.x,y:E.y+_.y}},n=function(E,_){return{x:E.x-_.x,y:E.y-_.y}},i=function(E,_){return{x:E.x*_,y:E.y*_}},a=function(E,_){return E.x*_.y-E.y*_.x},s=function(E){var _=Kht(E.x,E.y);return _===0?{x:0,y:0}:{x:E.x/_,y:E.y/_}},o=function(E){for(var _=0,M=0;M7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?uf(a,s):l,h=a/2,d=s/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-o,y=i-d-o,v=n+h-u+o,T=y;if(g=Od(e,r,n,i,m,y,v,T,!1),g.length>0)return g}if(p){var b=n+h+o,w=i-d+u-o,C=b,S=i+d-u+o;if(g=Od(e,r,n,i,b,w,C,S,!1),g.length>0)return g}if(f){var k=n-h+u-o,E=i+d+o,_=n+h-u+o,M=E;if(g=Od(e,r,n,i,k,E,_,M,!1),g.length>0)return g}if(p){var L=n-h-o,P=i-d+u-o,D=L,R=i+d-u+o;if(g=Od(e,r,n,i,L,P,D,R,!1),g.length>0)return g}var I;{var $=n-h+u,O=i-d+u;if(I=JT(e,r,n,i,$,O,u+o),I.length>0&&I[0]<=$&&I[1]<=O)return[I[0],I[1]]}{var N=n+h-u,F=i-d+u;if(I=JT(e,r,n,i,N,F,u+o),I.length>0&&I[0]>=N&&I[1]<=F)return[I[0],I[1]]}{var z=n+h-u,V=i+d-u;if(I=JT(e,r,n,i,z,V,u+o),I.length>0&&I[0]>=z&&I[1]>=V)return[I[0],I[1]]}{var B=n-h+u,G=i+d-u;if(I=JT(e,r,n,i,B,G,u+o),I.length>0&&I[0]<=B&&I[1]>=G)return[I[0],I[1]]}return[]},Jht=function(e,r,n,i,a,s,o){var l=o,u=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,s),f=Math.max(i,s);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},edt=function(e,r,n,i,a,s,o,l,u){var h={x1:Math.min(n,o,a)-u,x2:Math.max(n,o,a)+u,y1:Math.min(i,l,s)-u,y2:Math.max(i,l,s)+u};return!(eh.x2||rh.y2)},tdt=function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var s=Math.sqrt(a),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},rdt=function(e,r,n,i,a){var s=1e-5;e===0&&(e=s),r/=e,n/=e,i/=e;var o,l,u,h,d,f,p,g;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,a[1]=0,p=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),a[0]=-p+d+f,p+=(d+f)/2,a[4]=a[2]=-p,p=Math.sqrt(3)*(-f+d)/2,a[3]=p,a[5]=-p;return}if(a[5]=a[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),a[0]=-p+2*g,a[4]=a[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),a[0]=-p+g*Math.cos(h/3),a[2]=-p+g*Math.cos((h+2*Math.PI)/3),a[4]=-p+g*Math.cos((h+4*Math.PI)/3)},ndt=function(e,r,n,i,a,s,o,l){var u=1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+i*i-4*i*s+2*i*l+4*s*s-4*s*l+l*l,h=9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*i*s-3*i*i-3*i*l-6*s*s+3*s*l,d=3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*i*i-6*i*s+i*l-i*r+2*s*s+2*s*r-l*r,f=1*n*a-n*n+n*e-a*e+i*s-i*i+i*r-s*r,p=[];rdt(u,h,d,f,p);for(var g=1e-7,m=[],y=0;y<6;y+=2)Math.abs(p[y+1])=0&&p[y]<=1&&m.push(p[y]);m.push(1),m.push(0);for(var v=-1,T,b,w,C=0;C=0?wu?(e-a)*(e-a)+(r-s)*(r-s):h-f},fo=function(e,r,n){for(var i,a,s,o,l,u=0,h=0;h=e&&e>=s||i<=e&&e<=s)l=(e-i)/(s-i)*(o-a)+a,l>r&&u++;else continue;return u%2!==0},wh=function(e,r,n,i,a,s,o,l,u){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),p=Math.sin(-d),g=0;g0){var y=g_(h,-u);m=p_(y)}else m=h;return fo(e,r,m)},adt=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h=0&&y<=1&&T.push(y),v>=0&&v<=1&&T.push(v),T.length===0)return[];var b=T[0]*l[0]+e,w=T[0]*l[1]+r;if(T.length>1){if(T[0]==T[1])return[b,w];var C=T[1]*l[0]+e,S=T[1]*l[1]+r;return[b,w,C,S]}else return[b,w]},KI=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Od=function(e,r,n,i,a,s,o,l,u){var h=e-a,d=n-e,f=o-a,p=r-s,g=i-r,m=l-s,y=f*p-m*h,v=d*p-g*h,T=m*d-f*g;if(T!==0){var b=y/T,w=v/T,C=.001,S=0-C,k=1+C;return S<=b&&b<=k&&S<=w&&w<=k?[e+b*d,r+b*g]:u?[e+b*d,r+b*g]:[]}else return y===0||v===0?KI(e,n,o)===o?[o,l]:KI(e,n,a)===a?[a,s]:KI(a,o,n)===n?[n,i]:[]:[]},odt=function(e,r,n,i,a){var s=[],o=i/2,l=a/2,u=r,h=n;s.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d0){var m=g_(d,-l);p=p_(m)}else p=d}else p=n;for(var y,v,T,b,w=0;w2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),y=1;yh&&(h=w)},get:function(b){return u[b]}},f=0;f0?I=R.edgesTo(D)[0]:I=D.edgesTo(R)[0];var $=i(I);D=D.id(),k[D]>k[L]+$&&(k[D]=k[L]+$,E.nodes.indexOf(D)<0?E.push(D):E.updateItem(D),S[D]=0,C[D]=[]),k[D]==k[L]+$&&(S[D]=S[D]+S[L],C[D].push(L))}else for(var O=0;O0;){for(var V=w.pop(),B=0;B0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},wdt=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:Sdt,o=i,l,u,h=0;h=2?dT(e,r,n,0,kJ,Edt):dT(e,r,n,0,CJ)},squaredEuclidean:function(e,r,n){return dT(e,r,n,0,kJ)},manhattan:function(e,r,n){return dT(e,r,n,0,CJ)},max:function(e,r,n){return dT(e,r,n,-1/0,Adt)}};Hb["squared-euclidean"]=Hb.squaredEuclidean;Hb.squaredeuclidean=Hb.squaredEuclidean;function sL(t,e,r,n,i,a){var s;return gi(t)?s=t:s=Hb[t]||Hb.euclidean,e===0&&gi(t)?s(i,a):s(e,r,n,i,a)}var _dt=ts({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),KG=function(e){return _dt(e)},m_=function(e,r,n,i,a){var s=a!=="kMedoids",o=s?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return sL(e,i.length,o,l,u,h)},QI=function(e,r,n){for(var i=n.length,a=new Array(i),s=new Array(i),o=new Array(r),l=null,u=0;un)return!1}return!0},Mdt=function(e,r,n){for(var i=0;io&&(o=r[u][h],l=h);a[l].push(e[u])}for(var d=0;d=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],m=r[i[s]],y;a.mode==="dendrogram"?y={left:g,right:m,key:g.key}:y={value:g.value.concat(m.value),key:g.key},e[g.index]=y,e.splice(m.index,1),r[g.key]=y;for(var v=0;vn[m.key][T.key]&&(l=n[m.key][T.key])):a.linkage==="max"?(l=n[g.key][T.key],n[g.key][T.key]0&&i.push(a);return i},LJ=function(e,r,n){for(var i=[],a=0;ao&&(s=u,o=r[a*e+u])}s>0&&i.push(s)}for(var h=0;hu&&(l=h,u=d)}n[a]=s[l]}return i=LJ(e,r,n),i},MJ=function(e){for(var r=this.cy(),n=this.nodes(),i=Wdt(e),a={},s=0;s=L?(P=L,L=R,D=I):R>P&&(P=R);for(var $=0;$0?1:0;k[_%i.minIterations*o+B]=G,V+=G}if(V>0&&(_>=i.minIterations-1||_==i.maxIterations-1)){for(var H=0,q=0;q1||S>1)&&(o=!0),d[b]=[],T.outgoers().forEach(function(E){E.isEdge()&&d[b].push(E.id())})}else f[b]=[void 0,T.target().id()]}):s.forEach(function(T){var b=T.id();if(T.isNode()){var w=T.degree(!0);w%2&&(l?u?o=!0:u=b:l=b),d[b]=[],T.connectedEdges().forEach(function(C){return d[b].push(C.id())})}else f[b]=[T.source().id(),T.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(a){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=s[0].id());var g=function(b){for(var w=b,C=[b],S,k,E;d[w].length;)S=d[w].shift(),k=f[S][0],E=f[S][1],w!=E?(d[E]=d[E].filter(function(_){return _!=S}),w=E):!a&&w!=k&&(d[k]=d[k].filter(function(_){return _!=S}),w=k),C.unshift(S),C.unshift(w);return C},m=[],y=[];for(y=g(h);y.length!=1;)d[y[0]].length==0?(m.unshift(s.getElementById(y.shift())),m.unshift(s.getElementById(y.shift()))):y=g(y.shift()).concat(y);m.unshift(s.getElementById(y.shift()));for(var v in d)if(d[v].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},KE=function(){var e=this,r={},n=0,i=0,a=[],s=[],o={},l=function(f,p){for(var g=s.length-1,m=[],y=e.spawn();s[g].x!=f||s[g].y!=p;)m.push(s.pop().edge),g--;m.push(s.pop().edge),m.forEach(function(v){var T=v.connectedNodes().intersection(e);y.merge(v),T.forEach(function(b){var w=b.id(),C=b.connectedEdges().intersection(e);y.merge(b),r[w].cutVertex?y.merge(C.filter(function(S){return S.isLoop()})):y.merge(C)})}),a.push(y)},u=function(f,p,g){f===g&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var m=e.getElementById(p).connectedEdges().intersection(e);if(m.size()===0)a.push(e.spawn(e.getElementById(p)));else{var y,v,T,b;m.forEach(function(w){y=w.source().id(),v=w.target().id(),T=y===p?v:y,T!==g&&(b=w.id(),o[b]||(o[b]=!0,s.push({x:p,y:T,edge:w})),T in r?r[p].low=Math.min(r[p].low,r[T].id):(u(f,T,p),r[p].low=Math.min(r[p].low,r[T].low),r[p].id<=r[T].low&&(r[p].cutVertex=!0,l(p,T))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var h=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:a}},Zdt={hopcroftTarjanBiconnected:KE,htbc:KE,htb:KE,hopcroftTarjanBiconnectedComponents:KE},ZE=function(){var e=this,r={},n=0,i=[],a=[],s=e.spawn(e),o=function(u){a.push(u),r[u]={index:n,low:n++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var y=m.target().id();y!==u&&(y in r||o(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=a.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=d.edgesWith(d),g=d.merge(p);i.push(g),s=s.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:i}},Qdt={tarjanStronglyConnected:ZE,tsc:ZE,tscc:ZE,tarjanStronglyConnectedComponents:ZE},wve={};[tk,_ht,Rht,Mht,Nht,Oht,Bht,hdt,xy,Ty,nP,kdt,Pdt,Vdt,Xdt,Kdt,Zdt,Qdt].forEach(function(t){dr(wve,t)});/*! Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) Licensed under The MIT License (http://opensource.org/licenses/MIT) -*/var wve=0,Cve=1,kve=2,oc=function(e){if(!(this instanceof oc))return new oc(e);this.id="Thenable/1.0.7",this.state=wve,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))};oc.prototype={fulfill:function(e){return MJ(this,Cve,"fulfillValue",e)},reject:function(e){return MJ(this,kve,"rejectReason",e)},then:function(e,r){var n=this,i=new oc;return n.onFulfilled.push(NJ(e,i,"fulfill")),n.onRejected.push(NJ(r,i,"reject")),Sve(n),i.proxy}};var MJ=function(e,r,n,i){return e.state===wve&&(e.state=r,e[n]=i,Sve(e)),e},Sve=function(e){e.state===Cve?IJ(e,"onFulfilled",e.fulfillValue):e.state===kve&&IJ(e,"onRejected",e.rejectReason)},IJ=function(e,r,n){if(e[r].length!==0){var i=e[r];e[r]=[];var a=function(){for(var o=0;o0}},clearQueue:function(){return 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-1}return x8=e,x8}var T8,ree;function pft(){if(ree)return T8;ree=1;var t=cL();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return T8=e,T8}var w8,nee;function gft(){if(nee)return w8;nee=1;var t=uft(),e=hft(),r=dft(),n=fft(),i=pft();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&n%1==0&&n0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Nn(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],s=0,o=n.length;s0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass: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}};c3.className=c3.classNames=c3.classes;var an={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:sa,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};an.variable="(?:[\\w-.]|(?:\\\\"+an.metaChar+"))+";an.className="(?:[\\w-]|(?:\\\\"+an.metaChar+"))+";an.value=an.string+"|"+an.number;an.id=an.variable;(function(){var t,e,r;for(t=an.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(an.comparatorOp+="|\\!"+e)})();var Rn=function(){return{checks:[]}},qt={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},oP=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return Wut(t.selector,e.selector)}),Uft=(function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return Cn("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return Cn("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&Cn("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},Qft=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return or(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case qt.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case qt.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+n(e(y))+r(p)+"]"}case qt.DATA_BOOL:{var v=h.operator,T=h.field;return"["+e(v)+T+"]"}case qt.DATA_EXIST:{var b=h.field;return"["+b+"]"}case qt.META_COMPARE:{var w=h.operator,C=h.field;return"[["+C+n(e(w))+r(p)+"]]"}case qt.STATE:return p;case qt.ID:return"#"+p;case qt.CLASS:return"."+p;case qt.PARENT:case qt.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case qt.ANCESTOR:case qt.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case qt.COMPOUND_SPLIT:{var S=a(h.left,d),k=a(h.subject,d),E=a(h.right,d);return S+(S.length>0?" ":"")+k+E}case qt.TRUE:return""}},a=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},s="",o=0;o1&&o=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(a||o||h)&&(l=!a&&!s?"":""+e,u=""+n),h&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=e===n;break;case">":f=!0,i=e>n;break;case">=":f=!0,i=e>=n;break;case"<":f=!0,i=e0;){var h=i.shift();e(h),a.add(h.id()),o&&n(i,a,h)}return t}function Nve(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return eW(this,t,e,Nve)};function Dve(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}qb.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return eW(this,t,e,Dve)};function spt(t,e,r){Dve(t,e,r),Nve(t,e,r)}qb.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return eW(this,t,e,spt)};qb.ancestors=qb.parents;var ik,Ove;ik=Ove={data:Tn.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:Tn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Tn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Tn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Tn.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Tn.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};ik.attr=ik.data;ik.removeAttr=ik.removeData;var opt=Ove,hL={};function K8(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;se}),minIndegree:Kg("indegree",function(t,e){return te}),minOutdegree:Kg("outdegree",function(t,e){return te})});dr(hL,{totalDegree:function(e){for(var r=0,n=this.nodes(),i=0;i0,f=d;d&&(h=h[0]);var p=f?h.position():{x:0,y:0};r!==void 0?u.position(e,r+p[e]):a!==void 0&&u.position({x:a.x+p.x,y:a.y+p.y})}else{var g=n.position(),m=o?n.parent():null,y=m&&m.length>0,v=y;y&&(m=m[0]);var T=v?m.position():{x:0,y:0};return a={x:g.x-T.x,y:g.y-T.y},e===void 0?a:a[e]}else if(!s)return;return this}};Jl.modelPosition=Jl.point=Jl.position;Jl.modelPositions=Jl.points=Jl.positions;Jl.renderedPoint=Jl.renderedPosition;Jl.relativePoint=Jl.relativePosition;var lpt=$ve,Ub=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},Yb=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},cpt=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},wy,Lf;wy=Lf={};Lf.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,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}};Lf.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)};Lf.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 o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",h={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=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function p(_,M,L){var P=0,D=0,R=M+L;return _>0&&R>0&&(P=M/R*_,D=L/R*_),{biasDiff:P,biasComplementDiff:D}}function g(_,M,L,P){if(L.units==="%")switch(P){case"width":return _>0?L.pfValue*_:0;case"height":return M>0?L.pfValue*M:0;case"average":return _>0&&M>0?L.pfValue*(_+M)/2:0;case"min":return _>0&&M>0?_>M?L.pfValue*M:L.pfValue*_:0;case"max":return _>0&&M>0?_>M?L.pfValue*_:L.pfValue*M:0;default:return 0}else return L.units==="px"?L.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var y=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(y=y*100/h.width.val);var v=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(v=v*100/h.height.val);var T=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(T=T*100/h.height.val);var b=p(h.width.val-d.w,m,y),w=b.biasDiff,C=b.biasComplementDiff,S=p(h.height.val-d.h,v,T),k=S.biasDiff,E=S.biasComplementDiff;o.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-w+d.x1+d.x2+C)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-k+d.y1+d.y2+E)/2}for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},pd=function(e,r){return r==null?e:Ol(e,r.x1,r.y1,r.x2,r.y2)},fT=function(e,r,n){return Ms(e,r,n)},QE=function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,s=a.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=a.srcX,u=a.srcY):n==="target"?(l=a.tgtX,u=a.tgtY):(l=a.midX,u=a.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,o3(d,1),Ol(e,d.x1,d.y1,d.x2,d.y2)}}},Z8=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,s=a.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=fT(s,"labelWidth",n),d=fT(s,"labelHeight",n),f=fT(s,"labelX",n),p=fT(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,y=r.isEdge(),v=r.pstyle(i+"text-rotation"),T=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,w=b/2,C=r.pstyle("text-background-padding").pfValue,S=2,k=d,E=h,_=E/2,M=k/2,L,P,D,R;if(y)L=f-_,P=f+_,D=p-M,R=p+M;else{switch(Ub(l.value)){case"left":L=f-E,P=f;break;case"center":L=f-_,P=f+_;break;case"right":L=f,P=f+E;break}switch(Yb(u.value)){case"top":D=p-k,R=p;break;case"center":D=p-M,R=p+M;break;case"bottom":D=p,R=p+k;break}}var I=g-Math.max(T,w)-C-S,$=g+Math.max(T,w)+C+S,O=m-Math.max(T,w)-C-S,N=m+Math.max(T,w)+C+S;L+=I,P+=$,D+=O,R+=N;var F=n||"main",z=a.labelBounds,V=z[F]=z[F]||{};V.x1=L,V.y1=D,V.x2=P,V.y2=R,V.w=P-L,V.h=R-D,V.leftPad=I,V.rightPad=$,V.topPad=O,V.botPad=N;var B=y&&v.strValue==="autorotate",G=v.pfValue!=null&&v.pfValue!==0;if(B||G){var H=B?fT(a.rstyle,"labelAngle",n):v.pfValue,q=Math.cos(H),Z=Math.sin(H),Y=(L+P)/2,ie=(D+R)/2;if(!y){switch(Ub(l.value)){case"left":Y=P;break;case"right":Y=L;break}switch(Yb(u.value)){case"top":ie=R;break;case"bottom":ie=D;break}}var K=function(Be,ce){return Be=Be-Y,ce=ce-ie,{x:Be*q-ce*Z+Y,y:Be*Z+ce*q+ie}},Q=K(L,D),te=K(L,R),J=K(P,D),ge=K(P,R);L=Math.min(Q.x,te.x,J.x,ge.x),P=Math.max(Q.x,te.x,J.x,ge.x),D=Math.min(Q.y,te.y,J.y,ge.y),R=Math.max(Q.y,te.y,J.y,ge.y)}var ee=F+"Rot",Re=z[ee]=z[ee]||{};Re.x1=L,Re.y1=D,Re.x2=P,Re.y2=R,Re.w=P-L,Re.h=R-D,Ol(e,L,D,P,R),Ol(a.labelBounds.all,L,D,P,R)}return e}},Iee=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,a=r.pstyle("outline-offset").value,s=i+a;Bve(e,r,n,s,"outside",s/2)}},Bve=function(e,r,n,i,a,s){if(!(n===0||i<=0||a==="inside")){var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var h=r.position(),d=h.x,f=h.y,p=r.width(),g=r.height();if(u.hasMiterBounds){a==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);pd(e,m)}else s!=null&&s>0&&l3(e,[s,s,s,s])}}},upt=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,a=r.pstyle("border-position").value;Bve(e,r,n,i,a)}},hpt=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=Us(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,y=o.rstyle,v=l&&i?e.pstyle("bounds-expansion").pfValue:[0],T=function(Ie){return Ie.pstyle("display").value!=="none"},b=!i||T(e)&&(!u||T(e.source())&&T(e.target()));if(b){var w=0,C=0;i&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(C=e.pstyle("overlay-padding").value));var S=0,k=0;i&&r.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(k=e.pstyle("underlay-padding").value));var E=Math.max(C,k),_=0,M=0;if(i&&(_=e.pstyle("width").pfValue,M=_/2),l&&r.includeNodes){var L=e.position();g=L.x,m=L.y;var P=e.outerWidth(),D=P/2,R=e.outerHeight(),I=R/2;h=g-D,d=g+D,f=m-I,p=m+I,Ol(s,h,f,d,p),i&&Iee(s,e),i&&r.includeOutlines&&!a&&Iee(s,e),i&&upt(s,e)}else if(u&&r.includeEdges)if(i&&!a){var $=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),f=Math.min(y.srcY,y.midY,y.tgtY),p=Math.max(y.srcY,y.midY,y.tgtY),h-=M,d+=M,f-=M,p+=M,Ol(s,h,f,d,p),$==="haystack"){var O=y.haystackPts;if(O&&O.length===2){if(h=O[0].x,f=O[0].y,d=O[1].x,p=O[1].y,h>d){var N=h;h=d,d=N}if(f>p){var F=f;f=p,p=F}Ol(s,h-M,f-M,d+M,p+M)}}else if($==="bezier"||$==="unbundled-bezier"||Nd($,"segments")||Nd($,"taxi")){var z;switch($){case"bezier":case"unbundled-bezier":z=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":z=y.linePts;break}if(z!=null)for(var V=0;Vd){var Y=h;h=d,d=Y}if(f>p){var ie=f;f=p,p=ie}h-=M,d+=M,f-=M,p+=M,Ol(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(QE(s,e,"mid-source"),QE(s,e,"mid-target"),QE(s,e,"source"),QE(s,e,"target")),i){var K=e.pstyle("ghost").value==="yes";if(K){var Q=e.pstyle("ghost-offset-x").pfValue,te=e.pstyle("ghost-offset-y").pfValue;Ol(s,s.x1+Q,s.y1+te,s.x2+Q,s.y2+te)}}var J=o.bodyBounds=o.bodyBounds||{};yJ(J,s),l3(J,v),o3(J,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,Ol(s,h-E,f-E,d+E,p+E));var ge=o.overlayBounds=o.overlayBounds||{};yJ(ge,s),l3(ge,v),o3(ge,1);var ee=o.labelBounds=o.labelBounds||{};ee.all!=null?qht(ee.all):ee.all=Us(),i&&r.includeLabels&&(r.includeMainLabels&&Z8(s,e,null),u&&(r.includeSourceLabels&&Z8(s,e,"source"),r.includeTargetLabels&&Z8(s,e,"target")))}return s.x1=ll(s.x1),s.y1=ll(s.y1),s.x2=ll(s.x2),s.y2=ll(s.y2),s.w=ll(s.x2-s.x1),s.h=ll(s.y2-s.y1),s.w>0&&s.h>0&&b&&(l3(s,v),o3(s,1)),s},Fve=function(e){var r=0,n=function(s){return(s?1:0)<0}},clearQueue:function(){return 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-1}return x8=e,x8}var T8,nee;function yft(){if(nee)return T8;nee=1;var t=cL();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return T8=e,T8}var w8,iee;function vft(){if(iee)return w8;iee=1;var t=fft(),e=pft(),r=gft(),n=mft(),i=yft();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&n%1==0&&n0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Nn(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],s=0,o=n.length;s0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass: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}};c3.className=c3.classNames=c3.classes;var an={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:sa,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};an.variable="(?:[\\w-.]|(?:\\\\"+an.metaChar+"))+";an.className="(?:[\\w-]|(?:\\\\"+an.metaChar+"))+";an.value=an.string+"|"+an.number;an.id=an.variable;(function(){var t,e,r;for(t=an.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(an.comparatorOp+="|\\!"+e)})();var Rn=function(){return{checks:[]}},qt={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},oP=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return Uut(t.selector,e.selector)}),jft=(function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return Cn("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return Cn("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&Cn("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},tpt=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return or(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case qt.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case qt.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+n(e(y))+r(p)+"]"}case qt.DATA_BOOL:{var v=h.operator,T=h.field;return"["+e(v)+T+"]"}case qt.DATA_EXIST:{var b=h.field;return"["+b+"]"}case qt.META_COMPARE:{var w=h.operator,C=h.field;return"[["+C+n(e(w))+r(p)+"]]"}case qt.STATE:return p;case qt.ID:return"#"+p;case qt.CLASS:return"."+p;case qt.PARENT:case qt.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case qt.ANCESTOR:case qt.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case qt.COMPOUND_SPLIT:{var S=a(h.left,d),k=a(h.subject,d),E=a(h.right,d);return S+(S.length>0?" ":"")+k+E}case qt.TRUE:return""}},a=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},s="",o=0;o1&&o=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(a||o||h)&&(l=!a&&!s?"":""+e,u=""+n),h&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=e===n;break;case">":f=!0,i=e>n;break;case">=":f=!0,i=e>=n;break;case"<":f=!0,i=e0;){var h=i.shift();e(h),a.add(h.id()),o&&n(i,a,h)}return t}function Dve(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return eW(this,t,e,Dve)};function Ove(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}qb.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return eW(this,t,e,Ove)};function cpt(t,e,r){Ove(t,e,r),Dve(t,e,r)}qb.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return eW(this,t,e,cpt)};qb.ancestors=qb.parents;var ik,$ve;ik=$ve={data:Tn.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:Tn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Tn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Tn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Tn.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Tn.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};ik.attr=ik.data;ik.removeAttr=ik.removeData;var upt=$ve,hL={};function K8(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;se}),minIndegree:Kg("indegree",function(t,e){return te}),minOutdegree:Kg("outdegree",function(t,e){return te})});dr(hL,{totalDegree:function(e){for(var r=0,n=this.nodes(),i=0;i0,f=d;d&&(h=h[0]);var p=f?h.position():{x:0,y:0};r!==void 0?u.position(e,r+p[e]):a!==void 0&&u.position({x:a.x+p.x,y:a.y+p.y})}else{var g=n.position(),m=o?n.parent():null,y=m&&m.length>0,v=y;y&&(m=m[0]);var T=v?m.position():{x:0,y:0};return a={x:g.x-T.x,y:g.y-T.y},e===void 0?a:a[e]}else if(!s)return;return this}};Jl.modelPosition=Jl.point=Jl.position;Jl.modelPositions=Jl.points=Jl.positions;Jl.renderedPoint=Jl.renderedPosition;Jl.relativePoint=Jl.relativePosition;var hpt=Pve,Ub=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},Yb=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},dpt=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},wy,Lf;wy=Lf={};Lf.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,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}};Lf.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)};Lf.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 o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",h={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=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function p(_,M,L){var P=0,D=0,R=M+L;return _>0&&R>0&&(P=M/R*_,D=L/R*_),{biasDiff:P,biasComplementDiff:D}}function g(_,M,L,P){if(L.units==="%")switch(P){case"width":return _>0?L.pfValue*_:0;case"height":return M>0?L.pfValue*M:0;case"average":return _>0&&M>0?L.pfValue*(_+M)/2:0;case"min":return _>0&&M>0?_>M?L.pfValue*M:L.pfValue*_:0;case"max":return _>0&&M>0?_>M?L.pfValue*_:L.pfValue*M:0;default:return 0}else return L.units==="px"?L.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var y=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(y=y*100/h.width.val);var v=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(v=v*100/h.height.val);var T=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(T=T*100/h.height.val);var b=p(h.width.val-d.w,m,y),w=b.biasDiff,C=b.biasComplementDiff,S=p(h.height.val-d.h,v,T),k=S.biasDiff,E=S.biasComplementDiff;o.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-w+d.x1+d.x2+C)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-k+d.y1+d.y2+E)/2}for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},pd=function(e,r){return r==null?e:Ol(e,r.x1,r.y1,r.x2,r.y2)},fT=function(e,r,n){return Ms(e,r,n)},QE=function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,s=a.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=a.srcX,u=a.srcY):n==="target"?(l=a.tgtX,u=a.tgtY):(l=a.midX,u=a.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,o3(d,1),Ol(e,d.x1,d.y1,d.x2,d.y2)}}},Z8=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,s=a.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=fT(s,"labelWidth",n),d=fT(s,"labelHeight",n),f=fT(s,"labelX",n),p=fT(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,y=r.isEdge(),v=r.pstyle(i+"text-rotation"),T=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,w=b/2,C=r.pstyle("text-background-padding").pfValue,S=2,k=d,E=h,_=E/2,M=k/2,L,P,D,R;if(y)L=f-_,P=f+_,D=p-M,R=p+M;else{switch(Ub(l.value)){case"left":L=f-E,P=f;break;case"center":L=f-_,P=f+_;break;case"right":L=f,P=f+E;break}switch(Yb(u.value)){case"top":D=p-k,R=p;break;case"center":D=p-M,R=p+M;break;case"bottom":D=p,R=p+k;break}}var I=g-Math.max(T,w)-C-S,$=g+Math.max(T,w)+C+S,O=m-Math.max(T,w)-C-S,N=m+Math.max(T,w)+C+S;L+=I,P+=$,D+=O,R+=N;var F=n||"main",z=a.labelBounds,V=z[F]=z[F]||{};V.x1=L,V.y1=D,V.x2=P,V.y2=R,V.w=P-L,V.h=R-D,V.leftPad=I,V.rightPad=$,V.topPad=O,V.botPad=N;var B=y&&v.strValue==="autorotate",G=v.pfValue!=null&&v.pfValue!==0;if(B||G){var H=B?fT(a.rstyle,"labelAngle",n):v.pfValue,q=Math.cos(H),Z=Math.sin(H),Y=(L+P)/2,ie=(D+R)/2;if(!y){switch(Ub(l.value)){case"left":Y=P;break;case"right":Y=L;break}switch(Yb(u.value)){case"top":ie=R;break;case"bottom":ie=D;break}}var K=function(Be,ce){return Be=Be-Y,ce=ce-ie,{x:Be*q-ce*Z+Y,y:Be*Z+ce*q+ie}},Q=K(L,D),te=K(L,R),J=K(P,D),ge=K(P,R);L=Math.min(Q.x,te.x,J.x,ge.x),P=Math.max(Q.x,te.x,J.x,ge.x),D=Math.min(Q.y,te.y,J.y,ge.y),R=Math.max(Q.y,te.y,J.y,ge.y)}var ee=F+"Rot",Re=z[ee]=z[ee]||{};Re.x1=L,Re.y1=D,Re.x2=P,Re.y2=R,Re.w=P-L,Re.h=R-D,Ol(e,L,D,P,R),Ol(a.labelBounds.all,L,D,P,R)}return e}},Nee=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,a=r.pstyle("outline-offset").value,s=i+a;Fve(e,r,n,s,"outside",s/2)}},Fve=function(e,r,n,i,a,s){if(!(n===0||i<=0||a==="inside")){var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var h=r.position(),d=h.x,f=h.y,p=r.width(),g=r.height();if(u.hasMiterBounds){a==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);pd(e,m)}else s!=null&&s>0&&l3(e,[s,s,s,s])}}},fpt=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,a=r.pstyle("border-position").value;Fve(e,r,n,i,a)}},ppt=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=Us(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,y=o.rstyle,v=l&&i?e.pstyle("bounds-expansion").pfValue:[0],T=function(Ie){return Ie.pstyle("display").value!=="none"},b=!i||T(e)&&(!u||T(e.source())&&T(e.target()));if(b){var w=0,C=0;i&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(C=e.pstyle("overlay-padding").value));var S=0,k=0;i&&r.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(k=e.pstyle("underlay-padding").value));var E=Math.max(C,k),_=0,M=0;if(i&&(_=e.pstyle("width").pfValue,M=_/2),l&&r.includeNodes){var L=e.position();g=L.x,m=L.y;var P=e.outerWidth(),D=P/2,R=e.outerHeight(),I=R/2;h=g-D,d=g+D,f=m-I,p=m+I,Ol(s,h,f,d,p),i&&Nee(s,e),i&&r.includeOutlines&&!a&&Nee(s,e),i&&fpt(s,e)}else if(u&&r.includeEdges)if(i&&!a){var $=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),f=Math.min(y.srcY,y.midY,y.tgtY),p=Math.max(y.srcY,y.midY,y.tgtY),h-=M,d+=M,f-=M,p+=M,Ol(s,h,f,d,p),$==="haystack"){var O=y.haystackPts;if(O&&O.length===2){if(h=O[0].x,f=O[0].y,d=O[1].x,p=O[1].y,h>d){var N=h;h=d,d=N}if(f>p){var F=f;f=p,p=F}Ol(s,h-M,f-M,d+M,p+M)}}else if($==="bezier"||$==="unbundled-bezier"||Nd($,"segments")||Nd($,"taxi")){var z;switch($){case"bezier":case"unbundled-bezier":z=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":z=y.linePts;break}if(z!=null)for(var V=0;Vd){var Y=h;h=d,d=Y}if(f>p){var ie=f;f=p,p=ie}h-=M,d+=M,f-=M,p+=M,Ol(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(QE(s,e,"mid-source"),QE(s,e,"mid-target"),QE(s,e,"source"),QE(s,e,"target")),i){var K=e.pstyle("ghost").value==="yes";if(K){var Q=e.pstyle("ghost-offset-x").pfValue,te=e.pstyle("ghost-offset-y").pfValue;Ol(s,s.x1+Q,s.y1+te,s.x2+Q,s.y2+te)}}var J=o.bodyBounds=o.bodyBounds||{};vJ(J,s),l3(J,v),o3(J,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,Ol(s,h-E,f-E,d+E,p+E));var ge=o.overlayBounds=o.overlayBounds||{};vJ(ge,s),l3(ge,v),o3(ge,1);var ee=o.labelBounds=o.labelBounds||{};ee.all!=null?Xht(ee.all):ee.all=Us(),i&&r.includeLabels&&(r.includeMainLabels&&Z8(s,e,null),u&&(r.includeSourceLabels&&Z8(s,e,"source"),r.includeTargetLabels&&Z8(s,e,"target")))}return s.x1=ll(s.x1),s.y1=ll(s.y1),s.x2=ll(s.x2),s.y2=ll(s.y2),s.w=ll(s.x2-s.x1),s.h=ll(s.y2-s.y1),s.w>0&&s.h>0&&b&&(l3(s,v),o3(s,1)),s},zve=function(e){var r=0,n=function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:Ept,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)s(o);return this};ff.removeAllListeners=function(){return this.removeListener("*")};ff.emit=ff.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Nn(e)||(e=[e]),Apt(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===Spt)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&mht(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,s),p=h.callback.apply(f,d);a.afterEmit(a.context,h,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,a.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne: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},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&or(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,a=0;an&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,s=0;s=0&&a"u"?"undefined":ca(Symbol))!=e&&ca(Symbol.iterator)!=e;r&&(y_[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return U1e({next:function(){return a1&&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)}},numericStyle: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}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(ln(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(or(e))if(r===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle: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;s0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});ys.neighbourhood=ys.neighborhood;ys.closedNeighbourhood=ys.closedNeighborhood;ys.openNeighbourhood=ys.openNeighborhood;dr(ys,{source:pl(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:pl(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:Wee({attr:"source"}),targets:Wee({attr:"target"})});function Wee(t){return function(r){for(var n=[],i=0;i0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});ys.componentsOf=ys.components;var Za=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 th,s=!1;if(!r)r=[];else if(r.length>0&&ln(r[0])&&!dS(r[0])){s=!0;for(var o=[],l=new Rx,u=0,h=r.length;u0&&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=[],o,l=0,u=r.length;l0){for(var F=o.length===r.length?r:new Za(n,o),z=0;z0&&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(R){for(var I=R._private.edges,$=0;$0&&(t?L.emitAndNotify("remove"):e&&L.emit("remove"));for(var P=0;P0?P=R:L=R;while(Math.abs(D)>s&&++I=a?T(M,I):$===0?I:w(M,L,L+u)}var S=!1;function k(){S=!0,(t!==e||r!==n)&&b()}var E=function(L){return S||k(),t===e&&r===n?L:L===0?0:L===1?1:y(C(L),e,n)};E.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var _="generateBezier("+[t,e,r,n]+")";return E.toString=function(){return _},E}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var Bpt=(function(){function t(n){return-n.tension*n.x-n.friction*n.v}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)}}function r(n,i){var a={dx:n.v,dv:t(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),u=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,f=s!==null,f?(u=n(i,a),p=u/s*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}})(),$n=function(e,r,n,i){var a=Ppt(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},h3={linear:function(e,r,n){return e+(r-e)*n},ease:$n(.25,.1,.25,1),"ease-in":$n(.42,0,1,1),"ease-out":$n(0,0,.58,1),"ease-in-out":$n(.42,0,.58,1),"ease-in-sine":$n(.47,0,.745,.715),"ease-out-sine":$n(.39,.575,.565,1),"ease-in-out-sine":$n(.445,.05,.55,.95),"ease-in-quad":$n(.55,.085,.68,.53),"ease-out-quad":$n(.25,.46,.45,.94),"ease-in-out-quad":$n(.455,.03,.515,.955),"ease-in-cubic":$n(.55,.055,.675,.19),"ease-out-cubic":$n(.215,.61,.355,1),"ease-in-out-cubic":$n(.645,.045,.355,1),"ease-in-quart":$n(.895,.03,.685,.22),"ease-out-quart":$n(.165,.84,.44,1),"ease-in-out-quart":$n(.77,0,.175,1),"ease-in-quint":$n(.755,.05,.855,.06),"ease-out-quint":$n(.23,1,.32,1),"ease-in-out-quint":$n(.86,0,.07,1),"ease-in-expo":$n(.95,.05,.795,.035),"ease-out-expo":$n(.19,1,.22,1),"ease-in-out-expo":$n(1,0,0,1),"ease-in-circ":$n(.6,.04,.98,.335),"ease-out-circ":$n(.075,.82,.165,1),"ease-in-out-circ":$n(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return h3.linear;var i=Bpt(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":$n};function Uee(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 Yee(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Zg(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=Yee(t,i),o=Yee(e,i);if(Dt(s)&&Dt(o))return Uee(a,s,o,r,n);if(Nn(s)&&Nn(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(s.duration),s.easingImpl=h3[p].apply(null,g)):s.easingImpl=h3[p]}var m=s.easingImpl,y;if(s.duration===0?y=1:y=(r-l)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var v=s.startPosition,T=s.position;if(T&&i&&!t.locked()){var b={};gT(v.x,T.x)&&(b.x=Zg(v.x,T.x,y,m)),gT(v.y,T.y)&&(b.y=Zg(v.y,T.y,y,m)),t.position(b)}var w=s.startPan,C=s.pan,S=a.pan,k=C!=null&&n;k&&(gT(w.x,C.x)&&(S.x=Zg(w.x,C.x,y,m)),gT(w.y,C.y)&&(S.y=Zg(w.y,C.y,y,m)),t.emit("pan"));var E=s.startZoom,_=s.zoom,M=_!=null&&n;M&&(gT(E,_)&&(a.zoom=rk(a.minZoom,Zg(E,_,y,m),a.maxZoom)),t.emit("zoom")),(k||M)&&t.emit("viewport");var L=s.style;if(L&&L.length>0&&i){for(var P=0;P=0;k--){var E=S[k];E()}S.splice(0,S.length)},T=p.length-1;T>=0;T--){var b=p[T],w=b._private;if(w.stopped){p.splice(T,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||zpt(h,b,t),Fpt(h,b,t,d),w.applying&&(w.applying=!1),v(w.frames),w.step!=null&&w.step(t),b.completed()&&(p.splice(T,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var a=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var Vpt={animate:Tn.animate(),animation:Tn.animation(),animated:Tn.animated(),clearQueue:Tn.clearQueue(),delay:Tn.delay(),delayAnimation:Tn.delayAnimation(),stop:Tn.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&d_(function(a){Xee(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){Xee(s,e)},n.beforeRenderPriorities.animations):r()}},Gpt={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&dS(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},t4=function(e){return or(e)?new hf(e):e},Kve={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new dL(Gpt,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,t4(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,t4(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,t4(r),n),this},once:function(e,r,n){return this.emitter().one(e,t4(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};Tn.eventAliasesOn(Kve);var cP={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};cP.jpeg=cP.jpg;var d3={layout: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;or(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(dr({},e,{cy:r,eles:a}));return s}};d3.createLayout=d3.makeLayout=d3.layout;var Wpt={notify: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)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch: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},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i0;)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=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};uP.invalidateDimensions=uP.resize;var f3={collection:function(e,r){return or(e)?this.$(e):Po(e)?e.collection():Nn(e)?(r||(r={}),new Za(this,e,r.unique,r.removed)):new Za(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};f3.elements=f3.filter=f3.$;var Ra={},qw="t",qpt="f";Ra.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m1&&(w=1),o.color){var S=n.valueMin[0],k=n.valueMax[0],E=n.valueMin[1],_=n.valueMax[1],M=n.valueMin[2],L=n.valueMax[2],P=n.valueMin[3]==null?1:n.valueMin[3],D=n.valueMax[3]==null?1:n.valueMax[3],R=[Math.round(S+(k-S)*w),Math.round(E+(_-E)*w),Math.round(M+(L-M)*w),Math.round(P+(D-P)*w)];a={bypass:n.bypass,name:n.name,value:R,strValue:"rgb("+R[0]+", "+R[1]+", "+R[2]+")"}}else if(o.number){var I=n.valueMin+(n.valueMax-n.valueMin)*w;a=this.parse(n.name,I,n.bypass,f)}else return!1;if(!a)return m(),!1;a.mapping=n,n=a;break}case s.data:{for(var $=n.field.split("."),O=d.data,N=0;N<$.length&&O;N++){var F=$[N];O=O[F]}if(O!=null&&(a=this.parse(n.name,O,n.bypass,f)),!a)return m(),!1;a.mapping=n,n=a;break}case s.fn:{var z=n.value,V=n.fnValue!=null?n.fnValue:z(t);if(n.prevFnValue=V,V==null)return Cn("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(a=this.parse(n.name,V,n.bypass,f),!a)return Cn("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=Fc(n),n=a;break}case void 0:break;default:return!1}return l?(h?n.bypassed=u.bypassed:n.bypassed=u,i[n.name]=n):h?u.bypassed=n:i[n.name]=n,g(),!0};Ra.cleanElements=function(t,e){for(var r=0;r0&&a>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(s).play().promise().then(b):b()}).then(function(){return t.animation({style:o,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)};Ra.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);t.removed()||o!=null&&o(r,n,t)&&a(s)};Ra.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)})};Ra.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};Ra.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};Ra.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};Ra.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var bS={};bS.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;oi.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){Cn("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new hf(d);if(f.invalid){Cn("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;a=p;for(var m=[];;){var y=a.match(/^\s*$/);if(y)break;var v=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!v){Cn("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=v[0];var T=v[1],b=v[2],w=e.properties[T];if(!w){Cn("Skipping property: Invalid property name in: "+s),l();continue}var C=r.parse(T,b);if(!C){Cn("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:T,val:b}),l()}if(g){o();break}r.selector(d);for(var S=0;S=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return Cn("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var y=g.value,v=m.value,T=y[0]===v[0]&&y[1]===v[1]&&y[2]===v[2]&&(y[3]===v[3]||(y[3]==null||y[3]===1)&&(v[3]==null||v[3]===1));if(T)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var b;if(l?b=e.split(/\s+/):Nn(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var w=[],C=[],S=[],k="",E=!1,_=0;_0?" ":"")+M.strValue}return u.validate&&!u.validate(w,C)?null:u.singleEnum&&E?w.length===1&&or(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:S,strValue:k,bypass:r,units:C}}var L=function(){for(var K=0;Ku.max||u.strictMax&&e===u.max))return null;var $={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:r};return u.unitless||P!=="px"&&P!=="em"?$.pfValue=e:$.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&($.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&($.pfValue=P==="rad"?e:Vht(e)),P==="%"&&($.pfValue=e/100),$}else if(u.propList){var O=[],N=""+e;if(N!=="none"){for(var F=N.split(/\s*,\s*|\s+/),z=0;z0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,o=!1;if(r.zoomingEnabled||(o=!0),Dt(e)?s=e:ln(e)&&(s=e.level,e.position!=null?a=aL(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=sr.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;Dt(u.x)&&(r.pan.x=u.x,o=!1),Dt(u.y)&&(r.pan.y=u.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(or(e)){var n=e;e=this.mutableElements().filter(n)}else Po(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 o={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?(function(){var i=n.window().getComputedStyle(r),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent: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},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};W0.centre=W0.center;W0.autolockNodes=W0.autolock;W0.autoungrabifyNodes=W0.autoungrabify;var sk={data:Tn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Tn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Tn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Tn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};sk.attr=sk.data;sk.removeAttr=sk.removeData;var ok=function(e){var r=this;e=dr({},e);var n=e.container;n&&!h_(n)&&h_(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=ra!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=dr({name:s?"grid":"null"},o.layout),o.renderer=dr({name:s?"canvas":"null"},o.renderer);var l=function(g,m,y){return m!==void 0?m:y!==void 0?y:g},u=this._private={container:n,ready:!1,options:o,elements:new Za(this),listeners:[],aniEles:new Za(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:Dt(o.zoom)?o.zoom:1,pan:{x:ln(o.pan)&&Dt(o.pan.x)?o.pan.x:0,y:ln(o.pan)&&Dt(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var y=g.some(Out);if(y)return Lx.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=dr({},o,o.renderer);r.initRenderer(d);var f=function(g,m,y){r.notifications(!1);var v=r.mutableElements();v.length>0&&v.remove(),g!=null&&(ln(g)||Nn(g))&&r.add(g),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var T=dr({},r._private.options.layout);T.eles=r.elements(),r.layout(T).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,gi(o.ready)&&r.on("ready",o.ready);for(var y=0;y0,o=!!t.boundingBox,l=Us(o?t.boundingBox:structuredClone(e.extent())),u;if(Po(t.roots))u=t.roots;else if(Nn(t.roots)){for(var h=[],d=0;d0;){var R=D(),I=_(R,L);if(I)R.outgoers().filter(function(oe){return oe.isNode()&&r.has(oe)}).forEach(P);else if(I===null){Cn("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var $=0;if(t.avoidOverlap)for(var O=0;O0&&v[0].length<=3?Ce/2:0),se=2*Math.PI/v[Pe].length*ve;return Pe===0&&v[0].length===1&&(Ve=1),{x:J.x+Ve*Math.cos(se),y:J.y+Ve*Math.sin(se)}}else{var de=v[Pe].length,Te=Math.max(de===1?0:o?(l.w-t.padding*2-ge.w)/((t.grid?Re:de)-1):(l.w-t.padding*2-ge.w)/((t.grid?Re:de)+1),$),ae={x:J.x+(ve+1-(de+1)/2)*Te,y:J.y+(Pe+1-(q+1)/2)*ee};return ae}},Be={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Be).indexOf(t.direction)===-1&&oi("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Be).join(", ")));var ce=function(be){return uht(Ie(be),l,Be[t.direction])};return r.nodes().layoutPositions(this,t,ce),this};var Kpt={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:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Qve(t){this.options=dr({},Kpt,t)}Qve.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=Us(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,u=l/Math.max(1,a.length-1),h,d=0,f=0;f1&&e.avoidOverlap){d*=1.75;var v=Math.cos(u)-Math.cos(0),T=Math.sin(u)-Math.sin(0),b=Math.sqrt(d*d/(v*v+T*T));h=Math.max(b,h)}var w=function(S,k){var E=e.startAngle+k*u*(i?1:-1),_=h*Math.cos(E),M=h*Math.sin(E),L={x:o.x+_,y:o.y+M};return L};return n.nodes().layoutPositions(this,e,w),this};var Zpt={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:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Jve(t){this.options=dr({},Zpt,t)}Jve.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=Us(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,h=0;h0){var C=Math.abs(T[0].value-w.value);C>=y&&(T=[],v.push(T))}T.push(w)}var S=u+e.minNodeSpacing;if(!e.avoidOverlap){var k=v.length>0&&v[0].length>1,E=Math.min(s.w,s.h)/2-S,_=E/(v.length+k?1:0);S=Math.min(S,_)}for(var M=0,L=0;L1&&e.avoidOverlap){var I=Math.cos(R)-Math.cos(0),$=Math.sin(R)-Math.sin(0),O=Math.sqrt(S*S/(I*I+$*$));M=Math.max(O,M)}P.r=M,M+=S}if(e.equidistant){for(var N=0,F=0,z=0;z=t.numIter||(i0t(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),d_(h)}};h()}else{for(;u;)u=s(l),l++;Zee(n,t),o()}return this};yL.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};yL.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Jpt=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=Us(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={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},l=n.eles.components(),u={},h=0;h0){o.graphSet.push(E);for(var h=0;hi.count?0:i.graph},e2e=function(e,r,n,i){var a=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=b_(e,o,l),y=b_(r,-1*o,-1*l),v=y.x-m.x,T=y.y-m.y,b=v*v+T*T,f=Math.sqrt(b),d=(e.nodeRepulsion+r.nodeRepulsion)/b,p=d*v/f,g=d*T/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},o0t=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},b_=function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,h={};return r===0&&0n?(h.x=i,h.y=a+s/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=a-o*n/2/r,h):0=u)?(h.x=i+s*r/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-s*r/2/n,h.y=a-s/2),h)},l0t=function(e,r){for(var n=0;nn){var y=r.gravity*p/m,v=r.gravity*g/m;f.offsetX+=y,f.offsetY+=v}}}}},u0t=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++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},r2e=function(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.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTopv&&(g+=y+r.componentSpacing,p=0,m=0,y=0)}}},f0t={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:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function n2e(t){this.options=dr({},f0t,t)}n2e.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=Us(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(G){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),u=Math.round(a.w/a.h*o),h=function(H){if(H==null)return Math.min(l,u);var q=Math.min(l,u);q==l?l=H:u=H},d=function(H){if(H==null)return Math.max(l,u);var q=Math.max(l,u);q==l?l=H:u=H},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(s/l);else if(f==null&&p!=null)u=p,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=d();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&d(m-1)}else for(;u*l=s?d(v+1):h(y+1)}var T=a.w/u,b=a.h/l;if(e.condense&&(T=0,b=0),e.avoidOverlap)for(var w=0;w=u&&(I=0,R++)},O={},N=0;N(I=tdt(t,e,$[O],$[O+1],$[O+2],$[O+3])))return y(k,I),!0}else if(_.edgeType==="bezier"||_.edgeType==="multibezier"||_.edgeType==="self"||_.edgeType==="compound"){for(var $=_.allpts,O=0;O+5<_.allpts.length;O+=4)if(Zht(t,e,$[O],$[O+1],$[O+2],$[O+3],$[O+4],$[O+5],R)&&D>(I=edt(t,e,$[O],$[O+1],$[O+2],$[O+3],$[O+4],$[O+5])))return y(k,I),!0}for(var N=N||E.source,F=F||E.target,z=i.getArrowWidth(M,L),V=[{name:"source",x:_.arrowStartX,y:_.arrowStartY,angle:_.srcArrowAngle},{name:"target",x:_.arrowEndX,y:_.arrowEndY,angle:_.tgtArrowAngle},{name:"mid-source",x:_.midX,y:_.midY,angle:_.midsrcArrowAngle},{name:"mid-target",x:_.midX,y:_.midY,angle:_.midtgtArrowAngle}],O=0;O0&&(v(N),v(F))}function b(k,E,_){return Ms(k,E,_)}function w(k,E){var _=k._private,M=f,L;E?L=E+"-":L="",k.boundingBox();var P=_.labelBounds[E||"main"],D=k.pstyle(L+"label").value,R=k.pstyle("text-events").strValue==="yes";if(!(!R||!D)){var I=b(_.rscratch,"labelX",E),$=b(_.rscratch,"labelY",E),O=b(_.rscratch,"labelAngle",E),N=k.pstyle(L+"text-margin-x").pfValue,F=k.pstyle(L+"text-margin-y").pfValue,z=P.x1-M-N,V=P.x2+M-N,B=P.y1-M-F,G=P.y2+M-F;if(O){var H=Math.cos(O),q=Math.sin(O),Z=function(ge,ee){return ge=ge-I,ee=ee-$,{x:ge*H-ee*q+I,y:ge*q+ee*H+$}},Y=Z(z,B),ie=Z(z,G),K=Z(V,B),Q=Z(V,G),te=[Y.x+N,Y.y+F,K.x+N,K.y+F,Q.x+N,Q.y+F,ie.x+N,ie.y+F];if(fo(t,e,te))return y(k),!0}else if(Dd(P,t,e))return y(k),!0}}for(var C=s.length-1;C>=0;C--){var S=s[C];S.isNode()?v(S)||w(S):T(S)||w(S)||w(S,"source")||w(S,"target")}return o};pg.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=Us({x1:t,y1:e,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],g=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function m(ge,ee,Re){return Ms(ge,ee,Re)}function y(ge,ee){var Re=ge._private,Ie=s,Be="";ge.boundingBox();var ce=Re.labelBounds.main;if(!ce)return null;var oe=m(Re.rscratch,"labelX",ee),be=m(Re.rscratch,"labelY",ee),fe=m(Re.rscratch,"labelAngle",ee),Pe=ge.pstyle(Be+"text-margin-x").pfValue,ve=ge.pstyle(Be+"text-margin-y").pfValue,Ce=ce.x1-Ie-Pe,Ve=ce.x2+Ie-Pe,se=ce.y1-Ie-ve,de=ce.y2+Ie-ve;if(fe){var Te=Math.cos(fe),ae=Math.sin(fe),he=function(ne,j){return ne=ne-oe,j=j-be,{x:ne*Te-j*ae+oe,y:ne*ae+j*Te+be}};return[he(Ce,se),he(Ve,se),he(Ve,de),he(Ce,de)]}else return[{x:Ce,y:se},{x:Ve,y:se},{x:Ve,y:de},{x:Ce,y:de}]}function v(ge,ee,Re,Ie){function Be(ce,oe,be){return(be.y-ce.y)*(oe.x-ce.x)>(oe.y-ce.y)*(be.x-ce.x)}return Be(ge,Re,Ie)!==Be(ee,Re,Ie)&&Be(ge,ee,Re)!==Be(ge,ee,Ie)}for(var T=0;T0?-(Math.PI-e.ang):Math.PI+e.ang},b0t=function(e,r,n,i,a){if(e!==rte?nte(r,e,Cc):v0t(rl,Cc),nte(r,n,rl),ete=Cc.nx*rl.ny-Cc.ny*rl.nx,tte=Cc.nx*rl.nx-Cc.ny*-rl.ny,Lu=Math.asin(Math.max(-1,Math.min(1,ete))),Math.abs(Lu)<1e-6){hP=r.x,dP=r.y,up=Jg=0;return}Ap=1,p3=!1,tte<0?Lu<0?Lu=Math.PI+Lu:(Lu=Math.PI-Lu,Ap=-1,p3=!0):Lu>0&&(Ap=-1,p3=!0),r.radius!==void 0?Jg=r.radius:Jg=i,Kf=Lu/2,r4=Math.min(Cc.len/2,rl.len/2),a?(yc=Math.abs(Math.cos(Kf)*Jg/Math.sin(Kf)),yc>r4?(yc=r4,up=Math.abs(yc*Math.sin(Kf)/Math.cos(Kf))):up=Jg):(yc=Math.min(r4,Jg),up=Math.abs(yc*Math.sin(Kf)/Math.cos(Kf))),fP=r.x+rl.nx*yc,pP=r.y+rl.ny*yc,hP=fP-rl.ny*up*Ap,dP=pP+rl.nx*up*Ap,o2e=r.x+Cc.nx*yc,l2e=r.y+Cc.ny*yc,rte=r};function c2e(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 sW(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}:(b0t(t,e,r,n,i),{cx:hP,cy:dP,radius:up,startX:o2e,startY:l2e,stopX:fP,stopY:pP,startAngle:Cc.ang+Math.PI/2*Ap,endAngle:rl.ang-Math.PI/2*Ap,counterClockwise:p3})}var lk=.01,x0t=Math.sqrt(2*lk),Cs={};Cs.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(C,S,k,E){var _=E-S,M=k-C,L=Math.sqrt(M*M+_*_);return{x:-_/L,y:M/L}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=zi(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),y=zi(m,2),v=y[0],T=y[1],b={x1:p,y1:g,x2:v,y2:T};i=u(p,g,v,T),a=b}else Cn("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}};Cs.findHaystackPoints=function(t){for(var e=0;e0?Math.max(j-ue,0):Math.min(j+ue,0)},D=P(M,E),R=P(L,_),I=!1;T===u?v=Math.abs(D)>Math.abs(R)?i:n:T===l||T===o?(v=n,I=!0):(T===a||T===s)&&(v=i,I=!0);var $=v===n,O=$?R:D,N=$?L:M,F=YG(N),z=!1;!(I&&(w||S))&&(T===o&&N<0||T===l&&N>0||T===a&&N>0||T===s&&N<0)&&(F*=-1,O=F*Math.abs(O),z=!0);var V;if(w){var B=C<0?1+C:C;V=B*O}else{var G=C<0?O:0;V=G+C*F}var H=function(j){return Math.abs(j)=Math.abs(O)},q=H(V),Z=H(Math.abs(O)-Math.abs(V)),Y=q||Z;if(Y&&!z)if($){var ie=Math.abs(N)<=f/2,K=Math.abs(M)<=p/2;if(ie){var Q=(h.x1+h.x2)/2,te=h.y1,J=h.y2;r.segpts=[Q,te,Q,J]}else if(K){var ge=(h.y1+h.y2)/2,ee=h.x1,Re=h.x2;r.segpts=[ee,ge,Re,ge]}else r.segpts=[h.x1,h.y2]}else{var Ie=Math.abs(N)<=d/2,Be=Math.abs(L)<=g/2;if(Ie){var ce=(h.y1+h.y2)/2,oe=h.x1,be=h.x2;r.segpts=[oe,ce,be,ce]}else if(Be){var fe=(h.x1+h.x2)/2,Pe=h.y1,ve=h.y2;r.segpts=[fe,Pe,fe,ve]}else r.segpts=[h.x2,h.y1]}else if($){var Ce=h.y1+V+(y?f/2*F:0),Ve=h.x1,se=h.x2;r.segpts=[Ve,Ce,se,Ce]}else{var de=h.x1+V+(y?d/2*F:0),Te=h.y1,ae=h.y2;r.segpts=[de,Te,de,ae]}if(r.isRound){var he=t.pstyle("taxi-radius").value,W=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(he),r.isArcRadius=new Array(r.segpts.length/2).fill(W)}};Cs.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,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!Dt(r.startX)||!Dt(r.startY),y=!Dt(r.arrowStartX)||!Dt(r.arrowStartY),v=!Dt(r.endX)||!Dt(r.endY),T=!Dt(r.arrowEndX)||!Dt(r.arrowEndY),b=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=b*w,S=V0({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),k=SN.poolIndex()){var F=O;O=N,N=F}var z=D.srcPos=O.position(),V=D.tgtPos=N.position(),B=D.srcW=O.outerWidth(),G=D.srcH=O.outerHeight(),H=D.tgtW=N.outerWidth(),q=D.tgtH=N.outerHeight(),Z=D.srcShape=r.nodeShapes[e.getNodeShape(O)],Y=D.tgtShape=r.nodeShapes[e.getNodeShape(N)],ie=D.srcCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,K=D.tgtCornerRadius=N.pstyle("corner-radius").value==="auto"?"auto":N.pstyle("corner-radius").pfValue,Q=D.tgtRs=N._private.rscratch,te=D.srcRs=O._private.rscratch;D.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var J=0;J=x0t||(se=Math.sqrt(Math.max(Ve*Ve,lk)+Math.max(Ce*Ce,lk)));var de=D.vector={x:Ve,y:Ce},Te=D.vectorNorm={x:de.x/se,y:de.y/se},ae={x:-Te.y,y:Te.x};D.nodesOverlap=!Dt(se)||Y.checkPoint(ce[0],ce[1],0,H,q,V.x,V.y,K,Q)||Z.checkPoint(be[0],be[1],0,B,G,z.x,z.y,ie,te),D.vectorNormInverse=ae,R={nodesOverlap:D.nodesOverlap,dirCounts:D.dirCounts,calculatedIntersection:!0,hasBezier:D.hasBezier,hasUnbundled:D.hasUnbundled,eles:D.eles,srcPos:V,srcRs:Q,tgtPos:z,tgtRs:te,srcW:H,srcH:q,tgtW:B,tgtH:G,srcIntn:fe,tgtIntn:oe,srcShape:Y,tgtShape:Z,posPts:{x1:ve.x2,y1:ve.y2,x2:ve.x1,y2:ve.y1},intersectionPts:{x1:Pe.x2,y1:Pe.y2,x2:Pe.x1,y2:Pe.y1},vector:{x:-de.x,y:-de.y},vectorNorm:{x:-Te.x,y:-Te.y},vectorNormInverse:{x:-ae.x,y:-ae.y}}}var he=Be?R:D;ee.nodesOverlap=he.nodesOverlap,ee.srcIntn=he.srcIntn,ee.tgtIntn=he.tgtIntn,ee.isRound=Re.startsWith("round"),i&&(O.isParent()||O.isChild()||N.isParent()||N.isChild())&&(O.parents().anySame(N)||N.parents().anySame(O)||O.same(N)&&O.isParent())?e.findCompoundLoopPoints(ge,he,J,Ie):O===N?e.findLoopPoints(ge,he,J,Ie):Re.endsWith("segments")?e.findSegmentsPoints(ge,he):Re.endsWith("taxi")?e.findTaxiPoints(ge,he):Re==="straight"||!Ie&&D.eles.length%2===1&&J===Math.floor(D.eles.length/2)?e.findStraightEdgePoints(ge):e.findBezierPoints(ge,he,J,Ie,Be),e.findEndpoints(ge),e.tryToCorrectInvalidPoints(ge,he),e.checkForInvalidEdgeWarning(ge),e.storeAllpts(ge),e.storeEdgeProjections(ge),e.calculateArrowAngles(ge),e.recalculateEdgeLabelProjections(ge),e.calculateLabelAngles(ge)}},k=0;k0){var ce=u,oe=cp(ce,Xm(s)),be=cp(ce,Xm(Be)),fe=oe;if(be2){var Pe=cp(ce,{x:Be[2],y:Be[3]});Pe0){var X=h,Oe=cp(X,Xm(s)),xe=cp(X,Xm(ue)),Ge=Oe;if(xe2){var _e=cp(X,{x:ue[2],y:ue[3]});_e=g||k){y={cp:w,segment:S};break}}if(y)break}var E=y.cp,_=y.segment,M=(g-v)/_.length,L=_.t1-_.t0,P=p?_.t0+L*M:_.t1-L*M;P=rk(0,P,1),e=by(E.p0,E.p1,E.p2,P),f=w0t(E.p0,E.p1,E.p2,P);break}case"straight":case"segments":case"haystack":{for(var D=0,R,I,$,O,N=n.allpts.length,F=0;F+3=g));F+=2);var z=g-I,V=z/R;V=rk(0,V,1),e=Wht($,O,V),f=d2e($,O);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}};du.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};du.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=z0(n,t._private.labelDimsKey);if(Ms(r.rscratch,"prefixedLabelDimsKey",e)!==i){Mc(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=Ms(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=o*s,f=a.width,p=a.height+(h-1)*(s-1)*o;Mc(r.rstyle,"labelWidth",e,f),Mc(r.rscratch,"labelWidth",e,f),Mc(r.rstyle,"labelHeight",e,p),Mc(r.rscratch,"labelHeight",e,p),Mc(r.rscratch,"labelLineHeight",e,d),Mc(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}};du.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=function(G,H){return H?(Mc(r.rscratch,G,e,H),H):Ms(r.rscratch,G,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="​",h=i.split(` +*/var Wve=function(e,r){this.recycle(e,r)};function pT(){return!1}function JE(){return!0}Wve.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=pT,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?JE:pT):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()},preventDefault:function(){this.isDefaultPrevented=JE;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=JE;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=JE,this.stopPropagation()},isDefaultPrevented:pT,isPropagationStopped:pT,isImmediatePropagationStopped:pT};var Hve=/^([^.]+)(\.(?:[^.]+))?$/,_pt=".*",qve={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Bee=Object.keys(qve),Rpt={};function dL(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Rpt,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)s(o);return this};ff.removeAllListeners=function(){return this.removeListener("*")};ff.emit=ff.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Nn(e)||(e=[e]),Lpt(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===_pt)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&bht(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,s),p=h.callback.apply(f,d);a.afterEmit(a.context,h,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,a.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne: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},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&or(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,a=0;an&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,s=0;s=0&&a"u"?"undefined":ca(Symbol))!=e&&ca(Symbol.iterator)!=e;r&&(y_[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return Y1e({next:function(){return a1&&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)}},numericStyle: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}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(ln(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(or(e))if(r===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle: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;s0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});ys.neighbourhood=ys.neighborhood;ys.closedNeighbourhood=ys.closedNeighborhood;ys.openNeighbourhood=ys.openNeighborhood;dr(ys,{source:pl(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:pl(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:Hee({attr:"source"}),targets:Hee({attr:"target"})});function Hee(t){return function(r){for(var n=[],i=0;i0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});ys.componentsOf=ys.components;var Za=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 th,s=!1;if(!r)r=[];else if(r.length>0&&ln(r[0])&&!dS(r[0])){s=!0;for(var o=[],l=new Rx,u=0,h=r.length;u0&&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=[],o,l=0,u=r.length;l0){for(var F=o.length===r.length?r:new Za(n,o),z=0;z0&&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(R){for(var I=R._private.edges,$=0;$0&&(t?L.emitAndNotify("remove"):e&&L.emit("remove"));for(var P=0;P0?P=R:L=R;while(Math.abs(D)>s&&++I=a?T(M,I):$===0?I:w(M,L,L+u)}var S=!1;function k(){S=!0,(t!==e||r!==n)&&b()}var E=function(L){return S||k(),t===e&&r===n?L:L===0?0:L===1?1:y(C(L),e,n)};E.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var _="generateBezier("+[t,e,r,n]+")";return E.toString=function(){return _},E}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var Vpt=(function(){function t(n){return-n.tension*n.x-n.friction*n.v}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)}}function r(n,i){var a={dx:n.v,dv:t(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),u=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,f=s!==null,f?(u=n(i,a),p=u/s*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}})(),Pn=function(e,r,n,i){var a=zpt(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},h3={linear:function(e,r,n){return e+(r-e)*n},ease:Pn(.25,.1,.25,1),"ease-in":Pn(.42,0,1,1),"ease-out":Pn(0,0,.58,1),"ease-in-out":Pn(.42,0,.58,1),"ease-in-sine":Pn(.47,0,.745,.715),"ease-out-sine":Pn(.39,.575,.565,1),"ease-in-out-sine":Pn(.445,.05,.55,.95),"ease-in-quad":Pn(.55,.085,.68,.53),"ease-out-quad":Pn(.25,.46,.45,.94),"ease-in-out-quad":Pn(.455,.03,.515,.955),"ease-in-cubic":Pn(.55,.055,.675,.19),"ease-out-cubic":Pn(.215,.61,.355,1),"ease-in-out-cubic":Pn(.645,.045,.355,1),"ease-in-quart":Pn(.895,.03,.685,.22),"ease-out-quart":Pn(.165,.84,.44,1),"ease-in-out-quart":Pn(.77,0,.175,1),"ease-in-quint":Pn(.755,.05,.855,.06),"ease-out-quint":Pn(.23,1,.32,1),"ease-in-out-quint":Pn(.86,0,.07,1),"ease-in-expo":Pn(.95,.05,.795,.035),"ease-out-expo":Pn(.19,1,.22,1),"ease-in-out-expo":Pn(1,0,0,1),"ease-in-circ":Pn(.6,.04,.98,.335),"ease-out-circ":Pn(.075,.82,.165,1),"ease-in-out-circ":Pn(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return h3.linear;var i=Vpt(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":Pn};function Yee(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 Xee(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Zg(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=Xee(t,i),o=Xee(e,i);if(Dt(s)&&Dt(o))return Yee(a,s,o,r,n);if(Nn(s)&&Nn(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(s.duration),s.easingImpl=h3[p].apply(null,g)):s.easingImpl=h3[p]}var m=s.easingImpl,y;if(s.duration===0?y=1:y=(r-l)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var v=s.startPosition,T=s.position;if(T&&i&&!t.locked()){var b={};gT(v.x,T.x)&&(b.x=Zg(v.x,T.x,y,m)),gT(v.y,T.y)&&(b.y=Zg(v.y,T.y,y,m)),t.position(b)}var w=s.startPan,C=s.pan,S=a.pan,k=C!=null&&n;k&&(gT(w.x,C.x)&&(S.x=Zg(w.x,C.x,y,m)),gT(w.y,C.y)&&(S.y=Zg(w.y,C.y,y,m)),t.emit("pan"));var E=s.startZoom,_=s.zoom,M=_!=null&&n;M&&(gT(E,_)&&(a.zoom=rk(a.minZoom,Zg(E,_,y,m),a.maxZoom)),t.emit("zoom")),(k||M)&&t.emit("viewport");var L=s.style;if(L&&L.length>0&&i){for(var P=0;P=0;k--){var E=S[k];E()}S.splice(0,S.length)},T=p.length-1;T>=0;T--){var b=p[T],w=b._private;if(w.stopped){p.splice(T,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||Wpt(h,b,t),Gpt(h,b,t,d),w.applying&&(w.applying=!1),v(w.frames),w.step!=null&&w.step(t),b.completed()&&(p.splice(T,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var a=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var Hpt={animate:Tn.animate(),animation:Tn.animation(),animated:Tn.animated(),clearQueue:Tn.clearQueue(),delay:Tn.delay(),delayAnimation:Tn.delayAnimation(),stop:Tn.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&d_(function(a){jee(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){jee(s,e)},n.beforeRenderPriorities.animations):r()}},qpt={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&dS(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},t4=function(e){return or(e)?new hf(e):e},Zve={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new dL(qpt,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,t4(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,t4(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,t4(r),n),this},once:function(e,r,n){return this.emitter().one(e,t4(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};Tn.eventAliasesOn(Zve);var cP={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};cP.jpeg=cP.jpg;var d3={layout: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;or(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(dr({},e,{cy:r,eles:a}));return s}};d3.createLayout=d3.makeLayout=d3.layout;var Upt={notify: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)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch: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},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i0;)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=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};uP.invalidateDimensions=uP.resize;var f3={collection:function(e,r){return or(e)?this.$(e):Po(e)?e.collection():Nn(e)?(r||(r={}),new Za(this,e,r.unique,r.removed)):new Za(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};f3.elements=f3.filter=f3.$;var Ra={},qw="t",Xpt="f";Ra.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m1&&(w=1),o.color){var S=n.valueMin[0],k=n.valueMax[0],E=n.valueMin[1],_=n.valueMax[1],M=n.valueMin[2],L=n.valueMax[2],P=n.valueMin[3]==null?1:n.valueMin[3],D=n.valueMax[3]==null?1:n.valueMax[3],R=[Math.round(S+(k-S)*w),Math.round(E+(_-E)*w),Math.round(M+(L-M)*w),Math.round(P+(D-P)*w)];a={bypass:n.bypass,name:n.name,value:R,strValue:"rgb("+R[0]+", "+R[1]+", "+R[2]+")"}}else if(o.number){var I=n.valueMin+(n.valueMax-n.valueMin)*w;a=this.parse(n.name,I,n.bypass,f)}else return!1;if(!a)return m(),!1;a.mapping=n,n=a;break}case s.data:{for(var $=n.field.split("."),O=d.data,N=0;N<$.length&&O;N++){var F=$[N];O=O[F]}if(O!=null&&(a=this.parse(n.name,O,n.bypass,f)),!a)return m(),!1;a.mapping=n,n=a;break}case s.fn:{var z=n.value,V=n.fnValue!=null?n.fnValue:z(t);if(n.prevFnValue=V,V==null)return Cn("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(a=this.parse(n.name,V,n.bypass,f),!a)return Cn("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=Fc(n),n=a;break}case void 0:break;default:return!1}return l?(h?n.bypassed=u.bypassed:n.bypassed=u,i[n.name]=n):h?u.bypassed=n:i[n.name]=n,g(),!0};Ra.cleanElements=function(t,e){for(var r=0;r0&&a>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(s).play().promise().then(b):b()}).then(function(){return t.animation({style:o,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)};Ra.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);t.removed()||o!=null&&o(r,n,t)&&a(s)};Ra.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)})};Ra.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};Ra.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};Ra.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};Ra.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var bS={};bS.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;oi.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){Cn("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new hf(d);if(f.invalid){Cn("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;a=p;for(var m=[];;){var y=a.match(/^\s*$/);if(y)break;var v=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!v){Cn("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=v[0];var T=v[1],b=v[2],w=e.properties[T];if(!w){Cn("Skipping property: Invalid property name in: "+s),l();continue}var C=r.parse(T,b);if(!C){Cn("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:T,val:b}),l()}if(g){o();break}r.selector(d);for(var S=0;S=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return Cn("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var y=g.value,v=m.value,T=y[0]===v[0]&&y[1]===v[1]&&y[2]===v[2]&&(y[3]===v[3]||(y[3]==null||y[3]===1)&&(v[3]==null||v[3]===1));if(T)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var b;if(l?b=e.split(/\s+/):Nn(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var w=[],C=[],S=[],k="",E=!1,_=0;_0?" ":"")+M.strValue}return u.validate&&!u.validate(w,C)?null:u.singleEnum&&E?w.length===1&&or(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:S,strValue:k,bypass:r,units:C}}var L=function(){for(var K=0;Ku.max||u.strictMax&&e===u.max))return null;var $={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:r};return u.unitless||P!=="px"&&P!=="em"?$.pfValue=e:$.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&($.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&($.pfValue=P==="rad"?e:Hht(e)),P==="%"&&($.pfValue=e/100),$}else if(u.propList){var O=[],N=""+e;if(N!=="none"){for(var F=N.split(/\s*,\s*|\s+/),z=0;z0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,o=!1;if(r.zoomingEnabled||(o=!0),Dt(e)?s=e:ln(e)&&(s=e.level,e.position!=null?a=aL(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=sr.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;Dt(u.x)&&(r.pan.x=u.x,o=!1),Dt(u.y)&&(r.pan.y=u.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(or(e)){var n=e;e=this.mutableElements().filter(n)}else Po(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 o={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?(function(){var i=n.window().getComputedStyle(r),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent: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},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};W0.centre=W0.center;W0.autolockNodes=W0.autolock;W0.autoungrabifyNodes=W0.autoungrabify;var sk={data:Tn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Tn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Tn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Tn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};sk.attr=sk.data;sk.removeAttr=sk.removeData;var ok=function(e){var r=this;e=dr({},e);var n=e.container;n&&!h_(n)&&h_(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=ra!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=dr({name:s?"grid":"null"},o.layout),o.renderer=dr({name:s?"canvas":"null"},o.renderer);var l=function(g,m,y){return m!==void 0?m:y!==void 0?y:g},u=this._private={container:n,ready:!1,options:o,elements:new Za(this),listeners:[],aniEles:new Za(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:Dt(o.zoom)?o.zoom:1,pan:{x:ln(o.pan)&&Dt(o.pan.x)?o.pan.x:0,y:ln(o.pan)&&Dt(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var y=g.some(But);if(y)return Lx.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=dr({},o,o.renderer);r.initRenderer(d);var f=function(g,m,y){r.notifications(!1);var v=r.mutableElements();v.length>0&&v.remove(),g!=null&&(ln(g)||Nn(g))&&r.add(g),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var T=dr({},r._private.options.layout);T.eles=r.elements(),r.layout(T).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,gi(o.ready)&&r.on("ready",o.ready);for(var y=0;y0,o=!!t.boundingBox,l=Us(o?t.boundingBox:structuredClone(e.extent())),u;if(Po(t.roots))u=t.roots;else if(Nn(t.roots)){for(var h=[],d=0;d0;){var R=D(),I=_(R,L);if(I)R.outgoers().filter(function(oe){return oe.isNode()&&r.has(oe)}).forEach(P);else if(I===null){Cn("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var $=0;if(t.avoidOverlap)for(var O=0;O0&&v[0].length<=3?Ce/2:0),se=2*Math.PI/v[Pe].length*ve;return Pe===0&&v[0].length===1&&(Ve=1),{x:J.x+Ve*Math.cos(se),y:J.y+Ve*Math.sin(se)}}else{var de=v[Pe].length,Te=Math.max(de===1?0:o?(l.w-t.padding*2-ge.w)/((t.grid?Re:de)-1):(l.w-t.padding*2-ge.w)/((t.grid?Re:de)+1),$),ae={x:J.x+(ve+1-(de+1)/2)*Te,y:J.y+(Pe+1-(q+1)/2)*ee};return ae}},Be={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Be).indexOf(t.direction)===-1&&oi("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Be).join(", ")));var ce=function(be){return fht(Ie(be),l,Be[t.direction])};return r.nodes().layoutPositions(this,t,ce),this};var Jpt={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:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Jve(t){this.options=dr({},Jpt,t)}Jve.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=Us(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,u=l/Math.max(1,a.length-1),h,d=0,f=0;f1&&e.avoidOverlap){d*=1.75;var v=Math.cos(u)-Math.cos(0),T=Math.sin(u)-Math.sin(0),b=Math.sqrt(d*d/(v*v+T*T));h=Math.max(b,h)}var w=function(S,k){var E=e.startAngle+k*u*(i?1:-1),_=h*Math.cos(E),M=h*Math.sin(E),L={x:o.x+_,y:o.y+M};return L};return n.nodes().layoutPositions(this,e,w),this};var e0t={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:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function e2e(t){this.options=dr({},e0t,t)}e2e.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=Us(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,h=0;h0){var C=Math.abs(T[0].value-w.value);C>=y&&(T=[],v.push(T))}T.push(w)}var S=u+e.minNodeSpacing;if(!e.avoidOverlap){var k=v.length>0&&v[0].length>1,E=Math.min(s.w,s.h)/2-S,_=E/(v.length+k?1:0);S=Math.min(S,_)}for(var M=0,L=0;L1&&e.avoidOverlap){var I=Math.cos(R)-Math.cos(0),$=Math.sin(R)-Math.sin(0),O=Math.sqrt(S*S/(I*I+$*$));M=Math.max(O,M)}P.r=M,M+=S}if(e.equidistant){for(var N=0,F=0,z=0;z=t.numIter||(o0t(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),d_(h)}};h()}else{for(;u;)u=s(l),l++;Qee(n,t),o()}return this};yL.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};yL.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var r0t=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=Us(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={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},l=n.eles.components(),u={},h=0;h0){o.graphSet.push(E);for(var h=0;hi.count?0:i.graph},t2e=function(e,r,n,i){var a=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=b_(e,o,l),y=b_(r,-1*o,-1*l),v=y.x-m.x,T=y.y-m.y,b=v*v+T*T,f=Math.sqrt(b),d=(e.nodeRepulsion+r.nodeRepulsion)/b,p=d*v/f,g=d*T/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},u0t=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},b_=function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,h={};return r===0&&0n?(h.x=i,h.y=a+s/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=a-o*n/2/r,h):0=u)?(h.x=i+s*r/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-s*r/2/n,h.y=a-s/2),h)},h0t=function(e,r){for(var n=0;nn){var y=r.gravity*p/m,v=r.gravity*g/m;f.offsetX+=y,f.offsetY+=v}}}}},f0t=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++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},n2e=function(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.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTopv&&(g+=y+r.componentSpacing,p=0,m=0,y=0)}}},m0t={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:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function i2e(t){this.options=dr({},m0t,t)}i2e.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=Us(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(G){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),u=Math.round(a.w/a.h*o),h=function(H){if(H==null)return Math.min(l,u);var q=Math.min(l,u);q==l?l=H:u=H},d=function(H){if(H==null)return Math.max(l,u);var q=Math.max(l,u);q==l?l=H:u=H},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(s/l);else if(f==null&&p!=null)u=p,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=d();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&d(m-1)}else for(;u*l=s?d(v+1):h(y+1)}var T=a.w/u,b=a.h/l;if(e.condense&&(T=0,b=0),e.avoidOverlap)for(var w=0;w=u&&(I=0,R++)},O={},N=0;N(I=idt(t,e,$[O],$[O+1],$[O+2],$[O+3])))return y(k,I),!0}else if(_.edgeType==="bezier"||_.edgeType==="multibezier"||_.edgeType==="self"||_.edgeType==="compound"){for(var $=_.allpts,O=0;O+5<_.allpts.length;O+=4)if(edt(t,e,$[O],$[O+1],$[O+2],$[O+3],$[O+4],$[O+5],R)&&D>(I=ndt(t,e,$[O],$[O+1],$[O+2],$[O+3],$[O+4],$[O+5])))return y(k,I),!0}for(var N=N||E.source,F=F||E.target,z=i.getArrowWidth(M,L),V=[{name:"source",x:_.arrowStartX,y:_.arrowStartY,angle:_.srcArrowAngle},{name:"target",x:_.arrowEndX,y:_.arrowEndY,angle:_.tgtArrowAngle},{name:"mid-source",x:_.midX,y:_.midY,angle:_.midsrcArrowAngle},{name:"mid-target",x:_.midX,y:_.midY,angle:_.midtgtArrowAngle}],O=0;O0&&(v(N),v(F))}function b(k,E,_){return Ms(k,E,_)}function w(k,E){var _=k._private,M=f,L;E?L=E+"-":L="",k.boundingBox();var P=_.labelBounds[E||"main"],D=k.pstyle(L+"label").value,R=k.pstyle("text-events").strValue==="yes";if(!(!R||!D)){var I=b(_.rscratch,"labelX",E),$=b(_.rscratch,"labelY",E),O=b(_.rscratch,"labelAngle",E),N=k.pstyle(L+"text-margin-x").pfValue,F=k.pstyle(L+"text-margin-y").pfValue,z=P.x1-M-N,V=P.x2+M-N,B=P.y1-M-F,G=P.y2+M-F;if(O){var H=Math.cos(O),q=Math.sin(O),Z=function(ge,ee){return ge=ge-I,ee=ee-$,{x:ge*H-ee*q+I,y:ge*q+ee*H+$}},Y=Z(z,B),ie=Z(z,G),K=Z(V,B),Q=Z(V,G),te=[Y.x+N,Y.y+F,K.x+N,K.y+F,Q.x+N,Q.y+F,ie.x+N,ie.y+F];if(fo(t,e,te))return y(k),!0}else if(Dd(P,t,e))return y(k),!0}}for(var C=s.length-1;C>=0;C--){var S=s[C];S.isNode()?v(S)||w(S):T(S)||w(S)||w(S,"source")||w(S,"target")}return o};pg.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=Us({x1:t,y1:e,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],g=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function m(ge,ee,Re){return Ms(ge,ee,Re)}function y(ge,ee){var Re=ge._private,Ie=s,Be="";ge.boundingBox();var ce=Re.labelBounds.main;if(!ce)return null;var oe=m(Re.rscratch,"labelX",ee),be=m(Re.rscratch,"labelY",ee),fe=m(Re.rscratch,"labelAngle",ee),Pe=ge.pstyle(Be+"text-margin-x").pfValue,ve=ge.pstyle(Be+"text-margin-y").pfValue,Ce=ce.x1-Ie-Pe,Ve=ce.x2+Ie-Pe,se=ce.y1-Ie-ve,de=ce.y2+Ie-ve;if(fe){var Te=Math.cos(fe),ae=Math.sin(fe),he=function(ne,j){return ne=ne-oe,j=j-be,{x:ne*Te-j*ae+oe,y:ne*ae+j*Te+be}};return[he(Ce,se),he(Ve,se),he(Ve,de),he(Ce,de)]}else return[{x:Ce,y:se},{x:Ve,y:se},{x:Ve,y:de},{x:Ce,y:de}]}function v(ge,ee,Re,Ie){function Be(ce,oe,be){return(be.y-ce.y)*(oe.x-ce.x)>(oe.y-ce.y)*(be.x-ce.x)}return Be(ge,Re,Ie)!==Be(ee,Re,Ie)&&Be(ge,ee,Re)!==Be(ge,ee,Ie)}for(var T=0;T0?-(Math.PI-e.ang):Math.PI+e.ang},w0t=function(e,r,n,i,a){if(e!==nte?ite(r,e,Cc):T0t(rl,Cc),ite(r,n,rl),tte=Cc.nx*rl.ny-Cc.ny*rl.nx,rte=Cc.nx*rl.nx-Cc.ny*-rl.ny,Lu=Math.asin(Math.max(-1,Math.min(1,tte))),Math.abs(Lu)<1e-6){hP=r.x,dP=r.y,up=Jg=0;return}Ap=1,p3=!1,rte<0?Lu<0?Lu=Math.PI+Lu:(Lu=Math.PI-Lu,Ap=-1,p3=!0):Lu>0&&(Ap=-1,p3=!0),r.radius!==void 0?Jg=r.radius:Jg=i,Kf=Lu/2,r4=Math.min(Cc.len/2,rl.len/2),a?(yc=Math.abs(Math.cos(Kf)*Jg/Math.sin(Kf)),yc>r4?(yc=r4,up=Math.abs(yc*Math.sin(Kf)/Math.cos(Kf))):up=Jg):(yc=Math.min(r4,Jg),up=Math.abs(yc*Math.sin(Kf)/Math.cos(Kf))),fP=r.x+rl.nx*yc,pP=r.y+rl.ny*yc,hP=fP-rl.ny*up*Ap,dP=pP+rl.nx*up*Ap,l2e=r.x+Cc.nx*yc,c2e=r.y+Cc.ny*yc,nte=r};function u2e(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 sW(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}:(w0t(t,e,r,n,i),{cx:hP,cy:dP,radius:up,startX:l2e,startY:c2e,stopX:fP,stopY:pP,startAngle:Cc.ang+Math.PI/2*Ap,endAngle:rl.ang-Math.PI/2*Ap,counterClockwise:p3})}var lk=.01,C0t=Math.sqrt(2*lk),Cs={};Cs.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(C,S,k,E){var _=E-S,M=k-C,L=Math.sqrt(M*M+_*_);return{x:-_/L,y:M/L}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=zi(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),y=zi(m,2),v=y[0],T=y[1],b={x1:p,y1:g,x2:v,y2:T};i=u(p,g,v,T),a=b}else Cn("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}};Cs.findHaystackPoints=function(t){for(var e=0;e0?Math.max(j-ue,0):Math.min(j+ue,0)},D=P(M,E),R=P(L,_),I=!1;T===u?v=Math.abs(D)>Math.abs(R)?i:n:T===l||T===o?(v=n,I=!0):(T===a||T===s)&&(v=i,I=!0);var $=v===n,O=$?R:D,N=$?L:M,F=YG(N),z=!1;!(I&&(w||S))&&(T===o&&N<0||T===l&&N>0||T===a&&N>0||T===s&&N<0)&&(F*=-1,O=F*Math.abs(O),z=!0);var V;if(w){var B=C<0?1+C:C;V=B*O}else{var G=C<0?O:0;V=G+C*F}var H=function(j){return Math.abs(j)=Math.abs(O)},q=H(V),Z=H(Math.abs(O)-Math.abs(V)),Y=q||Z;if(Y&&!z)if($){var ie=Math.abs(N)<=f/2,K=Math.abs(M)<=p/2;if(ie){var Q=(h.x1+h.x2)/2,te=h.y1,J=h.y2;r.segpts=[Q,te,Q,J]}else if(K){var ge=(h.y1+h.y2)/2,ee=h.x1,Re=h.x2;r.segpts=[ee,ge,Re,ge]}else r.segpts=[h.x1,h.y2]}else{var Ie=Math.abs(N)<=d/2,Be=Math.abs(L)<=g/2;if(Ie){var ce=(h.y1+h.y2)/2,oe=h.x1,be=h.x2;r.segpts=[oe,ce,be,ce]}else if(Be){var fe=(h.x1+h.x2)/2,Pe=h.y1,ve=h.y2;r.segpts=[fe,Pe,fe,ve]}else r.segpts=[h.x2,h.y1]}else if($){var Ce=h.y1+V+(y?f/2*F:0),Ve=h.x1,se=h.x2;r.segpts=[Ve,Ce,se,Ce]}else{var de=h.x1+V+(y?d/2*F:0),Te=h.y1,ae=h.y2;r.segpts=[de,Te,de,ae]}if(r.isRound){var he=t.pstyle("taxi-radius").value,W=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(he),r.isArcRadius=new Array(r.segpts.length/2).fill(W)}};Cs.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,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!Dt(r.startX)||!Dt(r.startY),y=!Dt(r.arrowStartX)||!Dt(r.arrowStartY),v=!Dt(r.endX)||!Dt(r.endY),T=!Dt(r.arrowEndX)||!Dt(r.arrowEndY),b=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=b*w,S=V0({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),k=SN.poolIndex()){var F=O;O=N,N=F}var z=D.srcPos=O.position(),V=D.tgtPos=N.position(),B=D.srcW=O.outerWidth(),G=D.srcH=O.outerHeight(),H=D.tgtW=N.outerWidth(),q=D.tgtH=N.outerHeight(),Z=D.srcShape=r.nodeShapes[e.getNodeShape(O)],Y=D.tgtShape=r.nodeShapes[e.getNodeShape(N)],ie=D.srcCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,K=D.tgtCornerRadius=N.pstyle("corner-radius").value==="auto"?"auto":N.pstyle("corner-radius").pfValue,Q=D.tgtRs=N._private.rscratch,te=D.srcRs=O._private.rscratch;D.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var J=0;J=C0t||(se=Math.sqrt(Math.max(Ve*Ve,lk)+Math.max(Ce*Ce,lk)));var de=D.vector={x:Ve,y:Ce},Te=D.vectorNorm={x:de.x/se,y:de.y/se},ae={x:-Te.y,y:Te.x};D.nodesOverlap=!Dt(se)||Y.checkPoint(ce[0],ce[1],0,H,q,V.x,V.y,K,Q)||Z.checkPoint(be[0],be[1],0,B,G,z.x,z.y,ie,te),D.vectorNormInverse=ae,R={nodesOverlap:D.nodesOverlap,dirCounts:D.dirCounts,calculatedIntersection:!0,hasBezier:D.hasBezier,hasUnbundled:D.hasUnbundled,eles:D.eles,srcPos:V,srcRs:Q,tgtPos:z,tgtRs:te,srcW:H,srcH:q,tgtW:B,tgtH:G,srcIntn:fe,tgtIntn:oe,srcShape:Y,tgtShape:Z,posPts:{x1:ve.x2,y1:ve.y2,x2:ve.x1,y2:ve.y1},intersectionPts:{x1:Pe.x2,y1:Pe.y2,x2:Pe.x1,y2:Pe.y1},vector:{x:-de.x,y:-de.y},vectorNorm:{x:-Te.x,y:-Te.y},vectorNormInverse:{x:-ae.x,y:-ae.y}}}var he=Be?R:D;ee.nodesOverlap=he.nodesOverlap,ee.srcIntn=he.srcIntn,ee.tgtIntn=he.tgtIntn,ee.isRound=Re.startsWith("round"),i&&(O.isParent()||O.isChild()||N.isParent()||N.isChild())&&(O.parents().anySame(N)||N.parents().anySame(O)||O.same(N)&&O.isParent())?e.findCompoundLoopPoints(ge,he,J,Ie):O===N?e.findLoopPoints(ge,he,J,Ie):Re.endsWith("segments")?e.findSegmentsPoints(ge,he):Re.endsWith("taxi")?e.findTaxiPoints(ge,he):Re==="straight"||!Ie&&D.eles.length%2===1&&J===Math.floor(D.eles.length/2)?e.findStraightEdgePoints(ge):e.findBezierPoints(ge,he,J,Ie,Be),e.findEndpoints(ge),e.tryToCorrectInvalidPoints(ge,he),e.checkForInvalidEdgeWarning(ge),e.storeAllpts(ge),e.storeEdgeProjections(ge),e.calculateArrowAngles(ge),e.recalculateEdgeLabelProjections(ge),e.calculateLabelAngles(ge)}},k=0;k0){var ce=u,oe=cp(ce,Xm(s)),be=cp(ce,Xm(Be)),fe=oe;if(be2){var Pe=cp(ce,{x:Be[2],y:Be[3]});Pe0){var X=h,Oe=cp(X,Xm(s)),xe=cp(X,Xm(ue)),Ge=Oe;if(xe2){var _e=cp(X,{x:ue[2],y:ue[3]});_e=g||k){y={cp:w,segment:S};break}}if(y)break}var E=y.cp,_=y.segment,M=(g-v)/_.length,L=_.t1-_.t0,P=p?_.t0+L*M:_.t1-L*M;P=rk(0,P,1),e=by(E.p0,E.p1,E.p2,P),f=S0t(E.p0,E.p1,E.p2,P);break}case"straight":case"segments":case"haystack":{for(var D=0,R,I,$,O,N=n.allpts.length,F=0;F+3=g));F+=2);var z=g-I,V=z/R;V=rk(0,V,1),e=Uht($,O,V),f=f2e($,O);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}};du.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};du.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=z0(n,t._private.labelDimsKey);if(Ms(r.rscratch,"prefixedLabelDimsKey",e)!==i){Mc(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=Ms(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=o*s,f=a.width,p=a.height+(h-1)*(s-1)*o;Mc(r.rstyle,"labelWidth",e,f),Mc(r.rscratch,"labelWidth",e,f),Mc(r.rstyle,"labelHeight",e,p),Mc(r.rscratch,"labelHeight",e,p),Mc(r.rscratch,"labelLineHeight",e,d),Mc(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}};du.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=function(G,H){return H?(Mc(r.rscratch,G,e,H),H):Ms(r.rscratch,G,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="​",h=i.split(` `),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,y=0;yd){var C=v.matchAll(m),S="",k=0,E=yo(C),_;try{for(E.s();!(_=E.n()).done;){var M=_.value,L=M[0],P=v.substring(k,M.index);k=M.index+L.length;var D=S.length===0?P:S+P+L,R=this.calculateLabelDimensions(t,D),I=R.width;I<=d?S+=P+L:(S&&g.push(S),S=P+L)}}catch(B){E.e(B)}finally{E.f()}S.match(/^[\s\u200b]+$/)||g.push(S)}else g.push(v)}s("labelWrapCachedLines",g),i=s("labelWrapCachedText",g.join(` -`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var $=t.pstyle("text-max-width").pfValue,O="",N="…",F=!1;if(this.calculateLabelDimensions(t,i).width<$)return i;for(var z=0;z$)break;O+=i[z],z===i.length-1&&(F=!0)}return F||(O+=N),O}return i};du.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?cpt(r):"center":e};du.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,h=t.pstyle("text-metrics").strValue||"font",d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=i.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}f.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var g=0,m=0,y=e.split(` -`),v=y.length,T=0,b=0,w=0;w1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var vt=a(W);at&&(t.hoverData.tapholdCancelled=!0);var ot=function(){var Nt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Nt.length===0?(Nt.push(Ke[0]),Nt.push(Ke[1])):(Nt[0]+=Ke[0],Nt[1]+=Ke[1])};j=!0,i(Me,["mousemove","vmousemove","tapdrag"],W,{x:xe[0],y:xe[1]});var pe=function(Nt){return{originalEvent:W,type:Nt,position:{x:xe[0],y:xe[1]}}},Ct=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||ue.emit(pe("boxstart")),$e[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(at){var lt=pe("cxtdrag");De?De.emit(lt):ue.emit(lt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Me!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(pe("cxtdragout")),t.hoverData.cxtOver=Me,Me&&Me.emit(pe("cxtdragover")))}}else if(t.hoverData.dragging){if(j=!0,ue.panningEnabled()&&ue.userPanningEnabled()){var st;if(t.hoverData.justStartedPan){var mt=t.hoverData.mdownPos;st={x:(xe[0]-mt[0])*X,y:(xe[1]-mt[1])*X},t.hoverData.justStartedPan=!1}else st={x:Ke[0]*X,y:Ke[1]*X};ue.panBy(st),ue.emit(pe("dragpan")),t.hoverData.dragged=!0}xe=t.projectIntoViewport(W.clientX,W.clientY)}else if($e[4]==1&&(De==null||De.pannable())){if(at){if(!t.hoverData.dragging&&ue.boxSelectionEnabled()&&(vt||!ue.panningEnabled()||!ue.userPanningEnabled()))Ct();else if(!t.hoverData.selecting&&ue.panningEnabled()&&ue.userPanningEnabled()){var _r=s(De,t.hoverData.downs);_r&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,$e[4]=0,t.data.bgActivePosistion=Xm(Ge),t.redrawHint("select",!0),t.redraw())}De&&De.pannable()&&De.active()&&De.unactivate()}}else{if(De&&De.pannable()&&De.active()&&De.unactivate(),(!De||!De.grabbed())&&Me!=He&&(He&&i(He,["mouseout","tapdragout"],W,{x:xe[0],y:xe[1]}),Me&&i(Me,["mouseover","tapdragover"],W,{x:xe[0],y:xe[1]}),t.hoverData.last=Me),De)if(at){if(ue.boxSelectionEnabled()&&vt)De&&De.grabbed()&&(m(Ae),De.emit(pe("freeon")),Ae.emit(pe("free")),t.dragData.didDrag&&(De.emit(pe("dragfreeon")),Ae.emit(pe("dragfree")))),Ct();else if(De&&De.grabbed()&&t.nodeIsDraggable(De)){var Se=!t.dragData.didDrag;Se&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(Ae,{inDragLayer:!0});var Ue={x:0,y:0};if(Dt(Ke[0])&&Dt(Ke[1])&&(Ue.x+=Ke[0],Ue.y+=Ke[1],Se)){var tt=t.hoverData.dragDelta;tt&&Dt(tt[0])&&Dt(tt[1])&&(Ue.x+=tt[0],Ue.y+=tt[1])}t.hoverData.draggingEles=!0,Ae.silentShift(Ue).emit(pe("position")).emit(pe("drag")),t.redrawHint("drag",!0),t.redraw()}}else ot();j=!0}if($e[2]=xe[0],$e[3]=xe[1],j)return W.stopPropagation&&W.stopPropagation(),W.preventDefault&&W.preventDefault(),!1}},!1);var M,L,P;t.registerBinding(e,"mouseup",function(W){if(!(t.hoverData.which===1&&W.which!==1&&t.hoverData.capture)){var ne=t.hoverData.capture;if(ne){t.hoverData.capture=!1;var j=t.cy,ue=t.projectIntoViewport(W.clientX,W.clientY),X=t.selection,Oe=t.findNearestElement(ue[0],ue[1],!0,!1),xe=t.dragData.possibleDragElements,Ge=t.hoverData.down,_e=a(W);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Ge&&Ge.unactivate();var $e=function(Ee){return{originalEvent:W,type:Ee,position:{x:ue[0],y:ue[1]}}};if(t.hoverData.which===3){var Me=$e("cxttapend");if(Ge?Ge.emit(Me):j.emit(Me),!t.hoverData.cxtDragged){var He=$e("cxttap");Ge?Ge.emit(He):j.emit(He)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Oe,["mouseup","tapend","vmouseup"],W,{x:ue[0],y:ue[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Ge,["click","tap","vclick"],W,{x:ue[0],y:ue[1]}),L=!1,W.timeStamp-P<=j.multiClickDebounceTime()?(M&&clearTimeout(M),L=!0,P=null,i(Ge,["dblclick","dbltap","vdblclick"],W,{x:ue[0],y:ue[1]})):(M=setTimeout(function(){L||i(Ge,["oneclick","onetap","voneclick"],W,{x:ue[0],y:ue[1]})},j.multiClickDebounceTime()),P=W.timeStamp)),Ge==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(W)&&(j.$(r).unselect(["tapunselect"]),xe.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=xe=j.collection()),Oe==Ge&&!t.dragData.didDrag&&!t.hoverData.selecting&&Oe!=null&&Oe._private.selectable&&(t.hoverData.dragging||(j.selectionType()==="additive"||_e?Oe.selected()?Oe.unselect(["tapunselect"]):Oe.select(["tapselect"]):_e||(j.$(r).unmerge(Oe).unselect(["tapunselect"]),Oe.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var De=j.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));t.redrawHint("select",!0),De.length>0&&t.redrawHint("eles",!0),j.emit($e("boxend"));var Ke=function(Ee){return Ee.selectable()&&!Ee.selected()};j.selectionType()==="additive"||_e||j.$(r).unmerge(De).unselect(),De.emit($e("box")).stdFilter(Ke).select().emit($e("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!X[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Ae=Ge&&Ge.grabbed();m(xe),Ae&&(Ge.emit($e("freeon")),xe.emit($e("free")),t.dragData.didDrag&&(Ge.emit($e("dragfreeon")),xe.emit($e("dragfree"))))}}X[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var D=[],R=4,I,$=1e5,O=function(W,ne){for(var j=0;j=R){var ue=D;if(I=O(ue,5),!I){var X=Math.abs(ue[0]);I=N(ue)&&X>5}if(I)for(var Oe=0;Oe5&&(j=YG(j)*5),He=j/-250,I&&(He/=$,He*=3),He=He*t.wheelSensitivity;var De=W.deltaMode===1;De&&(He*=33);var Ke=xe.zoom()*Math.pow(10,He);W.type==="gesturechange"&&(Ke=t.gestureStartZoom*W.scale),xe.zoom({level:Ke,renderedPosition:{x:Me[0],y:Me[1]}}),xe.emit({type:W.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:W,position:{x:$e[0],y:$e[1]}})}}}};t.registerBinding(t.container,"wheel",F,!0),t.registerBinding(e,"scroll",function(W){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(W){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||W.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(he){t.hasTouchStarted||F(he)},!0),t.registerBinding(t.container,"mouseout",function(W){var ne=t.projectIntoViewport(W.clientX,W.clientY);t.cy.emit({originalEvent:W,type:"mouseout",position:{x:ne[0],y:ne[1]}})},!1),t.registerBinding(t.container,"mouseover",function(W){var ne=t.projectIntoViewport(W.clientX,W.clientY);t.cy.emit({originalEvent:W,type:"mouseover",position:{x:ne[0],y:ne[1]}})},!1);var z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge=function(W,ne,j,ue){return Math.sqrt((j-W)*(j-W)+(ue-ne)*(ue-ne))},ee=function(W,ne,j,ue){return(j-W)*(j-W)+(ue-ne)*(ue-ne)},Re;t.registerBinding(t.container,"touchstart",Re=function(W){if(t.hasTouchStarted=!0,!!E(W)){v(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var ne=t.cy,j=t.touchData.now,ue=t.touchData.earlier;if(W.touches[0]){var X=t.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);j[0]=X[0],j[1]=X[1]}if(W.touches[1]){var X=t.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);j[2]=X[0],j[3]=X[1]}if(W.touches[2]){var X=t.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);j[4]=X[0],j[5]=X[1]}var Oe=function(vt){return{originalEvent:W,type:vt,position:{x:j[0],y:j[1]}}};if(W.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var xe=t.findContainerClientCoords();ie=xe[0],K=xe[1],Q=xe[2],te=xe[3],z=W.touches[0].clientX-ie,V=W.touches[0].clientY-K,B=W.touches[1].clientX-ie,G=W.touches[1].clientY-K,J=0<=z&&z<=Q&&0<=B&&B<=Q&&0<=V&&V<=te&&0<=G&&G<=te;var Ge=ne.pan(),_e=ne.zoom();H=ge(z,V,B,G),q=ee(z,V,B,G),Z=[(z+B)/2,(V+G)/2],Y=[(Z[0]-Ge.x)/_e,(Z[1]-Ge.y)/_e];var $e=200,Me=$e*$e;if(q=1){for(var pt=t.touchData.startPosition=[null,null,null,null,null,null],ht=0;ht=t.touchTapThreshold2}if(ne&&t.touchData.cxt){W.preventDefault();var ht=W.touches[0].clientX-ie,rt=W.touches[0].clientY-K,Et=W.touches[1].clientX-ie,vt=W.touches[1].clientY-K,ot=ee(ht,rt,Et,vt),pe=ot/q,Ct=150,lt=Ct*Ct,st=1.5,mt=st*st;if(pe>=mt||ot>=lt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var _r=_e("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(_r),t.touchData.start=null):ue.emit(_r)}}if(ne&&t.touchData.cxt){var _r=_e("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(_r):ue.emit(_r),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Se=t.findNearestElement(X[0],X[1],!0,!0);(!t.touchData.cxtOver||Se!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(_e("cxtdragout")),t.touchData.cxtOver=Se,Se&&Se.emit(_e("cxtdragover")))}else if(ne&&W.touches[2]&&ue.boxSelectionEnabled())W.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||ue.emit(_e("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,j[4]=1,!j||j.length===0||j[0]===void 0?(j[0]=(X[0]+X[2]+X[4])/3,j[1]=(X[1]+X[3]+X[5])/3,j[2]=(X[0]+X[2]+X[4])/3+1,j[3]=(X[1]+X[3]+X[5])/3+1):(j[2]=(X[0]+X[2]+X[4])/3,j[3]=(X[1]+X[3]+X[5])/3),t.redrawHint("select",!0),t.redraw();else if(ne&&W.touches[1]&&!t.touchData.didSelect&&ue.zoomingEnabled()&&ue.panningEnabled()&&ue.userZoomingEnabled()&&ue.userPanningEnabled()){W.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ue=t.dragData.touchDragEles;if(Ue){t.redrawHint("drag",!0);for(var tt=0;tt0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Be;t.registerBinding(e,"touchcancel",Be=function(W){var ne=t.touchData.start;t.touchData.capture=!1,ne&&ne.unactivate()});var ce,oe,be,fe;if(t.registerBinding(e,"touchend",ce=function(W){var ne=t.touchData.start,j=t.touchData.capture;if(j)W.touches.length===0&&(t.touchData.capture=!1),W.preventDefault();else return;var ue=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var X=t.cy,Oe=X.zoom(),xe=t.touchData.now,Ge=t.touchData.earlier;if(W.touches[0]){var _e=t.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);xe[0]=_e[0],xe[1]=_e[1]}if(W.touches[1]){var _e=t.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);xe[2]=_e[0],xe[3]=_e[1]}if(W.touches[2]){var _e=t.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);xe[4]=_e[0],xe[5]=_e[1]}var $e=function(lt){return{originalEvent:W,type:lt,position:{x:xe[0],y:xe[1]}}};ne&&ne.unactivate();var Me;if(t.touchData.cxt){if(Me=$e("cxttapend"),ne?ne.emit(Me):X.emit(Me),!t.touchData.cxtDragged){var He=$e("cxttap");ne?ne.emit(He):X.emit(He)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!W.touches[2]&&X.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var De=X.collection(t.getAllInBox(ue[0],ue[1],ue[2],ue[3]));ue[0]=void 0,ue[1]=void 0,ue[2]=void 0,ue[3]=void 0,ue[4]=0,t.redrawHint("select",!0),X.emit($e("boxend"));var Ke=function(lt){return lt.selectable()&&!lt.selected()};De.emit($e("box")).stdFilter(Ke).select().emit($e("boxselect")),De.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(ne!=null&&ne.unactivate(),W.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!W.touches[1]){if(!W.touches[0]){if(!W.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ae=t.dragData.touchDragEles;if(ne!=null){var at=ne._private.grabbed;m(Ae),t.redrawHint("drag",!0),t.redrawHint("eles",!0),at&&(ne.emit($e("freeon")),Ae.emit($e("free")),t.dragData.didDrag&&(ne.emit($e("dragfreeon")),Ae.emit($e("dragfree")))),i(ne,["touchend","tapend","vmouseup","tapdragout"],W,{x:xe[0],y:xe[1]}),ne.unactivate(),t.touchData.start=null}else{var Ee=t.findNearestElement(xe[0],xe[1],!0,!0);i(Ee,["touchend","tapend","vmouseup","tapdragout"],W,{x:xe[0],y:xe[1]})}var pt=t.touchData.startPosition[0]-xe[0],ht=pt*pt,rt=t.touchData.startPosition[1]-xe[1],Et=rt*rt,vt=ht+Et,ot=vt*Oe*Oe;t.touchData.singleTouchMoved||(ne||X.$(":selected").unselect(["tapunselect"]),i(ne,["tap","vclick"],W,{x:xe[0],y:xe[1]}),oe=!1,W.timeStamp-fe<=X.multiClickDebounceTime()?(be&&clearTimeout(be),oe=!0,fe=null,i(ne,["dbltap","vdblclick"],W,{x:xe[0],y:xe[1]})):(be=setTimeout(function(){oe||i(ne,["onetap","voneclick"],W,{x:xe[0],y:xe[1]})},X.multiClickDebounceTime()),fe=W.timeStamp)),ne!=null&&!t.dragData.didDrag&&ne._private.selectable&&ot"u"){var Pe=[],ve=function(W){return{clientX:W.clientX,clientY:W.clientY,force:1,identifier:W.pointerId,pageX:W.pageX,pageY:W.pageY,radiusX:W.width/2,radiusY:W.height/2,screenX:W.screenX,screenY:W.screenY,target:W.target}},Ce=function(W){return{event:W,touch:ve(W)}},Ve=function(W){Pe.push(Ce(W))},se=function(W){for(var ne=0;ne0)return B[0]}return null},g=Object.keys(f),m=0;m0?p:pve(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?uf(i,a):l;var u=2*l;if(wh(e,r,this.points,s,o,i,a-u,[0,-1],n)||wh(e,r,this.points,s,o,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(fo(e,r,f)||Jp(e,r,u,u,s+i/2-l,o+a/2-l,n)||Jp(e,r,u,u,s-i/2+l,o+a/2-l,n))}}};Hh.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Rs(3,0)),this.generateRoundPolygon("round-triangle",Rs(3,0)),this.generatePolygon("rectangle",Rs(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Rs(5,0)),this.generateRoundPolygon("round-pentagon",Rs(5,0)),this.generatePolygon("hexagon",Rs(6,0)),this.generateRoundPolygon("round-hexagon",Rs(6,0)),this.generatePolygon("heptagon",Rs(7,0)),this.generateRoundPolygon("round-heptagon",Rs(7,0)),this.generatePolygon("octagon",Rs(8,0)),this.generateRoundPolygon("round-octagon",Rs(8,0));var n=new Array(20);{var i=tP(5,0),a=tP(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(u){if(T>=e.deqCost*p||T>=e.deqAvgCost*f)break}else if(b>=e.deqNoDrawCost*eN)break;var C=e.deq(n,y,m);if(C.length>0)for(var S=0;S0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,y,m)&&a())},o=e.priority||HG;i.beforeRender(s,o(n))}}}},E0t=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f_;_f(this,t),this.idsByKey=new th,this.keyForId=new th,this.cachesByLvl=new th,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Rf(t,[{key:"getIdsFor",value:function(r){r==null&&oi("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new Rx,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new th,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])})(),ote=25,n4=50,g3=-4,gP=3,b2e=7.99,A0t=8,_0t=1024,R0t=1024,L0t=1024,M0t=.2,I0t=.8,N0t=10,D0t=.15,O0t=.1,$0t=.9,P0t=.9,B0t=100,F0t=1,Km={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},z0t=ts({getKey:null,doesEleInvalidateKey:f_,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:ove,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),tw=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=z0t(r);dr(n,i),n.lookup=new E0t(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},ha=tw.prototype;ha.reasons=Km;ha.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};ha.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};ha.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new yS(function(r,n){return n.reqs-r.reqs});return e};ha.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};ha.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(UG(o*r))),n=b2e||n>gP)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=ote?g=ote:h<=n4?g=n4:g=Math.ceil(h/n4)*n4,h>L0t||d>R0t)return null;var m=a.getTextureQueue(g),y=m[m.length-2],v=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidthn;L--)_=a.getElement(t,e,r,L,Km.downscale);M()}else return a.queueElement(t,S.level-1),S;else{var P;if(!b&&!w&&!C)for(var D=n-1;D>=g3;D--){var R=l.get(t,D);if(R){P=R;break}}if(T(P))return a.queueElement(t,n),P;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,f,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return p={x:y.usedWidth,texture:y,level:n,scale:u,width:d,height:h,scaledLabelShown:f},y.usedWidth+=Math.ceil(d+A0t),y.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(y),p};ha.invalidateElements=function(t){for(var e=0;e=M0t*t.width&&this.retireTexture(t)};ha.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>I0t&&t.fullnessChecks>=N0t?cf(r,t):t.fullnessChecks++};ha.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;cf(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,qG(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),cf(i,s),n.push(s),s}};ha.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(o),i[a]=o}};ha.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=a.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,Km.dequeue)}return i};ha.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=WG,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))};ha.onDequeue=function(t){this.onDequeues.push(t)};ha.offDequeue=function(t){cf(this.onDequeues,t)};ha.setupDequeueing=v2e.setupDequeueing({deqRedrawThreshold:B0t,deqCost:D0t,deqAvgCost:O0t,deqNoDrawCost:$0t,deqFastCost:P0t,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=G0t||r>T_)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var M=function(I){if(n.validateLayersElesOrdering(I,t),n.levelIsComplete(I,t))return p=l[I],!0},L=function(I){if(!p)for(var $=r+I;Uw<=$&&$<=T_&&!M($);$+=I);};L(1),L(-1);for(var P=h.length-1;P>=0;P--){var D=h[P];D.invalid&&cf(h,D)}};if(!f)g();else return h;var m=function(){if(!d){d=Us();for(var M=0;Mcte||D>cte)return null;var R=P*D;if(R>K0t)return null;var I=n.makeLayer(d,r);if(L!=null){var $=h.indexOf(L)+1;h.splice($,0,I)}else(M.insert===void 0||M.insert)&&h.unshift(I);return I};if(n.skipping&&!o)return null;for(var v=null,T=t.length/V0t,b=!o,w=0;w=T||!fve(v.bb,C.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||b?n.queueLayer(v,C):n.drawEleInLayer(v,C,r,e),v.eles.push(C),k[r]=v}return p||(b?null:h)};rs.getEleLevelForLayerLevel=function(t,e){return t};rs.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,Z0t),a.setImgSmoothing(s,!0))};rs.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a0||s.invalid)return!1;i+=s.eles.length}return i===e.length};rs.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e};rs.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Th(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))};rs.invalidateLayer=function(t){if(this.lastInvalidationTime=Th(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];cf(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,v=u*h,T=u*h,b=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;d==="straight-triangle"?(s.eleStrokeStyle(t,e,I),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,I),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},w=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,y[0],y[1],y[2],I);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},C=function(){i&&s.drawEdgeOverlay(t,e)},S=function(){i&&s.drawEdgeUnderlay(t,e)},k=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T;s.drawArrowheads(t,e,I)},E=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var _=e.pstyle("ghost").value==="yes";if(_){var M=e.pstyle("ghost-offset-x").pfValue,L=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,D=v*P;t.translate(M,L),b(D),k(D),t.translate(-M,-L)}else w();S(),b(),k(),C(),E(),r&&t.translate(l.x1,l.y1)}};var w2e=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,o.allpts,"solid")}}}};qh.drawEdgeOverlay=w2e("overlay");qh.drawEdgeUnderlay=w2e("underlay");qh.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var h=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(h||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var g=!r,m;r&&(m=r,t.translate(-m.x1,-m.y1)),i==null?(s.drawText(t,e,null,g,a),e.isEdge()&&(s.drawText(t,e,"source",g,a),s.drawText(t,e,"target",g,a))):s.drawText(t,e,i,g,a),r&&t.translate(m.x1,m.y1)};gg.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function lgt(t,e,r,n,i){var a=Math.min(n,i),s=a/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function fte(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,n/2,i/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.quadraticCurveTo(e+n,r,e+n,r+s),t.lineTo(e+n,r+i-s),t.quadraticCurveTo(e+n,r+i,e+n-s,r+i),t.lineTo(e+s,r+i),t.quadraticCurveTo(e,r+i,e,r+i-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}gg.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=Ms(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r};gg.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Ms(s,"labelX",r),u=Ms(s,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=Ms(s,"labelWidth",r),m=Ms(s,"labelHeight",r),y=Ms(s,"labelActualDescent",r),v=e.pstyle(p+"text-margin-x").pfValue,T=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;b&&(w="center",C="center"),l+=v,u+=T;var S;n?S=this.getTextAngle(e,r):S=0,S!==0&&(h=l,d=u,t.translate(h,d),t.rotate(S),l=0,u=0);var k=Ub(w),E=Yb(C);switch(E){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var _=e.pstyle("text-background-opacity").value,M=e.pstyle("text-border-opacity").value,L=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,D=e.pstyle("text-background-shape").strValue,R=D==="round-rectangle"||D==="roundrectangle",I=D==="circle",$=2;if(_>0||L>0&&M>0){var O=t.fillStyle,N=t.strokeStyle,F=t.lineWidth,z=e.pstyle("text-background-color").value,V=e.pstyle("text-border-color").value,B=e.pstyle("text-border-style").value,G=_>0,H=L>0&&M>0,q=l-P;switch(k){case"left":q-=g;break;case"center":q-=g/2;break}var Z=u-m-P,Y=g+2*P,ie=m+2*P;if(G&&(t.fillStyle="rgba(".concat(z[0],",").concat(z[1],",").concat(z[2],",").concat(_*o,")")),H&&(t.strokeStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(M*o,")"),t.lineWidth=L,t.setLineDash))switch(B){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=L/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(R?(t.beginPath(),fte(t,q,Z,Y,ie,$)):I?(t.beginPath(),lgt(t,q,Z,Y,ie)):(t.beginPath(),t.rect(q,Z,Y,ie)),G&&t.fill(),H&&t.stroke(),H&&B==="double"){var K=L/2;t.beginPath(),R?fte(t,q+K,Z+K,Y-2*K,ie-2*K,$):t.rect(q+K,Z+K,Y-2*K,ie-2*K),t.stroke()}t.fillStyle=O,t.strokeStyle=N,t.lineWidth=F,t.setLineDash&&t.setLineDash([])}var Q=2*e.pstyle("text-outline-width").pfValue;if(Q>0&&(t.lineWidth=Q),u-=y,e.pstyle("text-wrap").value==="wrap"){var te=Ms(s,"labelWrapCachedLines",r),J=Ms(s,"labelLineHeight",r),ge=g/2,ee=this.getLabelJustification(e);switch(ee==="auto"||(k==="left"?ee==="left"?l+=-g:ee==="center"&&(l+=-ge):k==="center"?ee==="left"?l+=-ge:ee==="right"&&(l+=ge):k==="right"&&(ee==="center"?l+=ge:ee==="right"&&(l+=g))),E){case"top":u-=(te.length-1)*J;break;case"center":case"bottom":u-=(te.length-1)*J;break}for(var Re=0;Re0&&t.strokeText(te[Re],l,u),t.fillText(te[Re],l,u),u+=J}else Q>0&&t.strokeText(f,l,u),t.fillText(f,l,u);S!==0&&(t.rotate(-S),t.translate(-h,-d))}}};var Mf={};Mf.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!Dt(d.x)||!Dt(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var v;r&&(v=r,t.translate(-v.x1,-v.y1));for(var T=e.pstyle("background-image"),b=T.value,w=new Array(b.length),C=new Array(b.length),S=0,k=0;k0&&arguments[0]!==void 0?arguments[0]:D;s.eleFillStyle(t,e,W)},K=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;s.colorStrokeStyle(t,R[0],R[1],R[2],W)},Q=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q;s.colorStrokeStyle(t,G[0],G[1],G[2],W)},te=function(W,ne,j,ue){var X=s.nodePathCache=s.nodePathCache||[],Oe=sve(j==="polygon"?j+","+ue.join(","):j,""+ne,""+W,""+Y),xe=X[Oe],Ge,_e=!1;return xe!=null?(Ge=xe,_e=!0,h.pathCache=Ge):(Ge=new Path2D,X[Oe]=h.pathCache=Ge),{path:Ge,cacheHit:_e}},J=e.pstyle("shape").strValue,ge=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var ee=te(o,l,J,ge);g=ee.path,m=ee.cacheHit}var Re=function(){if(!m){var W=d;p&&(W={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,W.x,W.y,o,l,Y,h)}p?t.fill(g):t.fill()},Ie=function(){for(var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,j=u.backgrounding,ue=0,X=0;X0&&arguments[0]!==void 0?arguments[0]:!1,ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,ne),W&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h)))},ce=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h),t.clip()),s.drawStripe(t,e,ne),t.restore(),W&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h)))},oe=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ne=(L>0?L:-L)*W,j=L>0?0:255;L!==0&&(s.colorFillStyle(t,j,j,j,ne),p?t.fill(g):t.fill())},be=function(){if(P>0){if(t.lineWidth=P,t.lineCap=O,t.lineJoin=$,t.setLineDash)switch(I){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(F),t.lineDashOffset=z;break;case"solid":case"double":t.setLineDash([]);break}if(N!=="center"){if(t.save(),t.lineWidth*=2,N==="inside")p?t.clip(g):t.clip();else{var W=new Path2D;W.rect(-o/2-P,-l/2-P,o+2*P,l+2*P),W.addPath(g),t.clip(W,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(I==="double"){t.lineWidth=P/3;var ne=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=ne}t.setLineDash&&t.setLineDash([])}},fe=function(){if(B>0){if(t.lineWidth=B,t.lineCap="butt",t.setLineDash)switch(H){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var W=d;p&&(W={x:0,y:0});var ne=s.getNodeShape(e),j=P;N==="inside"&&(j=0),N==="outside"&&(j*=2);var ue=(o+j+(B+Z))/o,X=(l+j+(B+Z))/l,Oe=o*ue,xe=l*X,Ge=s.nodeShapes[ne].points,_e;if(p){var $e=te(Oe,xe,ne,Ge);_e=$e.path}if(ne==="ellipse")s.drawEllipsePath(_e||t,W.x,W.y,Oe,xe);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ne)){var Me=0,He=0,De=0;ne==="round-diamond"?Me=(j+Z+B)*1.4:ne==="round-heptagon"?(Me=(j+Z+B)*1.075,De=-(j/2+Z+B)/35):ne==="round-hexagon"?Me=(j+Z+B)*1.12:ne==="round-pentagon"?(Me=(j+Z+B)*1.13,De=-(j/2+Z+B)/15):ne==="round-tag"?(Me=(j+Z+B)*1.12,He=(j/2+B+Z)*.07):ne==="round-triangle"&&(Me=(j+Z+B)*(Math.PI/2),De=-(j+Z/2+B)/Math.PI),Me!==0&&(ue=(o+Me)/o,Oe=o*ue,["round-hexagon","round-tag"].includes(ne)||(X=(l+Me)/l,xe=l*X)),Y=Y==="auto"?mve(Oe,xe):Y;for(var Ke=Oe/2,Ae=xe/2,at=Y+(j+B+Z)/2,Ee=new Array(Ge.length/2),pt=new Array(Ge.length/2),ht=0;ht0){if(i=i||n.position(),a==null||s==null){var p=n.padding();a=n.width()+2*p,s=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,a+l*2,s+l*2,f),r.fill()}}}};Mf.drawNodeOverlay=C2e("overlay");Mf.drawNodeUnderlay=C2e("underlay");Mf.hasPie=function(t){return t=t[0],t._private.hasPie};Mf.hasStripe=function(t){return t=t[0],t._private.hasStripe};Mf.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),s.units==="%"?p=f*s.pfValue:s.pfValue!==void 0&&(p=s.pfValue/2),!(p>=f))for(var y=1;y<=i.pieBackgroundN;y++){var v=e.pstyle("pie-"+y+"-background-size").value,T=e.pstyle("pie-"+y+"-background-color").value,b=e.pstyle("pie-"+y+"-background-opacity").value*r,w=v/100;w+g>1&&(w=1-g);var C=1.5*Math.PI+2*Math.PI*g;C+=o;var S=2*Math.PI*w,k=C+S;v===0||g>=1||g+w>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,C,k),t.closePath()):(t.beginPath(),t.arc(l,u,f,C,k),t.arc(l,u,p,k,C,!0),t.closePath()),this.colorFillStyle(t,T[0],T[1],T[2],b),t.fill(),g+=w)}};Mf.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(a=0,s=0),s-=p/2,a-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var y=e.pstyle("stripe-"+m+"-background-size").value,v=e.pstyle("stripe-"+m+"-background-color").value,T=e.pstyle("stripe-"+m+"-background-opacity").value*r,b=y/100;b+u>1&&(b=1-u),!(y===0||u>=1||u+b>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*b),t.closePath(),this.colorFillStyle(t,v[0],v[1],v[2],T),t.fill(),u+=b)}t.restore()};var Js={},cgt=100;Js.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};Js.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;ie.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var T=r.style(),b=r.zoom(),w=s!==void 0?s:b,C=r.pan(),S={x:C.x,y:C.y},k={zoom:b,pan:{x:C.x,y:C.y}},E=e.prevViewport,_=E===void 0||k.zoom!==E.zoom||k.pan.x!==E.pan.x||k.pan.y!==E.pan.y;!_&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(S=o),w*=l,S.x*=l,S.y*=l;var M=e.getCachedZSortedEles();function L(K,Q,te,J,ge){var ee=K.globalCompositeOperation;K.globalCompositeOperation="destination-out",e.colorFillStyle(K,255,255,255,e.motionBlurTransparency),K.fillRect(Q,te,J,ge),K.globalCompositeOperation=ee}function P(K,Q){var te,J,ge,ee;!e.clearingMotionBlur&&(K===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||K===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(te={x:C.x*p,y:C.y*p},J=b*p,ge=e.canvasWidth*p,ee=e.canvasHeight*p):(te=S,J=w,ge=e.canvasWidth,ee=e.canvasHeight),K.setTransform(1,0,0,1,0,0),Q==="motionBlur"?L(K,0,0,ge,ee):!n&&(Q===void 0||Q)&&K.clearRect(0,0,ge,ee),i||(K.translate(te.x,te.y),K.scale(J,J)),o&&K.translate(o.x,o.y),s&&K.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var D=e.data.bufferContexts[e.TEXTURE_BUFFER];D.setTransform(1,0,0,1,0,0),D.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:D,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var k=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};k.mpan={x:(0-k.pan.x)/k.zoom,y:(0-k.pan.y)/k.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var R=u.contexts[e.NODE],I=e.textureCache.texture,k=e.textureCache.viewport;R.setTransform(1,0,0,1,0,0),f?L(R,0,0,k.width,k.height):R.clearRect(0,0,k.width,k.height);var $=T.core("outside-texture-bg-color").value,O=T.core("outside-texture-bg-opacity").value;e.colorFillStyle(R,$[0],$[1],$[2],O),R.fillRect(0,0,k.width,k.height);var b=r.zoom();P(R,!1),R.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l),R.drawImage(I,k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var N=r.extent(),F=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),z=e.hideEdgesOnViewport&&F,V=[];if(V[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,V[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),V[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,V[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||V[e.NODE]){var B=f&&!V[e.NODE]&&p!==1,R=n||(B?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),G=f&&!B?"motionBlur":void 0;P(R,G),z?e.drawCachedNodes(R,M.nondrag,l,N):e.drawLayeredElements(R,M.nondrag,l,N),e.debug&&e.drawDebugPoints(R,M.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||V[e.DRAG])){var B=f&&!V[e.DRAG]&&p!==1,R=n||(B?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);P(R,f&&!B?"motionBlur":void 0),z?e.drawCachedNodes(R,M.drag,l,N):e.drawCachedElements(R,M.drag,l,N),e.debug&&e.drawDebugPoints(R,M.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,P),f&&p!==1){var H=u.contexts[e.NODE],q=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],Z=u.contexts[e.DRAG],Y=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ie=function(Q,te,J){Q.setTransform(1,0,0,1,0,0),J||!v?Q.clearRect(0,0,e.canvasWidth,e.canvasHeight):L(Q,0,0,e.canvasWidth,e.canvasHeight);var ge=p;Q.drawImage(te,0,0,e.canvasWidth*ge,e.canvasHeight*ge,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||V[e.NODE])&&(ie(H,q,V[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||V[e.DRAG])&&(ie(Z,Y,V[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=k,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},cgt)),n||r.emit("render")};var mT;Js.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=a.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),y="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!mT){var v=h.measureText(y);mT=v.actualBoundingBoxAscent}h.fillText(y,0,mT);var T=60;h.strokeRect(0,mT+10,250,20),h.fillRect(0,mT+10,250*Math.min(m/T,1),20)}o||(l[r.SELECT_BOX]=!1)}};function pte(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 ugt(t,e,r){var n=pte(t,t.VERTEX_SHADER,e),i=pte(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 hgt(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 cW(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 dgt(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function fgt(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 pgt(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function ggt(t,e){if(t.length!==e.length)return!1;for(var r=0;r>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function mgt(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function ygt(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 k2e(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 S2e(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function vgt(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 bgt(t,e,r,n){var i=k2e(t,e),a=zi(i,2),s=a[0],o=a[1],l=S2e(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function vc(t,e,r,n){var i=k2e(t,r),a=zi(i,3),s=a[0],o=a[1],l=a[2],u=S2e(t,o,e*s),h=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;ps&&(o=s/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(b,w){if(i&&w){var C=w.context,S=b.x,k=b.row,E=S,_=l*k;C.save(),C.translate(E,_),C.scale(h,h),i(C,n),C.restore()}},g=[null,null],m=function(){p(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:f},g[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},y=function(){var b=a.scratch,w=a.canvas;b.clear(),p({x:0,row:0},b);var C=s-a.freePointer.x,S=d-C,k=l;{var E=a.freePointer.x,_=a.freePointer.row*l,M=C;w.context.drawImage(b,0,0,M,k,E,_,M,k),g[0]={x:E,y:_,w:M,h:f}}{var L=C,P=(a.freePointer.row+1)*l,D=S;w&&w.context.drawImage(b,L,0,D,k,0,P,D,k),g[1]={x:0,y:P,w:D,h:f}}a.freePointer.x=S,a.freePointer.row++},v=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(v(),m()):this.enableWrapping?y():(v(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=yo(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=yo(this.renderTypes.values()),v;try{var T=function(){var w=v.value,C=w.type;if(h(C)){var S=n.collections.get(w.collection),k=w.getKey(m),E=Array.isArray(k)?k:[k];if(s)E.forEach(function(P){return S.markKeyForGC(P)}),f=!0;else{var _=w.getID?w.getID(m):m.id(),M=n._key(C,_),L=n.typeAndIdToKey.get(M);L!==void 0&&!ggt(E,L)&&(d=!0,n.typeAndIdToKey.delete(M),L.forEach(function(P){return S.markKeyForGC(P)}))}}};for(y.s();!(v=y.n()).done;)T()}catch(b){y.e(b)}finally{y.f()}}}}catch(b){p.e(b)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=yo(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(a,i,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),s.drawElement(f,r,i,!0,!0),f.restore()):s.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=zi(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=yo(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=zi(i.value,2),s=a[0],o=a[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])})(),_gt=(function(){function t(e){_f(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Rf(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])})(),Rgt=` +`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var $=t.pstyle("text-max-width").pfValue,O="",N="…",F=!1;if(this.calculateLabelDimensions(t,i).width<$)return i;for(var z=0;z$)break;O+=i[z],z===i.length-1&&(F=!0)}return F||(O+=N),O}return i};du.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?dpt(r):"center":e};du.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,h=t.pstyle("text-metrics").strValue||"font",d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=i.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}f.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var g=0,m=0,y=e.split(` +`),v=y.length,T=0,b=0,w=0;w1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var vt=a(W);at&&(t.hoverData.tapholdCancelled=!0);var ot=function(){var Nt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Nt.length===0?(Nt.push(Ke[0]),Nt.push(Ke[1])):(Nt[0]+=Ke[0],Nt[1]+=Ke[1])};j=!0,i(Me,["mousemove","vmousemove","tapdrag"],W,{x:xe[0],y:xe[1]});var pe=function(Nt){return{originalEvent:W,type:Nt,position:{x:xe[0],y:xe[1]}}},Ct=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||ue.emit(pe("boxstart")),$e[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(at){var lt=pe("cxtdrag");De?De.emit(lt):ue.emit(lt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Me!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(pe("cxtdragout")),t.hoverData.cxtOver=Me,Me&&Me.emit(pe("cxtdragover")))}}else if(t.hoverData.dragging){if(j=!0,ue.panningEnabled()&&ue.userPanningEnabled()){var st;if(t.hoverData.justStartedPan){var mt=t.hoverData.mdownPos;st={x:(xe[0]-mt[0])*X,y:(xe[1]-mt[1])*X},t.hoverData.justStartedPan=!1}else st={x:Ke[0]*X,y:Ke[1]*X};ue.panBy(st),ue.emit(pe("dragpan")),t.hoverData.dragged=!0}xe=t.projectIntoViewport(W.clientX,W.clientY)}else if($e[4]==1&&(De==null||De.pannable())){if(at){if(!t.hoverData.dragging&&ue.boxSelectionEnabled()&&(vt||!ue.panningEnabled()||!ue.userPanningEnabled()))Ct();else if(!t.hoverData.selecting&&ue.panningEnabled()&&ue.userPanningEnabled()){var _r=s(De,t.hoverData.downs);_r&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,$e[4]=0,t.data.bgActivePosistion=Xm(Ge),t.redrawHint("select",!0),t.redraw())}De&&De.pannable()&&De.active()&&De.unactivate()}}else{if(De&&De.pannable()&&De.active()&&De.unactivate(),(!De||!De.grabbed())&&Me!=He&&(He&&i(He,["mouseout","tapdragout"],W,{x:xe[0],y:xe[1]}),Me&&i(Me,["mouseover","tapdragover"],W,{x:xe[0],y:xe[1]}),t.hoverData.last=Me),De)if(at){if(ue.boxSelectionEnabled()&&vt)De&&De.grabbed()&&(m(Ae),De.emit(pe("freeon")),Ae.emit(pe("free")),t.dragData.didDrag&&(De.emit(pe("dragfreeon")),Ae.emit(pe("dragfree")))),Ct();else if(De&&De.grabbed()&&t.nodeIsDraggable(De)){var Se=!t.dragData.didDrag;Se&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(Ae,{inDragLayer:!0});var Ue={x:0,y:0};if(Dt(Ke[0])&&Dt(Ke[1])&&(Ue.x+=Ke[0],Ue.y+=Ke[1],Se)){var tt=t.hoverData.dragDelta;tt&&Dt(tt[0])&&Dt(tt[1])&&(Ue.x+=tt[0],Ue.y+=tt[1])}t.hoverData.draggingEles=!0,Ae.silentShift(Ue).emit(pe("position")).emit(pe("drag")),t.redrawHint("drag",!0),t.redraw()}}else ot();j=!0}if($e[2]=xe[0],$e[3]=xe[1],j)return W.stopPropagation&&W.stopPropagation(),W.preventDefault&&W.preventDefault(),!1}},!1);var M,L,P;t.registerBinding(e,"mouseup",function(W){if(!(t.hoverData.which===1&&W.which!==1&&t.hoverData.capture)){var ne=t.hoverData.capture;if(ne){t.hoverData.capture=!1;var j=t.cy,ue=t.projectIntoViewport(W.clientX,W.clientY),X=t.selection,Oe=t.findNearestElement(ue[0],ue[1],!0,!1),xe=t.dragData.possibleDragElements,Ge=t.hoverData.down,_e=a(W);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Ge&&Ge.unactivate();var $e=function(Ee){return{originalEvent:W,type:Ee,position:{x:ue[0],y:ue[1]}}};if(t.hoverData.which===3){var Me=$e("cxttapend");if(Ge?Ge.emit(Me):j.emit(Me),!t.hoverData.cxtDragged){var He=$e("cxttap");Ge?Ge.emit(He):j.emit(He)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Oe,["mouseup","tapend","vmouseup"],W,{x:ue[0],y:ue[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Ge,["click","tap","vclick"],W,{x:ue[0],y:ue[1]}),L=!1,W.timeStamp-P<=j.multiClickDebounceTime()?(M&&clearTimeout(M),L=!0,P=null,i(Ge,["dblclick","dbltap","vdblclick"],W,{x:ue[0],y:ue[1]})):(M=setTimeout(function(){L||i(Ge,["oneclick","onetap","voneclick"],W,{x:ue[0],y:ue[1]})},j.multiClickDebounceTime()),P=W.timeStamp)),Ge==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(W)&&(j.$(r).unselect(["tapunselect"]),xe.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=xe=j.collection()),Oe==Ge&&!t.dragData.didDrag&&!t.hoverData.selecting&&Oe!=null&&Oe._private.selectable&&(t.hoverData.dragging||(j.selectionType()==="additive"||_e?Oe.selected()?Oe.unselect(["tapunselect"]):Oe.select(["tapselect"]):_e||(j.$(r).unmerge(Oe).unselect(["tapunselect"]),Oe.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var De=j.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));t.redrawHint("select",!0),De.length>0&&t.redrawHint("eles",!0),j.emit($e("boxend"));var Ke=function(Ee){return Ee.selectable()&&!Ee.selected()};j.selectionType()==="additive"||_e||j.$(r).unmerge(De).unselect(),De.emit($e("box")).stdFilter(Ke).select().emit($e("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!X[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Ae=Ge&&Ge.grabbed();m(xe),Ae&&(Ge.emit($e("freeon")),xe.emit($e("free")),t.dragData.didDrag&&(Ge.emit($e("dragfreeon")),xe.emit($e("dragfree"))))}}X[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var D=[],R=4,I,$=1e5,O=function(W,ne){for(var j=0;j=R){var ue=D;if(I=O(ue,5),!I){var X=Math.abs(ue[0]);I=N(ue)&&X>5}if(I)for(var Oe=0;Oe5&&(j=YG(j)*5),He=j/-250,I&&(He/=$,He*=3),He=He*t.wheelSensitivity;var De=W.deltaMode===1;De&&(He*=33);var Ke=xe.zoom()*Math.pow(10,He);W.type==="gesturechange"&&(Ke=t.gestureStartZoom*W.scale),xe.zoom({level:Ke,renderedPosition:{x:Me[0],y:Me[1]}}),xe.emit({type:W.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:W,position:{x:$e[0],y:$e[1]}})}}}};t.registerBinding(t.container,"wheel",F,!0),t.registerBinding(e,"scroll",function(W){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(W){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||W.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(he){t.hasTouchStarted||F(he)},!0),t.registerBinding(t.container,"mouseout",function(W){var ne=t.projectIntoViewport(W.clientX,W.clientY);t.cy.emit({originalEvent:W,type:"mouseout",position:{x:ne[0],y:ne[1]}})},!1),t.registerBinding(t.container,"mouseover",function(W){var ne=t.projectIntoViewport(W.clientX,W.clientY);t.cy.emit({originalEvent:W,type:"mouseover",position:{x:ne[0],y:ne[1]}})},!1);var z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge=function(W,ne,j,ue){return Math.sqrt((j-W)*(j-W)+(ue-ne)*(ue-ne))},ee=function(W,ne,j,ue){return(j-W)*(j-W)+(ue-ne)*(ue-ne)},Re;t.registerBinding(t.container,"touchstart",Re=function(W){if(t.hasTouchStarted=!0,!!E(W)){v(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var ne=t.cy,j=t.touchData.now,ue=t.touchData.earlier;if(W.touches[0]){var X=t.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);j[0]=X[0],j[1]=X[1]}if(W.touches[1]){var X=t.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);j[2]=X[0],j[3]=X[1]}if(W.touches[2]){var X=t.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);j[4]=X[0],j[5]=X[1]}var Oe=function(vt){return{originalEvent:W,type:vt,position:{x:j[0],y:j[1]}}};if(W.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var xe=t.findContainerClientCoords();ie=xe[0],K=xe[1],Q=xe[2],te=xe[3],z=W.touches[0].clientX-ie,V=W.touches[0].clientY-K,B=W.touches[1].clientX-ie,G=W.touches[1].clientY-K,J=0<=z&&z<=Q&&0<=B&&B<=Q&&0<=V&&V<=te&&0<=G&&G<=te;var Ge=ne.pan(),_e=ne.zoom();H=ge(z,V,B,G),q=ee(z,V,B,G),Z=[(z+B)/2,(V+G)/2],Y=[(Z[0]-Ge.x)/_e,(Z[1]-Ge.y)/_e];var $e=200,Me=$e*$e;if(q=1){for(var pt=t.touchData.startPosition=[null,null,null,null,null,null],ht=0;ht=t.touchTapThreshold2}if(ne&&t.touchData.cxt){W.preventDefault();var ht=W.touches[0].clientX-ie,rt=W.touches[0].clientY-K,Et=W.touches[1].clientX-ie,vt=W.touches[1].clientY-K,ot=ee(ht,rt,Et,vt),pe=ot/q,Ct=150,lt=Ct*Ct,st=1.5,mt=st*st;if(pe>=mt||ot>=lt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var _r=_e("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(_r),t.touchData.start=null):ue.emit(_r)}}if(ne&&t.touchData.cxt){var _r=_e("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(_r):ue.emit(_r),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Se=t.findNearestElement(X[0],X[1],!0,!0);(!t.touchData.cxtOver||Se!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(_e("cxtdragout")),t.touchData.cxtOver=Se,Se&&Se.emit(_e("cxtdragover")))}else if(ne&&W.touches[2]&&ue.boxSelectionEnabled())W.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||ue.emit(_e("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,j[4]=1,!j||j.length===0||j[0]===void 0?(j[0]=(X[0]+X[2]+X[4])/3,j[1]=(X[1]+X[3]+X[5])/3,j[2]=(X[0]+X[2]+X[4])/3+1,j[3]=(X[1]+X[3]+X[5])/3+1):(j[2]=(X[0]+X[2]+X[4])/3,j[3]=(X[1]+X[3]+X[5])/3),t.redrawHint("select",!0),t.redraw();else if(ne&&W.touches[1]&&!t.touchData.didSelect&&ue.zoomingEnabled()&&ue.panningEnabled()&&ue.userZoomingEnabled()&&ue.userPanningEnabled()){W.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ue=t.dragData.touchDragEles;if(Ue){t.redrawHint("drag",!0);for(var tt=0;tt0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Be;t.registerBinding(e,"touchcancel",Be=function(W){var ne=t.touchData.start;t.touchData.capture=!1,ne&&ne.unactivate()});var ce,oe,be,fe;if(t.registerBinding(e,"touchend",ce=function(W){var ne=t.touchData.start,j=t.touchData.capture;if(j)W.touches.length===0&&(t.touchData.capture=!1),W.preventDefault();else return;var ue=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var X=t.cy,Oe=X.zoom(),xe=t.touchData.now,Ge=t.touchData.earlier;if(W.touches[0]){var _e=t.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);xe[0]=_e[0],xe[1]=_e[1]}if(W.touches[1]){var _e=t.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);xe[2]=_e[0],xe[3]=_e[1]}if(W.touches[2]){var _e=t.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);xe[4]=_e[0],xe[5]=_e[1]}var $e=function(lt){return{originalEvent:W,type:lt,position:{x:xe[0],y:xe[1]}}};ne&&ne.unactivate();var Me;if(t.touchData.cxt){if(Me=$e("cxttapend"),ne?ne.emit(Me):X.emit(Me),!t.touchData.cxtDragged){var He=$e("cxttap");ne?ne.emit(He):X.emit(He)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!W.touches[2]&&X.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var De=X.collection(t.getAllInBox(ue[0],ue[1],ue[2],ue[3]));ue[0]=void 0,ue[1]=void 0,ue[2]=void 0,ue[3]=void 0,ue[4]=0,t.redrawHint("select",!0),X.emit($e("boxend"));var Ke=function(lt){return lt.selectable()&&!lt.selected()};De.emit($e("box")).stdFilter(Ke).select().emit($e("boxselect")),De.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(ne!=null&&ne.unactivate(),W.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!W.touches[1]){if(!W.touches[0]){if(!W.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ae=t.dragData.touchDragEles;if(ne!=null){var at=ne._private.grabbed;m(Ae),t.redrawHint("drag",!0),t.redrawHint("eles",!0),at&&(ne.emit($e("freeon")),Ae.emit($e("free")),t.dragData.didDrag&&(ne.emit($e("dragfreeon")),Ae.emit($e("dragfree")))),i(ne,["touchend","tapend","vmouseup","tapdragout"],W,{x:xe[0],y:xe[1]}),ne.unactivate(),t.touchData.start=null}else{var Ee=t.findNearestElement(xe[0],xe[1],!0,!0);i(Ee,["touchend","tapend","vmouseup","tapdragout"],W,{x:xe[0],y:xe[1]})}var pt=t.touchData.startPosition[0]-xe[0],ht=pt*pt,rt=t.touchData.startPosition[1]-xe[1],Et=rt*rt,vt=ht+Et,ot=vt*Oe*Oe;t.touchData.singleTouchMoved||(ne||X.$(":selected").unselect(["tapunselect"]),i(ne,["tap","vclick"],W,{x:xe[0],y:xe[1]}),oe=!1,W.timeStamp-fe<=X.multiClickDebounceTime()?(be&&clearTimeout(be),oe=!0,fe=null,i(ne,["dbltap","vdblclick"],W,{x:xe[0],y:xe[1]})):(be=setTimeout(function(){oe||i(ne,["onetap","voneclick"],W,{x:xe[0],y:xe[1]})},X.multiClickDebounceTime()),fe=W.timeStamp)),ne!=null&&!t.dragData.didDrag&&ne._private.selectable&&ot"u"){var Pe=[],ve=function(W){return{clientX:W.clientX,clientY:W.clientY,force:1,identifier:W.pointerId,pageX:W.pageX,pageY:W.pageY,radiusX:W.width/2,radiusY:W.height/2,screenX:W.screenX,screenY:W.screenY,target:W.target}},Ce=function(W){return{event:W,touch:ve(W)}},Ve=function(W){Pe.push(Ce(W))},se=function(W){for(var ne=0;ne0)return B[0]}return null},g=Object.keys(f),m=0;m0?p:gve(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?uf(i,a):l;var u=2*l;if(wh(e,r,this.points,s,o,i,a-u,[0,-1],n)||wh(e,r,this.points,s,o,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(fo(e,r,f)||Jp(e,r,u,u,s+i/2-l,o+a/2-l,n)||Jp(e,r,u,u,s-i/2+l,o+a/2-l,n))}}};Hh.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Rs(3,0)),this.generateRoundPolygon("round-triangle",Rs(3,0)),this.generatePolygon("rectangle",Rs(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Rs(5,0)),this.generateRoundPolygon("round-pentagon",Rs(5,0)),this.generatePolygon("hexagon",Rs(6,0)),this.generateRoundPolygon("round-hexagon",Rs(6,0)),this.generatePolygon("heptagon",Rs(7,0)),this.generateRoundPolygon("round-heptagon",Rs(7,0)),this.generatePolygon("octagon",Rs(8,0)),this.generateRoundPolygon("round-octagon",Rs(8,0));var n=new Array(20);{var i=tP(5,0),a=tP(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(u){if(T>=e.deqCost*p||T>=e.deqAvgCost*f)break}else if(b>=e.deqNoDrawCost*eN)break;var C=e.deq(n,y,m);if(C.length>0)for(var S=0;S0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,y,m)&&a())},o=e.priority||HG;i.beforeRender(s,o(n))}}}},R0t=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f_;_f(this,t),this.idsByKey=new th,this.keyForId=new th,this.cachesByLvl=new th,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Rf(t,[{key:"getIdsFor",value:function(r){r==null&&oi("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new Rx,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new th,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])})(),lte=25,n4=50,g3=-4,gP=3,x2e=7.99,L0t=8,M0t=1024,I0t=1024,N0t=1024,D0t=.2,O0t=.8,$0t=10,P0t=.15,B0t=.1,F0t=.9,z0t=.9,V0t=100,G0t=1,Km={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},W0t=ts({getKey:null,doesEleInvalidateKey:f_,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:lve,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),tw=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=W0t(r);dr(n,i),n.lookup=new R0t(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},da=tw.prototype;da.reasons=Km;da.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};da.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};da.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new yS(function(r,n){return n.reqs-r.reqs});return e};da.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};da.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(UG(o*r))),n=x2e||n>gP)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=lte?g=lte:h<=n4?g=n4:g=Math.ceil(h/n4)*n4,h>N0t||d>I0t)return null;var m=a.getTextureQueue(g),y=m[m.length-2],v=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidthn;L--)_=a.getElement(t,e,r,L,Km.downscale);M()}else return a.queueElement(t,S.level-1),S;else{var P;if(!b&&!w&&!C)for(var D=n-1;D>=g3;D--){var R=l.get(t,D);if(R){P=R;break}}if(T(P))return a.queueElement(t,n),P;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,f,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return p={x:y.usedWidth,texture:y,level:n,scale:u,width:d,height:h,scaledLabelShown:f},y.usedWidth+=Math.ceil(d+L0t),y.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(y),p};da.invalidateElements=function(t){for(var e=0;e=D0t*t.width&&this.retireTexture(t)};da.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>O0t&&t.fullnessChecks>=$0t?cf(r,t):t.fullnessChecks++};da.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;cf(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,qG(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),cf(i,s),n.push(s),s}};da.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(o),i[a]=o}};da.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=a.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,Km.dequeue)}return i};da.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=WG,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))};da.onDequeue=function(t){this.onDequeues.push(t)};da.offDequeue=function(t){cf(this.onDequeues,t)};da.setupDequeueing=b2e.setupDequeueing({deqRedrawThreshold:V0t,deqCost:P0t,deqAvgCost:B0t,deqNoDrawCost:F0t,deqFastCost:z0t,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=q0t||r>T_)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var M=function(I){if(n.validateLayersElesOrdering(I,t),n.levelIsComplete(I,t))return p=l[I],!0},L=function(I){if(!p)for(var $=r+I;Uw<=$&&$<=T_&&!M($);$+=I);};L(1),L(-1);for(var P=h.length-1;P>=0;P--){var D=h[P];D.invalid&&cf(h,D)}};if(!f)g();else return h;var m=function(){if(!d){d=Us();for(var M=0;Mute||D>ute)return null;var R=P*D;if(R>J0t)return null;var I=n.makeLayer(d,r);if(L!=null){var $=h.indexOf(L)+1;h.splice($,0,I)}else(M.insert===void 0||M.insert)&&h.unshift(I);return I};if(n.skipping&&!o)return null;for(var v=null,T=t.length/H0t,b=!o,w=0;w=T||!pve(v.bb,C.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||b?n.queueLayer(v,C):n.drawEleInLayer(v,C,r,e),v.eles.push(C),k[r]=v}return p||(b?null:h)};rs.getEleLevelForLayerLevel=function(t,e){return t};rs.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,egt),a.setImgSmoothing(s,!0))};rs.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a0||s.invalid)return!1;i+=s.eles.length}return i===e.length};rs.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e};rs.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Th(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))};rs.invalidateLayer=function(t){if(this.lastInvalidationTime=Th(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];cf(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,v=u*h,T=u*h,b=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;d==="straight-triangle"?(s.eleStrokeStyle(t,e,I),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,I),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},w=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,y[0],y[1],y[2],I);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},C=function(){i&&s.drawEdgeOverlay(t,e)},S=function(){i&&s.drawEdgeUnderlay(t,e)},k=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T;s.drawArrowheads(t,e,I)},E=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var _=e.pstyle("ghost").value==="yes";if(_){var M=e.pstyle("ghost-offset-x").pfValue,L=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,D=v*P;t.translate(M,L),b(D),k(D),t.translate(-M,-L)}else w();S(),b(),k(),C(),E(),r&&t.translate(l.x1,l.y1)}};var C2e=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,o.allpts,"solid")}}}};qh.drawEdgeOverlay=C2e("overlay");qh.drawEdgeUnderlay=C2e("underlay");qh.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var h=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(h||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var g=!r,m;r&&(m=r,t.translate(-m.x1,-m.y1)),i==null?(s.drawText(t,e,null,g,a),e.isEdge()&&(s.drawText(t,e,"source",g,a),s.drawText(t,e,"target",g,a))):s.drawText(t,e,i,g,a),r&&t.translate(m.x1,m.y1)};gg.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function hgt(t,e,r,n,i){var a=Math.min(n,i),s=a/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function pte(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,n/2,i/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.quadraticCurveTo(e+n,r,e+n,r+s),t.lineTo(e+n,r+i-s),t.quadraticCurveTo(e+n,r+i,e+n-s,r+i),t.lineTo(e+s,r+i),t.quadraticCurveTo(e,r+i,e,r+i-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}gg.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=Ms(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r};gg.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Ms(s,"labelX",r),u=Ms(s,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=Ms(s,"labelWidth",r),m=Ms(s,"labelHeight",r),y=Ms(s,"labelActualDescent",r),v=e.pstyle(p+"text-margin-x").pfValue,T=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;b&&(w="center",C="center"),l+=v,u+=T;var S;n?S=this.getTextAngle(e,r):S=0,S!==0&&(h=l,d=u,t.translate(h,d),t.rotate(S),l=0,u=0);var k=Ub(w),E=Yb(C);switch(E){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var _=e.pstyle("text-background-opacity").value,M=e.pstyle("text-border-opacity").value,L=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,D=e.pstyle("text-background-shape").strValue,R=D==="round-rectangle"||D==="roundrectangle",I=D==="circle",$=2;if(_>0||L>0&&M>0){var O=t.fillStyle,N=t.strokeStyle,F=t.lineWidth,z=e.pstyle("text-background-color").value,V=e.pstyle("text-border-color").value,B=e.pstyle("text-border-style").value,G=_>0,H=L>0&&M>0,q=l-P;switch(k){case"left":q-=g;break;case"center":q-=g/2;break}var Z=u-m-P,Y=g+2*P,ie=m+2*P;if(G&&(t.fillStyle="rgba(".concat(z[0],",").concat(z[1],",").concat(z[2],",").concat(_*o,")")),H&&(t.strokeStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(M*o,")"),t.lineWidth=L,t.setLineDash))switch(B){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=L/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(R?(t.beginPath(),pte(t,q,Z,Y,ie,$)):I?(t.beginPath(),hgt(t,q,Z,Y,ie)):(t.beginPath(),t.rect(q,Z,Y,ie)),G&&t.fill(),H&&t.stroke(),H&&B==="double"){var K=L/2;t.beginPath(),R?pte(t,q+K,Z+K,Y-2*K,ie-2*K,$):t.rect(q+K,Z+K,Y-2*K,ie-2*K),t.stroke()}t.fillStyle=O,t.strokeStyle=N,t.lineWidth=F,t.setLineDash&&t.setLineDash([])}var Q=2*e.pstyle("text-outline-width").pfValue;if(Q>0&&(t.lineWidth=Q),u-=y,e.pstyle("text-wrap").value==="wrap"){var te=Ms(s,"labelWrapCachedLines",r),J=Ms(s,"labelLineHeight",r),ge=g/2,ee=this.getLabelJustification(e);switch(ee==="auto"||(k==="left"?ee==="left"?l+=-g:ee==="center"&&(l+=-ge):k==="center"?ee==="left"?l+=-ge:ee==="right"&&(l+=ge):k==="right"&&(ee==="center"?l+=ge:ee==="right"&&(l+=g))),E){case"top":u-=(te.length-1)*J;break;case"center":case"bottom":u-=(te.length-1)*J;break}for(var Re=0;Re0&&t.strokeText(te[Re],l,u),t.fillText(te[Re],l,u),u+=J}else Q>0&&t.strokeText(f,l,u),t.fillText(f,l,u);S!==0&&(t.rotate(-S),t.translate(-h,-d))}}};var Mf={};Mf.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!Dt(d.x)||!Dt(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var v;r&&(v=r,t.translate(-v.x1,-v.y1));for(var T=e.pstyle("background-image"),b=T.value,w=new Array(b.length),C=new Array(b.length),S=0,k=0;k0&&arguments[0]!==void 0?arguments[0]:D;s.eleFillStyle(t,e,W)},K=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;s.colorStrokeStyle(t,R[0],R[1],R[2],W)},Q=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q;s.colorStrokeStyle(t,G[0],G[1],G[2],W)},te=function(W,ne,j,ue){var X=s.nodePathCache=s.nodePathCache||[],Oe=ove(j==="polygon"?j+","+ue.join(","):j,""+ne,""+W,""+Y),xe=X[Oe],Ge,_e=!1;return xe!=null?(Ge=xe,_e=!0,h.pathCache=Ge):(Ge=new Path2D,X[Oe]=h.pathCache=Ge),{path:Ge,cacheHit:_e}},J=e.pstyle("shape").strValue,ge=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var ee=te(o,l,J,ge);g=ee.path,m=ee.cacheHit}var Re=function(){if(!m){var W=d;p&&(W={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,W.x,W.y,o,l,Y,h)}p?t.fill(g):t.fill()},Ie=function(){for(var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,j=u.backgrounding,ue=0,X=0;X0&&arguments[0]!==void 0?arguments[0]:!1,ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,ne),W&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h)))},ce=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h),t.clip()),s.drawStripe(t,e,ne),t.restore(),W&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h)))},oe=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ne=(L>0?L:-L)*W,j=L>0?0:255;L!==0&&(s.colorFillStyle(t,j,j,j,ne),p?t.fill(g):t.fill())},be=function(){if(P>0){if(t.lineWidth=P,t.lineCap=O,t.lineJoin=$,t.setLineDash)switch(I){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(F),t.lineDashOffset=z;break;case"solid":case"double":t.setLineDash([]);break}if(N!=="center"){if(t.save(),t.lineWidth*=2,N==="inside")p?t.clip(g):t.clip();else{var W=new Path2D;W.rect(-o/2-P,-l/2-P,o+2*P,l+2*P),W.addPath(g),t.clip(W,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(I==="double"){t.lineWidth=P/3;var ne=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=ne}t.setLineDash&&t.setLineDash([])}},fe=function(){if(B>0){if(t.lineWidth=B,t.lineCap="butt",t.setLineDash)switch(H){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var W=d;p&&(W={x:0,y:0});var ne=s.getNodeShape(e),j=P;N==="inside"&&(j=0),N==="outside"&&(j*=2);var ue=(o+j+(B+Z))/o,X=(l+j+(B+Z))/l,Oe=o*ue,xe=l*X,Ge=s.nodeShapes[ne].points,_e;if(p){var $e=te(Oe,xe,ne,Ge);_e=$e.path}if(ne==="ellipse")s.drawEllipsePath(_e||t,W.x,W.y,Oe,xe);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ne)){var Me=0,He=0,De=0;ne==="round-diamond"?Me=(j+Z+B)*1.4:ne==="round-heptagon"?(Me=(j+Z+B)*1.075,De=-(j/2+Z+B)/35):ne==="round-hexagon"?Me=(j+Z+B)*1.12:ne==="round-pentagon"?(Me=(j+Z+B)*1.13,De=-(j/2+Z+B)/15):ne==="round-tag"?(Me=(j+Z+B)*1.12,He=(j/2+B+Z)*.07):ne==="round-triangle"&&(Me=(j+Z+B)*(Math.PI/2),De=-(j+Z/2+B)/Math.PI),Me!==0&&(ue=(o+Me)/o,Oe=o*ue,["round-hexagon","round-tag"].includes(ne)||(X=(l+Me)/l,xe=l*X)),Y=Y==="auto"?yve(Oe,xe):Y;for(var Ke=Oe/2,Ae=xe/2,at=Y+(j+B+Z)/2,Ee=new Array(Ge.length/2),pt=new Array(Ge.length/2),ht=0;ht0){if(i=i||n.position(),a==null||s==null){var p=n.padding();a=n.width()+2*p,s=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,a+l*2,s+l*2,f),r.fill()}}}};Mf.drawNodeOverlay=k2e("overlay");Mf.drawNodeUnderlay=k2e("underlay");Mf.hasPie=function(t){return t=t[0],t._private.hasPie};Mf.hasStripe=function(t){return t=t[0],t._private.hasStripe};Mf.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),s.units==="%"?p=f*s.pfValue:s.pfValue!==void 0&&(p=s.pfValue/2),!(p>=f))for(var y=1;y<=i.pieBackgroundN;y++){var v=e.pstyle("pie-"+y+"-background-size").value,T=e.pstyle("pie-"+y+"-background-color").value,b=e.pstyle("pie-"+y+"-background-opacity").value*r,w=v/100;w+g>1&&(w=1-g);var C=1.5*Math.PI+2*Math.PI*g;C+=o;var S=2*Math.PI*w,k=C+S;v===0||g>=1||g+w>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,C,k),t.closePath()):(t.beginPath(),t.arc(l,u,f,C,k),t.arc(l,u,p,k,C,!0),t.closePath()),this.colorFillStyle(t,T[0],T[1],T[2],b),t.fill(),g+=w)}};Mf.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(a=0,s=0),s-=p/2,a-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var y=e.pstyle("stripe-"+m+"-background-size").value,v=e.pstyle("stripe-"+m+"-background-color").value,T=e.pstyle("stripe-"+m+"-background-opacity").value*r,b=y/100;b+u>1&&(b=1-u),!(y===0||u>=1||u+b>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*b),t.closePath(),this.colorFillStyle(t,v[0],v[1],v[2],T),t.fill(),u+=b)}t.restore()};var Js={},dgt=100;Js.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};Js.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;ie.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var T=r.style(),b=r.zoom(),w=s!==void 0?s:b,C=r.pan(),S={x:C.x,y:C.y},k={zoom:b,pan:{x:C.x,y:C.y}},E=e.prevViewport,_=E===void 0||k.zoom!==E.zoom||k.pan.x!==E.pan.x||k.pan.y!==E.pan.y;!_&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(S=o),w*=l,S.x*=l,S.y*=l;var M=e.getCachedZSortedEles();function L(K,Q,te,J,ge){var ee=K.globalCompositeOperation;K.globalCompositeOperation="destination-out",e.colorFillStyle(K,255,255,255,e.motionBlurTransparency),K.fillRect(Q,te,J,ge),K.globalCompositeOperation=ee}function P(K,Q){var te,J,ge,ee;!e.clearingMotionBlur&&(K===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||K===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(te={x:C.x*p,y:C.y*p},J=b*p,ge=e.canvasWidth*p,ee=e.canvasHeight*p):(te=S,J=w,ge=e.canvasWidth,ee=e.canvasHeight),K.setTransform(1,0,0,1,0,0),Q==="motionBlur"?L(K,0,0,ge,ee):!n&&(Q===void 0||Q)&&K.clearRect(0,0,ge,ee),i||(K.translate(te.x,te.y),K.scale(J,J)),o&&K.translate(o.x,o.y),s&&K.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var D=e.data.bufferContexts[e.TEXTURE_BUFFER];D.setTransform(1,0,0,1,0,0),D.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:D,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var k=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};k.mpan={x:(0-k.pan.x)/k.zoom,y:(0-k.pan.y)/k.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var R=u.contexts[e.NODE],I=e.textureCache.texture,k=e.textureCache.viewport;R.setTransform(1,0,0,1,0,0),f?L(R,0,0,k.width,k.height):R.clearRect(0,0,k.width,k.height);var $=T.core("outside-texture-bg-color").value,O=T.core("outside-texture-bg-opacity").value;e.colorFillStyle(R,$[0],$[1],$[2],O),R.fillRect(0,0,k.width,k.height);var b=r.zoom();P(R,!1),R.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l),R.drawImage(I,k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var N=r.extent(),F=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),z=e.hideEdgesOnViewport&&F,V=[];if(V[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,V[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),V[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,V[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||V[e.NODE]){var B=f&&!V[e.NODE]&&p!==1,R=n||(B?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),G=f&&!B?"motionBlur":void 0;P(R,G),z?e.drawCachedNodes(R,M.nondrag,l,N):e.drawLayeredElements(R,M.nondrag,l,N),e.debug&&e.drawDebugPoints(R,M.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||V[e.DRAG])){var B=f&&!V[e.DRAG]&&p!==1,R=n||(B?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);P(R,f&&!B?"motionBlur":void 0),z?e.drawCachedNodes(R,M.drag,l,N):e.drawCachedElements(R,M.drag,l,N),e.debug&&e.drawDebugPoints(R,M.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,P),f&&p!==1){var H=u.contexts[e.NODE],q=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],Z=u.contexts[e.DRAG],Y=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ie=function(Q,te,J){Q.setTransform(1,0,0,1,0,0),J||!v?Q.clearRect(0,0,e.canvasWidth,e.canvasHeight):L(Q,0,0,e.canvasWidth,e.canvasHeight);var ge=p;Q.drawImage(te,0,0,e.canvasWidth*ge,e.canvasHeight*ge,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||V[e.NODE])&&(ie(H,q,V[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||V[e.DRAG])&&(ie(Z,Y,V[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=k,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},dgt)),n||r.emit("render")};var mT;Js.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=a.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),y="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!mT){var v=h.measureText(y);mT=v.actualBoundingBoxAscent}h.fillText(y,0,mT);var T=60;h.strokeRect(0,mT+10,250,20),h.fillRect(0,mT+10,250*Math.min(m/T,1),20)}o||(l[r.SELECT_BOX]=!1)}};function gte(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 fgt(t,e,r){var n=gte(t,t.VERTEX_SHADER,e),i=gte(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 pgt(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 cW(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 ggt(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function mgt(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 ygt(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function vgt(t,e){if(t.length!==e.length)return!1;for(var r=0;r>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function bgt(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function xgt(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 S2e(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 E2e(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function Tgt(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 wgt(t,e,r,n){var i=S2e(t,e),a=zi(i,2),s=a[0],o=a[1],l=E2e(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function vc(t,e,r,n){var i=S2e(t,r),a=zi(i,3),s=a[0],o=a[1],l=a[2],u=E2e(t,o,e*s),h=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;ps&&(o=s/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(b,w){if(i&&w){var C=w.context,S=b.x,k=b.row,E=S,_=l*k;C.save(),C.translate(E,_),C.scale(h,h),i(C,n),C.restore()}},g=[null,null],m=function(){p(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:f},g[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},y=function(){var b=a.scratch,w=a.canvas;b.clear(),p({x:0,row:0},b);var C=s-a.freePointer.x,S=d-C,k=l;{var E=a.freePointer.x,_=a.freePointer.row*l,M=C;w.context.drawImage(b,0,0,M,k,E,_,M,k),g[0]={x:E,y:_,w:M,h:f}}{var L=C,P=(a.freePointer.row+1)*l,D=S;w&&w.context.drawImage(b,L,0,D,k,0,P,D,k),g[1]={x:0,y:P,w:D,h:f}}a.freePointer.x=S,a.freePointer.row++},v=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(v(),m()):this.enableWrapping?y():(v(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=yo(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=yo(this.renderTypes.values()),v;try{var T=function(){var w=v.value,C=w.type;if(h(C)){var S=n.collections.get(w.collection),k=w.getKey(m),E=Array.isArray(k)?k:[k];if(s)E.forEach(function(P){return S.markKeyForGC(P)}),f=!0;else{var _=w.getID?w.getID(m):m.id(),M=n._key(C,_),L=n.typeAndIdToKey.get(M);L!==void 0&&!vgt(E,L)&&(d=!0,n.typeAndIdToKey.delete(M),L.forEach(function(P){return S.markKeyForGC(P)}))}}};for(y.s();!(v=y.n()).done;)T()}catch(b){y.e(b)}finally{y.f()}}}}catch(b){p.e(b)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=yo(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(a,i,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),s.drawElement(f,r,i,!0,!0),f.restore()):s.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=zi(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=yo(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=zi(i.value,2),s=a[0],o=a[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])})(),Mgt=(function(){function t(e){_f(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Rf(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])})(),Igt=` float circleSD(vec2 p, float r) { return distance(vec2(0), p) - r; // signed distance } -`,Lgt=` +`,Ngt=` float rectangleSD(vec2 p, vec2 b) { vec2 d = abs(p)-b; return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0); } -`,Mgt=` +`,Dgt=` float roundRectangleSD(vec2 p, vec2 b, vec4 cr) { cr.xy = (p.x > 0.0) ? cr.xy : cr.zw; cr.x = (p.y > 0.0) ? cr.x : cr.y; vec2 q = abs(p) - b + cr.x; return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x; } -`,Igt=` +`,Ogt=` float ellipseSD(vec2 p, vec2 ab) { p = abs( p ); // symmetry @@ -846,7 +848,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js // return signed distance return (dot(p/ab,p/ab)>1.0) ? d : -d; } -`,Yw={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},w_={IGNORE:1,USE_BB:2},nN=0,vte=1,bte=2,iN=3,tm=4,i4=5,yT=6,vT=7,Ngt=(function(){function t(e,r,n){_f(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=hgt,this.atlasManager=new Agt(e,n),this.batchManager=new _gt(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Yw.SCREEN),this.pickingProgram=this._createShaderProgram(Yw.PICKING),this.vao=this._createVAO()}return Rf(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(r,{filterType:function(o){return o===i},forceRedraw:!0}):a.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es +`,Yw={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},w_={IGNORE:1,USE_BB:2},nN=0,bte=1,xte=2,iN=3,tm=4,i4=5,yT=6,vT=7,$gt=(function(){function t(e,r,n){_f(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=pgt,this.atlasManager=new Lgt(e,n),this.batchManager=new Mgt(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Yw.SCREEN),this.pickingProgram=this._createShaderProgram(Yw.PICKING),this.vao=this._createVAO()}return Rf(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(r,{filterType:function(o){return o===i},forceRedraw:!0}):a.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es precision highp float; uniform mat3 uPanZoomMatrix; @@ -927,7 +929,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } - else if(aVertType == `).concat(vte,`) { + else if(aVertType == `).concat(bte,`) { vec2 source = aPointAPointB.xy; vec2 target = aPointAPointB.zw; @@ -942,7 +944,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); vColor = aColor; } - else if(aVertType == `).concat(bte,`) { + else if(aVertType == `).concat(xte,`) { vec2 pointA = aPointAPointB.xy; vec2 pointB = aPointAPointB.zw; vec2 pointC = aPointCPointD.xy; @@ -1036,10 +1038,10 @@ https://github.com/jquery/jquery/blob/master/src/event.js out vec4 outColor; - `).concat(Rgt,` - `).concat(Lgt,` - `).concat(Mgt,` `).concat(Igt,` + `).concat(Ngt,` + `).concat(Dgt,` + `).concat(Ogt,` vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha return vec4( @@ -1124,16 +1126,16 @@ https://github.com/jquery/jquery/blob/master/src/event.js `).concat(r.picking?`if(outColor.a == 0.0) discard; else outColor = vIndex;`:"",` } - `),o=ugt(n,i,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:Yw.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var a=this.atlasManager,s=this.batchManager,o=a.getRenderTypeOpts(i);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===w_.IGNORE)return;if(l==w_.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=yo(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;s.canAddToCurrentBatch(p)||this.endBatch();for(var y=s.getAtlasIndexForBatch(p),v=0,T=[[g,!0],[m,!1]];v=this.maxInstances&&this.endBatch()}}}}catch(L){h.e(L)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,h=a.tex2,d=u.w/(u.w+h.w);s||(d=1-d);var f=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,o,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var s,o;mte(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;m3(r,r,[h,d]),yte(r,r,l);var f=i.getRotationOffset(a);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;m3(r,r,[s,o]),mP(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var s=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(d=l-f,s+=d,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=tm;var o=this.indexBuffer.getView(s);em(n,o);var l=this.colorBuffer.getView(s);Zf([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,u,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(r,a)){var s=a.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||a.isSimple&&!a.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===i4||o===yT){var u=a.getBoundingBox(r),h=this._getCornerRadius(r,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===yT&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);em(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(s.opacity).value*p,m=r.pstyle(s.color).value,y=this.colorBuffer.getView(l);Zf(m,g,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,s.border){var T=r.pstyle("border-width").value;if(T>0){var b=r.pstyle("border-color").value,w=p*r.pstyle("border-opacity").value,C=this.borderColorBuffer.getView(l);Zf(b,w,C);var S=r.pstyle("border-position").value;if(S==="inside")v[0]=0,v[1]=-T;else if(S==="outside")v[0]=T,v[1]=0;else{var k=T/2;v[0]=k,v[1]=-k}}}var E=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,E,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return tm;case"ellipse":return vT;case"roundrectangle":case"round-rectangle":return i4;case"bottom-round-rectangle":return yT;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return uf(a,s);var o=r.pstyle(n).pfValue,l=a/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,s,o,l;if(i==="source"?(s=a.arrowStartX,o=a.arrowStartY,l=a.srcArrowAngle):(s=a.arrowEndX,o=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var h=r.pstyle(i+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=d*f,g=r.pstyle("width").pfValue,m=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(g,m),v=this.instanceCount,T=this.transformBuffer.getMatrixView(v);mte(T),m3(T,T,[s,o]),mP(T,T,[y,y]),yte(T,T,l),this.vertTypeBuffer.getView(v)[0]=iN;var b=this.indexBuffer.getView(v);em(n,b);var w=this.colorBuffer.getView(v);Zf(h,p,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var a=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=vte;var d=this.indexBuffer.getView(h);em(n,d);var f=this.colorBuffer.getView(h);Zf(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=o;var g=this.pointAPointBBuffer.getView(h);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(r);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=r[0],i[1]=r[1];else if(a==n)i[a*2]=r[r.length-2],i[a*2+1]=r[r.length-1];else{var s=a/n;this._setCurvePoint(r,s,i,a*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,a){if(r.length<=2)i[a]=r[0],i[a+1]=r[1];else{for(var s=Array(r.length-2),o=0;o0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?w_.USE_BB:w_.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),y=d.outerHeight();return{w:m,h:y,x1:p-m/2,y1:g-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:pgt,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:aN(e.getLabelKey,null),getBoundingBox:sN(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:a("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:aN(e.getSourceLabelKey,"source"),getBoundingBox:sN(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:a("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:aN(e.getTargetLabelKey,"target"),getBoundingBox:sN(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=mS(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(h,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),Ogt(r)};function Dgt(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return J1e(r)}function A2e(t,e){var r=t._private.rscratch;return Ms(r,"labelWrapCachedLines",e)||[]}var aN=function(e,r){return function(n){var i=e(n),a=A2e(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},sN=function(e,r){return function(n,i){var a=e(n);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var o=Number(i.substring(s+1)),l=A2e(n,r),u=a.h/l.length,h=u*o,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:u,yOffset:h}}}return a}};function Ogt(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>b2e?($gt(t),e.call(t,a)):(Pgt(t),R2e(t,a,Yw.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,o,l){return Wgt(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.drawing.invalidate(s,{type:"node-body"})}}}function $gt(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function Pgt(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function Bgt(t){var e=t.canvasWidth,r=t.canvasHeight,n=cW(t),i=n.pan,a=n.zoom,s=rN();m3(s,s,[i.x,i.y]),mP(s,s,[a,a]);var o=rN();Cgt(o,e,r);var l=rN();return wgt(l,o,s),l}function _2e(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=cW(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 Fgt(t,e){t.drawSelectionRectangle(e,function(r){return _2e(t,r)})}function zgt(t){var e=t.data.contexts[t.NODE];e.save(),_2e(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 Vgt(t){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h=0&&w.add(k)}return w}function Wgt(t,e,r){var n=Ggt(t,e,r),i=t.getCachedZSortedEles(),a,s,o=yo(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!a&&h.isNode()&&(a=h),!s&&h.isEdge()&&(s=h),a&&s)break}}catch(d){o.e(d)}finally{o.f()}return[a,s].filter(Boolean)}function oN(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function R2e(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,a=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&Fgt(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=Bgt(t),l=t.getCachedZSortedEles();if(a=l.length,i.startFrame(o,r),r.screen){for(var u=0;u0&&s>0){p.clearRect(0,0,a,s),p.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(n.x1*u,n.y1*u);else{var m=e.pan(),y={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(y.x,y.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-y.x,-y.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,a,s),p.fill())}return f};function Hgt(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":ca(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r};[T2e,fu,qh,lW,gg,Mf,Js,E2e,If,wS,I2e].forEach(function(t){dr(zr,t)});var Ygt=[{name:"null",impl:s2e},{name:"base",impl:y2e},{name:"canvas",impl:qgt}],Xgt=[{type:"layout",extensions:y0t},{type:"renderer",extensions:Ygt}],D2e={},O2e={};function $2e(t,e,r){var n=r,i=function(E){Cn("Can not register `"+e+"` for `"+t+"` since `"+E+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(ok.prototype[e])return i(e);ok.prototype[e]=r}else if(t==="collection"){if(Za.prototype[e])return i(e);Za.prototype[e]=r}else if(t==="layout"){for(var a=function(E){this.options=E,r.call(this,E),ln(this._private)||(this._private={}),this._private.cy=E.cy,this._private.listeners=[],this.createEmitter()},s=a.prototype=Object.create(r.prototype),o=[],l=0;lg&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(6),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,T){a.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,T){if(v==null&&T==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(v.owner==T.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=T.owner?null:(w.source=v,w.target=T,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),T!=v&&T.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=v.edges.slice(),b,w=T.length,C=0;C-1&&E>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(k,1),b.target!=b.source&&b.target.edges.splice(E,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,T,b,w,C=this.getNodes(),S=C.length,k=0;kT&&(y=T),v>b&&(v=b)}return y==s.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?w=C[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,C,S,k,E,_,M=this.nodes,L=M.length,P=0;PC&&(v=C),Tk&&(b=k),wC&&(v=C),Tk&&(b=k),w=this.nodes.length){var L=0;T.forEach(function(P){P.owner==y&&L++}),L==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=M,!1;if(df)return u[0]=g,u[1]=d,u[2]=E,u[3]=p,!1;if(hf?(u[0]=v,u[1]=T,R=!0):(u[0]=y,u[1]=m,R=!0):$===N&&(h>f?(u[0]=g,u[1]=m,R=!0):(u[0]=b,u[1]=T,R=!0)),-O===N?f>h?(u[2]=_,u[3]=M,I=!0):(u[2]=E,u[3]=k,I=!0):O===N&&(f>h?(u[2]=S,u[3]=k,I=!0):(u[2]=L,u[3]=M,I=!0)),R&&I)return!1;if(h>f?d>p?(F=this.getCardinalDirection($,N,4),z=this.getCardinalDirection(O,N,2)):(F=this.getCardinalDirection(-$,N,3),z=this.getCardinalDirection(-O,N,1)):d>p?(F=this.getCardinalDirection(-$,N,1),z=this.getCardinalDirection(-O,N,3)):(F=this.getCardinalDirection($,N,2),z=this.getCardinalDirection(O,N,4)),!R)switch(F){case 1:B=m,V=h+-C/N,u[0]=V,u[1]=B;break;case 2:V=b,B=d+w*N,u[0]=V,u[1]=B;break;case 3:B=T,V=h+C/N,u[0]=V,u[1]=B;break;case 4:V=v,B=d+-w*N,u[0]=V,u[1]=B;break}if(!I)switch(z){case 1:H=k,G=f+-D/N,u[2]=G,u[3]=H;break;case 2:G=L,H=p+P*N,u[2]=G,u[3]=H;break;case 3:H=M,G=f+D/N,u[2]=G,u[3]=H;break;case 4:G=_,H=p+-P*N,u[2]=G,u[3]=H;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,b=void 0,w=void 0,C=void 0,S=void 0,k=void 0,E=void 0,_=void 0,M=void 0,L=void 0;return C=g-f,k=d-p,_=p*f-d*g,S=T-y,E=m-v,M=v*y-m*T,L=C*E-S*k,L===0?null:(b=(k*M-E*_)/L,w=(S*_-C*M)/L,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(C.push(k[0]);C.length>0&&y;){var E=C[0];C.splice(0,1),w.add(E);for(var _=E.getEdges(),b=0;b<_.length;b++){var M=_[b].getOtherEnd(E);if(S.get(E)!=M)if(!w.has(M))C.push(M),S.set(M,E);else{y=!1;break}}}if(!y)m=[];else{var L=[].concat(a(w));m.push(L);for(var b=0;b-1&&k.splice(D,1)}w=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,T=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var T=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(M,1);var L=S.getNeighborsList();L.forEach(function(R){if(v.indexOf(R)<0){var I=T.get(R),$=I-1;$==1&&E.push(R),T.set(R,$)}})}v=v.concat(E),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,T,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mC||w>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*T)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>C||w>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||C>=b[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g0)this.positionNodesRadially(k);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),_=this.nodesWithGravity.filter(function(M){return E.has(M)});this.graphManager.setAllNodesToApplyGravitation(_),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},C.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var k=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(L){return k.has(L)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var _=!this.isTreeGrowing&&!this.isGrowthFinished,M=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(_,M),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},C.prototype.getPositionsData=function(){for(var k=this.graphManager.getAllNodes(),E={},_=0;_1){var R;for(R=0;RM&&(M=Math.floor(D.y)),P=Math.floor(D.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-D.x/2,p.WORLD_CENTER_Y-D.y/2))},C.radialLayout=function(k,E,_){var M=Math.max(this.maxDiagonalInTree(k),d.DEFAULT_RADIAL_SEPARATION);C.branchRadialLayout(E,null,0,359,0,M);var L=b.calculateBounds(k),P=new w;P.setDeviceOrgX(L.getMinX()),P.setDeviceOrgY(L.getMinY()),P.setWorldOrgX(_.x),P.setWorldOrgY(_.y);for(var D=0;D1;){var H=G[0];G.splice(0,1);var q=N.indexOf(H);q>=0&&N.splice(q,1),V--,F--}E!=null?B=(N.indexOf(G[0])+1)%V:B=0;for(var Z=Math.abs(M-_)/F,Y=B;z!=F;Y=++Y%V){var ie=N[Y].getOtherEnd(k);if(ie!=E){var K=(_+z*Z)%360,Q=(K+Z)%360;C.branchRadialLayout(ie,k,K,Q,L+P,P),z++}}},C.maxDiagonalInTree=function(k){for(var E=v.MIN_VALUE,_=0;_E&&(E=L)}return E},C.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},C.prototype.groupZeroDegreeMembers=function(){var k=this,E={};this.memberGroups={},this.idToDummyNode={};for(var _=[],M=this.graphManager.getAllNodes(),L=0;L"u"&&(E[R]=[]),E[R]=E[R].concat(P)}Object.keys(E).forEach(function(I){if(E[I].length>1){var $="DummyCompound_"+I;k.memberGroups[$]=E[I];var O=E[I][0].getParent(),N=new u(k.graphManager);N.id=$,N.paddingLeft=O.paddingLeft||0,N.paddingRight=O.paddingRight||0,N.paddingBottom=O.paddingBottom||0,N.paddingTop=O.paddingTop||0,k.idToDummyNode[$]=N;var F=k.getGraphManager().add(k.newGraph(),N),z=O.getChild();z.add(N);for(var V=0;V=0;k--){var E=this.compoundOrder[k],_=E.id,M=E.paddingLeft,L=E.paddingTop;this.adjustLocations(this.tiledMemberPack[_],E.rect.x,E.rect.y,M,L)}},C.prototype.repopulateZeroDegreeMembers=function(){var k=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(_){var M=k.idToDummyNode[_],L=M.paddingLeft,P=M.paddingTop;k.adjustLocations(E[_],M.rect.x,M.rect.y,L,P)})},C.prototype.getToBeTiled=function(k){var E=k.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var _=k.getChild();if(_==null)return this.toBeTiled[E]=!1,!1;for(var M=_.getNodes(),L=0;L0)return this.toBeTiled[E]=!1,!1;if(P.getChild()==null){this.toBeTiled[P.id]=!1;continue}if(!this.getToBeTiled(P))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},C.prototype.getNodeDegree=function(k){k.id;for(var E=k.getEdges(),_=0,M=0;MI&&(I=O.rect.height)}_+=I+k.verticalPadding}},C.prototype.tileCompoundMembers=function(k,E){var _=this;this.tiledMemberPack=[],Object.keys(k).forEach(function(M){var L=E[M];_.tiledMemberPack[M]=_.tileNodes(k[M],L.paddingLeft+L.paddingRight),L.rect.width=_.tiledMemberPack[M].width,L.rect.height=_.tiledMemberPack[M].height})},C.prototype.tileNodes=function(k,E){var _=d.TILING_PADDING_VERTICAL,M=d.TILING_PADDING_HORIZONTAL,L={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:_,horizontalPadding:M};k.sort(function(R,I){return R.rect.width*R.rect.height>I.rect.width*I.rect.height?-1:R.rect.width*R.rect.height0&&(D+=k.horizontalPadding),k.rowWidth[_]=D,k.width0&&(R+=k.verticalPadding);var I=0;R>k.rowHeight[_]&&(I=k.rowHeight[_],k.rowHeight[_]=R,I=k.rowHeight[_]-I),k.height+=I,k.rows[_].push(E)},C.prototype.getShortestRowIndex=function(k){for(var E=-1,_=Number.MAX_VALUE,M=0;M_&&(E=M,_=k.rowWidth[M]);return E},C.prototype.canAddHorizontal=function(k,E,_){var M=this.getShortestRowIndex(k);if(M<0)return!0;var L=k.rowWidth[M];if(L+k.horizontalPadding+E<=k.width)return!0;var P=0;k.rowHeight[M]<_&&M>0&&(P=_+k.verticalPadding-k.rowHeight[M]);var D;k.width-L>=E+k.horizontalPadding?D=(k.height+P)/(L+E+k.horizontalPadding):D=(k.height+P)/k.width,P=_+k.verticalPadding;var R;return k.widthP&&E!=_){M.splice(-1,1),k.rows[_].push(L),k.rowWidth[E]=k.rowWidth[E]-P,k.rowWidth[_]=k.rowWidth[_]+P,k.width=k.rowWidth[instance.getLongestRowIndex(k)];for(var D=Number.MIN_VALUE,R=0;RD&&(D=M[R].height);E>0&&(D+=k.verticalPadding);var I=k.rowHeight[E]+k.rowHeight[_];k.rowHeight[E]=D,k.rowHeight[_]0)for(var z=L;z<=P;z++)F[0]+=this.grid[z][D-1].length+this.grid[z][D].length-1;if(P0)for(var z=D;z<=R;z++)F[3]+=this.grid[L-1][z].length+this.grid[L][z].length-1;for(var V=v.MAX_VALUE,B,G,H=0;H0){var R;R=w.getGraphManager().add(w.newGraph(),_),this.processChildrenList(R,E,w)}}},m.prototype.stop=function(){return this.stopped=!0,this};var v=function(b){b("layout","cose-bilkent",m)};typeof cytoscape<"u"&&v(cytoscape),n.exports=v})])})})(y3)),y3.exports}var imt=nmt();const amt=eg(imt);eu.use(amt);function B2e(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}x(B2e,"addNodes");function F2e(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}x(F2e,"addEdges");function z2e(t){return new Promise(e=>{const r=ut("body").append("div").attr("id","cy").attr("style","display:none"),n=eu({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),B2e(t.nodes,n),F2e(t.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{const s=a.data();return{w:s.width,h:s.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{le.info("Cytoscape ready",a),e(n)})})}x(z2e,"createCytoscapeInstance");function V2e(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(a=>{a!=="id"&&(i[a]=r[a])}),i})}x(V2e,"extractPositionedNodes");function G2e(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(a=>{["id","source","target"].includes(a)||(i[a]=r[a])}),i})}x(G2e,"extractPositionedEdges");async function W2e(t,e){le.debug("Starting cose-bilkent layout algorithm");try{H2e(t);const r=await z2e(t),n=V2e(r),i=G2e(r);return le.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw le.error("Error in cose-bilkent layout algorithm:",r),r}}x(W2e,"executeCoseBilkentLayout");function H2e(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}x(H2e,"validateLayoutData");var smt=x(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:s,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");a(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),y=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async b=>{if(b.isGroup){const w={...b};d[b.id]=w,h[b.id]=w,await r(p,b)}else{const w={...b};h[b.id]=w;const C=await s(y,b,{config:t.config,dir:t.direction||"TB"}),S=C.node().getBBox();w.width=S.width,w.height=S.height,w.domId=C,o.debug(`Node ${b.id} dimensions: ${S.width}x${S.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const v={...t,nodes:t.nodes.map(b=>{const w=h[b.id];return{...b,width:w.width,height:w.height}})},T=await W2e(v,t.config);o.debug("Positioning nodes based on layout results"),T.nodes.forEach(b=>{const w=h[b.id];w!=null&&w.domId&&(w.domId.attr("transform",`translate(${b.x}, ${b.y})`),w.x=b.x,w.y=b.y,o.debug(`Positioned node ${w.id} at center (${b.x}, ${b.y})`))}),T.edges.forEach(b=>{const w=t.edges.find(C=>C.id===b.id);w&&(w.points=[{x:b.startX,y:b.startY},{x:b.midX,y:b.midY},{x:b.endX,y:b.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async b=>{await i(m,b);const w=h[b.start??""],C=h[b.end??""];if(w&&C){const S=T.edges.find(k=>k.id===b.id);if(S){o.debug("APA01 positionedEdge",S);const k={...b},E=n(g,k,d,t.type,w,C,t.diagramId);l(k,E)}else{const k={...b,points:[{x:w.x||0,y:w.y||0},{x:C.x||0,y:C.y||0}]},E=n(g,k,d,t.type,w,C,t.diagramId);l(k,E)}}})),o.debug("Cose-bilkent rendering completed")},"render"),omt=smt;const lmt=Object.freeze(Object.defineProperty({__proto__:null,render:omt},Symbol.toStringTag,{value:"Module"}));var xL=x((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),q2e=x((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};xL(t,r).lower()},"drawBackgroundRect"),cmt=x((t,e)=>{const r=e.text.replace(gx," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),uW=x((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=ig.sanitizeUrl(n);i.attr("xlink:href",a)},"drawImage"),hW=x((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=ig.sanitizeUrl(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),Yo=x(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),dW=x(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),fW=x(()=>{let t=ut(".mermaidTooltip");return t.empty()&&(t=ut("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip"),k_=(function(){var t=x(function(ve,Ce,Ve,se){for(Ve=Ve||{},se=ve.length;se--;Ve[ve[se]]=Ce);return Ve},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],o=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],y=[1,32],v=[1,33],T=[1,34],b=[1,35],w=[1,36],C=[1,37],S=[1,38],k=[1,39],E=[1,40],_=[1,41],M=[1,42],L=[1,43],P=[1,44],D=[1,45],R=[1,46],I=[1,47],$=[1,48],O=[1,50],N=[1,51],F=[1,52],z=[1,53],V=[1,54],B=[1,55],G=[1,56],H=[1,57],q=[1,58],Z=[1,59],Y=[1,60],ie=[14,42],K=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Q=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],te=[1,82],J=[1,83],ge=[1,84],ee=[1,85],Re=[12,14,42],Ie=[12,14,33,42],Be=[12,14,33,42,76,77,79,80],ce=[12,33],oe=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],be={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:x(function(Ce,Ve,se,de,Te,ae,he){var W=ae.length-1;switch(Te){case 3:de.setDirection("TB");break;case 4:de.setDirection("BT");break;case 5:de.setDirection("RL");break;case 6:de.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:de.setC4Type(ae[W-3]);break;case 19:de.setTitle(ae[W].substring(6)),this.$=ae[W].substring(6);break;case 20:de.setAccDescription(ae[W].substring(15)),this.$=ae[W].substring(15);break;case 21:this.$=ae[W].trim(),de.setTitle(this.$);break;case 22:case 23:this.$=ae[W].trim(),de.setAccDescription(this.$);break;case 28:ae[W].splice(2,0,"ENTERPRISE"),de.addPersonOrSystemBoundary(...ae[W]),this.$=ae[W];break;case 29:ae[W].splice(2,0,"SYSTEM"),de.addPersonOrSystemBoundary(...ae[W]),this.$=ae[W];break;case 30:de.addPersonOrSystemBoundary(...ae[W]),this.$=ae[W];break;case 31:ae[W].splice(2,0,"CONTAINER"),de.addContainerBoundary(...ae[W]),this.$=ae[W];break;case 32:de.addDeploymentNode("node",...ae[W]),this.$=ae[W];break;case 33:de.addDeploymentNode("nodeL",...ae[W]),this.$=ae[W];break;case 34:de.addDeploymentNode("nodeR",...ae[W]),this.$=ae[W];break;case 35:de.popBoundaryParseStack();break;case 39:de.addPersonOrSystem("person",...ae[W]),this.$=ae[W];break;case 40:de.addPersonOrSystem("external_person",...ae[W]),this.$=ae[W];break;case 41:de.addPersonOrSystem("system",...ae[W]),this.$=ae[W];break;case 42:de.addPersonOrSystem("system_db",...ae[W]),this.$=ae[W];break;case 43:de.addPersonOrSystem("system_queue",...ae[W]),this.$=ae[W];break;case 44:de.addPersonOrSystem("external_system",...ae[W]),this.$=ae[W];break;case 45:de.addPersonOrSystem("external_system_db",...ae[W]),this.$=ae[W];break;case 46:de.addPersonOrSystem("external_system_queue",...ae[W]),this.$=ae[W];break;case 47:de.addContainer("container",...ae[W]),this.$=ae[W];break;case 48:de.addContainer("container_db",...ae[W]),this.$=ae[W];break;case 49:de.addContainer("container_queue",...ae[W]),this.$=ae[W];break;case 50:de.addContainer("external_container",...ae[W]),this.$=ae[W];break;case 51:de.addContainer("external_container_db",...ae[W]),this.$=ae[W];break;case 52:de.addContainer("external_container_queue",...ae[W]),this.$=ae[W];break;case 53:de.addComponent("component",...ae[W]),this.$=ae[W];break;case 54:de.addComponent("component_db",...ae[W]),this.$=ae[W];break;case 55:de.addComponent("component_queue",...ae[W]),this.$=ae[W];break;case 56:de.addComponent("external_component",...ae[W]),this.$=ae[W];break;case 57:de.addComponent("external_component_db",...ae[W]),this.$=ae[W];break;case 58:de.addComponent("external_component_queue",...ae[W]),this.$=ae[W];break;case 60:de.addRel("rel",...ae[W]),this.$=ae[W];break;case 61:de.addRel("birel",...ae[W]),this.$=ae[W];break;case 62:de.addRel("rel_u",...ae[W]),this.$=ae[W];break;case 63:de.addRel("rel_d",...ae[W]),this.$=ae[W];break;case 64:de.addRel("rel_l",...ae[W]),this.$=ae[W];break;case 65:de.addRel("rel_r",...ae[W]),this.$=ae[W];break;case 66:de.addRel("rel_b",...ae[W]),this.$=ae[W];break;case 67:ae[W].splice(0,1),de.addRel("rel",...ae[W]),this.$=ae[W];break;case 68:de.updateElStyle("update_el_style",...ae[W]),this.$=ae[W];break;case 69:de.updateRelStyle("update_rel_style",...ae[W]),this.$=ae[W];break;case 70:de.updateLayoutConfig("update_layout_config",...ae[W]),this.$=ae[W];break;case 71:this.$=[ae[W]];break;case 72:ae[W].unshift(ae[W-1]),this.$=ae[W];break;case 73:case 75:this.$=ae[W].trim();break;case 74:let ne={};ne[ae[W-1].trim()]=ae[W].trim(),this.$=ne;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{14:[1,74]},t(ie,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y}),t(ie,[2,14]),t(K,[2,16],{12:[1,76]}),t(ie,[2,36],{12:[1,77]}),t(Q,[2,19]),t(Q,[2,20]),{25:[1,78]},{27:[1,79]},t(Q,[2,23]),{35:80,75:81,76:te,77:J,79:ge,80:ee},{35:86,75:81,76:te,77:J,79:ge,80:ee},{35:87,75:81,76:te,77:J,79:ge,80:ee},{35:88,75:81,76:te,77:J,79:ge,80:ee},{35:89,75:81,76:te,77:J,79:ge,80:ee},{35:90,75:81,76:te,77:J,79:ge,80:ee},{35:91,75:81,76:te,77:J,79:ge,80:ee},{35:92,75:81,76:te,77:J,79:ge,80:ee},{35:93,75:81,76:te,77:J,79:ge,80:ee},{35:94,75:81,76:te,77:J,79:ge,80:ee},{35:95,75:81,76:te,77:J,79:ge,80:ee},{35:96,75:81,76:te,77:J,79:ge,80:ee},{35:97,75:81,76:te,77:J,79:ge,80:ee},{35:98,75:81,76:te,77:J,79:ge,80:ee},{35:99,75:81,76:te,77:J,79:ge,80:ee},{35:100,75:81,76:te,77:J,79:ge,80:ee},{35:101,75:81,76:te,77:J,79:ge,80:ee},{35:102,75:81,76:te,77:J,79:ge,80:ee},{35:103,75:81,76:te,77:J,79:ge,80:ee},{35:104,75:81,76:te,77:J,79:ge,80:ee},t(Re,[2,59]),{35:105,75:81,76:te,77:J,79:ge,80:ee},{35:106,75:81,76:te,77:J,79:ge,80:ee},{35:107,75:81,76:te,77:J,79:ge,80:ee},{35:108,75:81,76:te,77:J,79:ge,80:ee},{35:109,75:81,76:te,77:J,79:ge,80:ee},{35:110,75:81,76:te,77:J,79:ge,80:ee},{35:111,75:81,76:te,77:J,79:ge,80:ee},{35:112,75:81,76:te,77:J,79:ge,80:ee},{35:113,75:81,76:te,77:J,79:ge,80:ee},{35:114,75:81,76:te,77:J,79:ge,80:ee},{35:115,75:81,76:te,77:J,79:ge,80:ee},{20:116,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{12:[1,118],33:[1,117]},{35:119,75:81,76:te,77:J,79:ge,80:ee},{35:120,75:81,76:te,77:J,79:ge,80:ee},{35:121,75:81,76:te,77:J,79:ge,80:ee},{35:122,75:81,76:te,77:J,79:ge,80:ee},{35:123,75:81,76:te,77:J,79:ge,80:ee},{35:124,75:81,76:te,77:J,79:ge,80:ee},{35:125,75:81,76:te,77:J,79:ge,80:ee},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ie,[2,15]),t(K,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(ie,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y}),t(Q,[2,21]),t(Q,[2,22]),t(Re,[2,39]),t(Ie,[2,71],{75:81,35:132,76:te,77:J,79:ge,80:ee}),t(Be,[2,73]),{78:[1,133]},t(Be,[2,75]),t(Be,[2,76]),t(Re,[2,40]),t(Re,[2,41]),t(Re,[2,42]),t(Re,[2,43]),t(Re,[2,44]),t(Re,[2,45]),t(Re,[2,46]),t(Re,[2,47]),t(Re,[2,48]),t(Re,[2,49]),t(Re,[2,50]),t(Re,[2,51]),t(Re,[2,52]),t(Re,[2,53]),t(Re,[2,54]),t(Re,[2,55]),t(Re,[2,56]),t(Re,[2,57]),t(Re,[2,58]),t(Re,[2,60]),t(Re,[2,61]),t(Re,[2,62]),t(Re,[2,63]),t(Re,[2,64]),t(Re,[2,65]),t(Re,[2,66]),t(Re,[2,67]),t(Re,[2,68]),t(Re,[2,69]),t(Re,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(ce,[2,28]),t(ce,[2,29]),t(ce,[2,30]),t(ce,[2,31]),t(ce,[2,32]),t(ce,[2,33]),t(ce,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(K,[2,18]),t(ie,[2,38]),t(Ie,[2,72]),t(Be,[2,74]),t(Re,[2,24]),t(Re,[2,35]),t(oe,[2,25]),t(oe,[2,26],{12:[1,138]}),t(oe,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:x(function(Ce,Ve){if(Ve.recoverable)this.trace(Ce);else{var se=new Error(Ce);throw se.hash=Ve,se}},"parseError"),parse:x(function(Ce){var Ve=this,se=[0],de=[],Te=[null],ae=[],he=this.table,W="",ne=0,j=0,ue=2,X=1,Oe=ae.slice.call(arguments,1),xe=Object.create(this.lexer),Ge={yy:{}};for(var _e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_e)&&(Ge.yy[_e]=this.yy[_e]);xe.setInput(Ce,Ge.yy),Ge.yy.lexer=xe,Ge.yy.parser=this,typeof xe.yylloc>"u"&&(xe.yylloc={});var $e=xe.yylloc;ae.push($e);var Me=xe.options&&xe.options.ranges;typeof Ge.yy.parseError=="function"?this.parseError=Ge.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function He(pe){se.length=se.length-2*pe,Te.length=Te.length-pe,ae.length=ae.length-pe}x(He,"popStack");function De(){var pe;return pe=de.pop()||xe.lex()||X,typeof pe!="number"&&(pe instanceof Array&&(de=pe,pe=de.pop()),pe=Ve.symbols_[pe]||pe),pe}x(De,"lex");for(var Ke,Ae,at,Ee,pt={},ht,rt,Et,vt;;){if(Ae=se[se.length-1],this.defaultActions[Ae]?at=this.defaultActions[Ae]:((Ke===null||typeof Ke>"u")&&(Ke=De()),at=he[Ae]&&he[Ae][Ke]),typeof at>"u"||!at.length||!at[0]){var ot="";vt=[];for(ht in he[Ae])this.terminals_[ht]&&ht>ue&&vt.push("'"+this.terminals_[ht]+"'");xe.showPosition?ot="Parse error on line "+(ne+1)+`: + `),o=fgt(n,i,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:Yw.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var a=this.atlasManager,s=this.batchManager,o=a.getRenderTypeOpts(i);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===w_.IGNORE)return;if(l==w_.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=yo(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;s.canAddToCurrentBatch(p)||this.endBatch();for(var y=s.getAtlasIndexForBatch(p),v=0,T=[[g,!0],[m,!1]];v=this.maxInstances&&this.endBatch()}}}}catch(L){h.e(L)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,h=a.tex2,d=u.w/(u.w+h.w);s||(d=1-d);var f=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,o,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var s,o;yte(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;m3(r,r,[h,d]),vte(r,r,l);var f=i.getRotationOffset(a);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;m3(r,r,[s,o]),mP(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var s=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(d=l-f,s+=d,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=tm;var o=this.indexBuffer.getView(s);em(n,o);var l=this.colorBuffer.getView(s);Zf([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,u,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(r,a)){var s=a.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||a.isSimple&&!a.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===i4||o===yT){var u=a.getBoundingBox(r),h=this._getCornerRadius(r,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===yT&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);em(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(s.opacity).value*p,m=r.pstyle(s.color).value,y=this.colorBuffer.getView(l);Zf(m,g,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,s.border){var T=r.pstyle("border-width").value;if(T>0){var b=r.pstyle("border-color").value,w=p*r.pstyle("border-opacity").value,C=this.borderColorBuffer.getView(l);Zf(b,w,C);var S=r.pstyle("border-position").value;if(S==="inside")v[0]=0,v[1]=-T;else if(S==="outside")v[0]=T,v[1]=0;else{var k=T/2;v[0]=k,v[1]=-k}}}var E=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,E,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return tm;case"ellipse":return vT;case"roundrectangle":case"round-rectangle":return i4;case"bottom-round-rectangle":return yT;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return uf(a,s);var o=r.pstyle(n).pfValue,l=a/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,s,o,l;if(i==="source"?(s=a.arrowStartX,o=a.arrowStartY,l=a.srcArrowAngle):(s=a.arrowEndX,o=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var h=r.pstyle(i+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=d*f,g=r.pstyle("width").pfValue,m=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(g,m),v=this.instanceCount,T=this.transformBuffer.getMatrixView(v);yte(T),m3(T,T,[s,o]),mP(T,T,[y,y]),vte(T,T,l),this.vertTypeBuffer.getView(v)[0]=iN;var b=this.indexBuffer.getView(v);em(n,b);var w=this.colorBuffer.getView(v);Zf(h,p,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var a=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=bte;var d=this.indexBuffer.getView(h);em(n,d);var f=this.colorBuffer.getView(h);Zf(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=o;var g=this.pointAPointBBuffer.getView(h);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(r);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=r[0],i[1]=r[1];else if(a==n)i[a*2]=r[r.length-2],i[a*2+1]=r[r.length-1];else{var s=a/n;this._setCurvePoint(r,s,i,a*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,a){if(r.length<=2)i[a]=r[0],i[a+1]=r[1];else{for(var s=Array(r.length-2),o=0;o0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?w_.USE_BB:w_.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),y=d.outerHeight();return{w:m,h:y,x1:p-m/2,y1:g-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:ygt,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:aN(e.getLabelKey,null),getBoundingBox:sN(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:a("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:aN(e.getSourceLabelKey,"source"),getBoundingBox:sN(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:a("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:aN(e.getTargetLabelKey,"target"),getBoundingBox:sN(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=mS(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(h,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),Bgt(r)};function Pgt(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return eve(r)}function _2e(t,e){var r=t._private.rscratch;return Ms(r,"labelWrapCachedLines",e)||[]}var aN=function(e,r){return function(n){var i=e(n),a=_2e(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},sN=function(e,r){return function(n,i){var a=e(n);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var o=Number(i.substring(s+1)),l=_2e(n,r),u=a.h/l.length,h=u*o,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:u,yOffset:h}}}return a}};function Bgt(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>x2e?(Fgt(t),e.call(t,a)):(zgt(t),L2e(t,a,Yw.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,o,l){return Ugt(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.drawing.invalidate(s,{type:"node-body"})}}}function Fgt(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function zgt(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function Vgt(t){var e=t.canvasWidth,r=t.canvasHeight,n=cW(t),i=n.pan,a=n.zoom,s=rN();m3(s,s,[i.x,i.y]),mP(s,s,[a,a]);var o=rN();Egt(o,e,r);var l=rN();return Sgt(l,o,s),l}function R2e(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=cW(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 Ggt(t,e){t.drawSelectionRectangle(e,function(r){return R2e(t,r)})}function Wgt(t){var e=t.data.contexts[t.NODE];e.save(),R2e(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 Hgt(t){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h=0&&w.add(k)}return w}function Ugt(t,e,r){var n=qgt(t,e,r),i=t.getCachedZSortedEles(),a,s,o=yo(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!a&&h.isNode()&&(a=h),!s&&h.isEdge()&&(s=h),a&&s)break}}catch(d){o.e(d)}finally{o.f()}return[a,s].filter(Boolean)}function oN(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function L2e(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,a=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&Ggt(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=Vgt(t),l=t.getCachedZSortedEles();if(a=l.length,i.startFrame(o,r),r.screen){for(var u=0;u0&&s>0){p.clearRect(0,0,a,s),p.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(n.x1*u,n.y1*u);else{var m=e.pan(),y={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(y.x,y.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-y.x,-y.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,a,s),p.fill())}return f};function Ygt(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":ca(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r};[w2e,fu,qh,lW,gg,Mf,Js,A2e,If,wS,N2e].forEach(function(t){dr(zr,t)});var Kgt=[{name:"null",impl:o2e},{name:"base",impl:v2e},{name:"canvas",impl:Xgt}],Zgt=[{type:"layout",extensions:x0t},{type:"renderer",extensions:Kgt}],O2e={},$2e={};function P2e(t,e,r){var n=r,i=function(E){Cn("Can not register `"+e+"` for `"+t+"` since `"+E+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(ok.prototype[e])return i(e);ok.prototype[e]=r}else if(t==="collection"){if(Za.prototype[e])return i(e);Za.prototype[e]=r}else if(t==="layout"){for(var a=function(E){this.options=E,r.call(this,E),ln(this._private)||(this._private={}),this._private.cy=E.cy,this._private.listeners=[],this.createEmitter()},s=a.prototype=Object.create(r.prototype),o=[],l=0;lg&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(6),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,T){a.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,T){if(v==null&&T==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(v.owner==T.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=T.owner?null:(w.source=v,w.target=T,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),T!=v&&T.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=v.edges.slice(),b,w=T.length,C=0;C-1&&E>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(k,1),b.target!=b.source&&b.target.edges.splice(E,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,T,b,w,C=this.getNodes(),S=C.length,k=0;kT&&(y=T),v>b&&(v=b)}return y==s.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?w=C[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,C,S,k,E,_,M=this.nodes,L=M.length,P=0;PC&&(v=C),Tk&&(b=k),wC&&(v=C),Tk&&(b=k),w=this.nodes.length){var L=0;T.forEach(function(P){P.owner==y&&L++}),L==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=M,!1;if(df)return u[0]=g,u[1]=d,u[2]=E,u[3]=p,!1;if(hf?(u[0]=v,u[1]=T,R=!0):(u[0]=y,u[1]=m,R=!0):$===N&&(h>f?(u[0]=g,u[1]=m,R=!0):(u[0]=b,u[1]=T,R=!0)),-O===N?f>h?(u[2]=_,u[3]=M,I=!0):(u[2]=E,u[3]=k,I=!0):O===N&&(f>h?(u[2]=S,u[3]=k,I=!0):(u[2]=L,u[3]=M,I=!0)),R&&I)return!1;if(h>f?d>p?(F=this.getCardinalDirection($,N,4),z=this.getCardinalDirection(O,N,2)):(F=this.getCardinalDirection(-$,N,3),z=this.getCardinalDirection(-O,N,1)):d>p?(F=this.getCardinalDirection(-$,N,1),z=this.getCardinalDirection(-O,N,3)):(F=this.getCardinalDirection($,N,2),z=this.getCardinalDirection(O,N,4)),!R)switch(F){case 1:B=m,V=h+-C/N,u[0]=V,u[1]=B;break;case 2:V=b,B=d+w*N,u[0]=V,u[1]=B;break;case 3:B=T,V=h+C/N,u[0]=V,u[1]=B;break;case 4:V=v,B=d+-w*N,u[0]=V,u[1]=B;break}if(!I)switch(z){case 1:H=k,G=f+-D/N,u[2]=G,u[3]=H;break;case 2:G=L,H=p+P*N,u[2]=G,u[3]=H;break;case 3:H=M,G=f+D/N,u[2]=G,u[3]=H;break;case 4:G=_,H=p+-P*N,u[2]=G,u[3]=H;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,b=void 0,w=void 0,C=void 0,S=void 0,k=void 0,E=void 0,_=void 0,M=void 0,L=void 0;return C=g-f,k=d-p,_=p*f-d*g,S=T-y,E=m-v,M=v*y-m*T,L=C*E-S*k,L===0?null:(b=(k*M-E*_)/L,w=(S*_-C*M)/L,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(C.push(k[0]);C.length>0&&y;){var E=C[0];C.splice(0,1),w.add(E);for(var _=E.getEdges(),b=0;b<_.length;b++){var M=_[b].getOtherEnd(E);if(S.get(E)!=M)if(!w.has(M))C.push(M),S.set(M,E);else{y=!1;break}}}if(!y)m=[];else{var L=[].concat(a(w));m.push(L);for(var b=0;b-1&&k.splice(D,1)}w=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,T=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var T=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(M,1);var L=S.getNeighborsList();L.forEach(function(R){if(v.indexOf(R)<0){var I=T.get(R),$=I-1;$==1&&E.push(R),T.set(R,$)}})}v=v.concat(E),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,T,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mC||w>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*T)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>C||w>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||C>=b[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g0)this.positionNodesRadially(k);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),_=this.nodesWithGravity.filter(function(M){return E.has(M)});this.graphManager.setAllNodesToApplyGravitation(_),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},C.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var k=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(L){return k.has(L)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var _=!this.isTreeGrowing&&!this.isGrowthFinished,M=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(_,M),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},C.prototype.getPositionsData=function(){for(var k=this.graphManager.getAllNodes(),E={},_=0;_1){var R;for(R=0;RM&&(M=Math.floor(D.y)),P=Math.floor(D.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-D.x/2,p.WORLD_CENTER_Y-D.y/2))},C.radialLayout=function(k,E,_){var M=Math.max(this.maxDiagonalInTree(k),d.DEFAULT_RADIAL_SEPARATION);C.branchRadialLayout(E,null,0,359,0,M);var L=b.calculateBounds(k),P=new w;P.setDeviceOrgX(L.getMinX()),P.setDeviceOrgY(L.getMinY()),P.setWorldOrgX(_.x),P.setWorldOrgY(_.y);for(var D=0;D1;){var H=G[0];G.splice(0,1);var q=N.indexOf(H);q>=0&&N.splice(q,1),V--,F--}E!=null?B=(N.indexOf(G[0])+1)%V:B=0;for(var Z=Math.abs(M-_)/F,Y=B;z!=F;Y=++Y%V){var ie=N[Y].getOtherEnd(k);if(ie!=E){var K=(_+z*Z)%360,Q=(K+Z)%360;C.branchRadialLayout(ie,k,K,Q,L+P,P),z++}}},C.maxDiagonalInTree=function(k){for(var E=v.MIN_VALUE,_=0;_E&&(E=L)}return E},C.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},C.prototype.groupZeroDegreeMembers=function(){var k=this,E={};this.memberGroups={},this.idToDummyNode={};for(var _=[],M=this.graphManager.getAllNodes(),L=0;L"u"&&(E[R]=[]),E[R]=E[R].concat(P)}Object.keys(E).forEach(function(I){if(E[I].length>1){var $="DummyCompound_"+I;k.memberGroups[$]=E[I];var O=E[I][0].getParent(),N=new u(k.graphManager);N.id=$,N.paddingLeft=O.paddingLeft||0,N.paddingRight=O.paddingRight||0,N.paddingBottom=O.paddingBottom||0,N.paddingTop=O.paddingTop||0,k.idToDummyNode[$]=N;var F=k.getGraphManager().add(k.newGraph(),N),z=O.getChild();z.add(N);for(var V=0;V=0;k--){var E=this.compoundOrder[k],_=E.id,M=E.paddingLeft,L=E.paddingTop;this.adjustLocations(this.tiledMemberPack[_],E.rect.x,E.rect.y,M,L)}},C.prototype.repopulateZeroDegreeMembers=function(){var k=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(_){var M=k.idToDummyNode[_],L=M.paddingLeft,P=M.paddingTop;k.adjustLocations(E[_],M.rect.x,M.rect.y,L,P)})},C.prototype.getToBeTiled=function(k){var E=k.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var _=k.getChild();if(_==null)return this.toBeTiled[E]=!1,!1;for(var M=_.getNodes(),L=0;L0)return this.toBeTiled[E]=!1,!1;if(P.getChild()==null){this.toBeTiled[P.id]=!1;continue}if(!this.getToBeTiled(P))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},C.prototype.getNodeDegree=function(k){k.id;for(var E=k.getEdges(),_=0,M=0;MI&&(I=O.rect.height)}_+=I+k.verticalPadding}},C.prototype.tileCompoundMembers=function(k,E){var _=this;this.tiledMemberPack=[],Object.keys(k).forEach(function(M){var L=E[M];_.tiledMemberPack[M]=_.tileNodes(k[M],L.paddingLeft+L.paddingRight),L.rect.width=_.tiledMemberPack[M].width,L.rect.height=_.tiledMemberPack[M].height})},C.prototype.tileNodes=function(k,E){var _=d.TILING_PADDING_VERTICAL,M=d.TILING_PADDING_HORIZONTAL,L={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:_,horizontalPadding:M};k.sort(function(R,I){return R.rect.width*R.rect.height>I.rect.width*I.rect.height?-1:R.rect.width*R.rect.height0&&(D+=k.horizontalPadding),k.rowWidth[_]=D,k.width0&&(R+=k.verticalPadding);var I=0;R>k.rowHeight[_]&&(I=k.rowHeight[_],k.rowHeight[_]=R,I=k.rowHeight[_]-I),k.height+=I,k.rows[_].push(E)},C.prototype.getShortestRowIndex=function(k){for(var E=-1,_=Number.MAX_VALUE,M=0;M_&&(E=M,_=k.rowWidth[M]);return E},C.prototype.canAddHorizontal=function(k,E,_){var M=this.getShortestRowIndex(k);if(M<0)return!0;var L=k.rowWidth[M];if(L+k.horizontalPadding+E<=k.width)return!0;var P=0;k.rowHeight[M]<_&&M>0&&(P=_+k.verticalPadding-k.rowHeight[M]);var D;k.width-L>=E+k.horizontalPadding?D=(k.height+P)/(L+E+k.horizontalPadding):D=(k.height+P)/k.width,P=_+k.verticalPadding;var R;return k.widthP&&E!=_){M.splice(-1,1),k.rows[_].push(L),k.rowWidth[E]=k.rowWidth[E]-P,k.rowWidth[_]=k.rowWidth[_]+P,k.width=k.rowWidth[instance.getLongestRowIndex(k)];for(var D=Number.MIN_VALUE,R=0;RD&&(D=M[R].height);E>0&&(D+=k.verticalPadding);var I=k.rowHeight[E]+k.rowHeight[_];k.rowHeight[E]=D,k.rowHeight[_]0)for(var z=L;z<=P;z++)F[0]+=this.grid[z][D-1].length+this.grid[z][D].length-1;if(P0)for(var z=D;z<=R;z++)F[3]+=this.grid[L-1][z].length+this.grid[L][z].length-1;for(var V=v.MAX_VALUE,B,G,H=0;H0){var R;R=w.getGraphManager().add(w.newGraph(),_),this.processChildrenList(R,E,w)}}},m.prototype.stop=function(){return this.stopped=!0,this};var v=function(b){b("layout","cose-bilkent",m)};typeof cytoscape<"u"&&v(cytoscape),n.exports=v})])})})(y3)),y3.exports}var omt=smt();const lmt=eg(omt);eu.use(lmt);function F2e(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}x(F2e,"addNodes");function z2e(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}x(z2e,"addEdges");function V2e(t){return new Promise(e=>{const r=ut("body").append("div").attr("id","cy").attr("style","display:none"),n=eu({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),F2e(t.nodes,n),z2e(t.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{const s=a.data();return{w:s.width,h:s.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{le.info("Cytoscape ready",a),e(n)})})}x(V2e,"createCytoscapeInstance");function G2e(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(a=>{a!=="id"&&(i[a]=r[a])}),i})}x(G2e,"extractPositionedNodes");function W2e(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(a=>{["id","source","target"].includes(a)||(i[a]=r[a])}),i})}x(W2e,"extractPositionedEdges");async function H2e(t,e){le.debug("Starting cose-bilkent layout algorithm");try{q2e(t);const r=await V2e(t),n=G2e(r),i=W2e(r);return le.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw le.error("Error in cose-bilkent layout algorithm:",r),r}}x(H2e,"executeCoseBilkentLayout");function q2e(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}x(q2e,"validateLayoutData");var cmt=x(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:s,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");a(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),y=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async b=>{if(b.isGroup){const w={...b};d[b.id]=w,h[b.id]=w,await r(p,b)}else{const w={...b};h[b.id]=w;const C=await s(y,b,{config:t.config,dir:t.direction||"TB"}),S=C.node().getBBox();w.width=S.width,w.height=S.height,w.domId=C,o.debug(`Node ${b.id} dimensions: ${S.width}x${S.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const v={...t,nodes:t.nodes.map(b=>{const w=h[b.id];return{...b,width:w.width,height:w.height}})},T=await H2e(v,t.config);o.debug("Positioning nodes based on layout results"),T.nodes.forEach(b=>{const w=h[b.id];w!=null&&w.domId&&(w.domId.attr("transform",`translate(${b.x}, ${b.y})`),w.x=b.x,w.y=b.y,o.debug(`Positioned node ${w.id} at center (${b.x}, ${b.y})`))}),T.edges.forEach(b=>{const w=t.edges.find(C=>C.id===b.id);w&&(w.points=[{x:b.startX,y:b.startY},{x:b.midX,y:b.midY},{x:b.endX,y:b.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async b=>{await i(m,b);const w=h[b.start??""],C=h[b.end??""];if(w&&C){const S=T.edges.find(k=>k.id===b.id);if(S){o.debug("APA01 positionedEdge",S);const k={...b},E=n(g,k,d,t.type,w,C,t.diagramId);l(k,E)}else{const k={...b,points:[{x:w.x||0,y:w.y||0},{x:C.x||0,y:C.y||0}]},E=n(g,k,d,t.type,w,C,t.diagramId);l(k,E)}}})),o.debug("Cose-bilkent rendering completed")},"render"),umt=cmt;const hmt=Object.freeze(Object.defineProperty({__proto__:null,render:umt},Symbol.toStringTag,{value:"Module"}));var xL=x((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),U2e=x((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};xL(t,r).lower()},"drawBackgroundRect"),dmt=x((t,e)=>{const r=e.text.replace(gx," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),uW=x((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=ig.sanitizeUrl(n);i.attr("xlink:href",a)},"drawImage"),hW=x((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=ig.sanitizeUrl(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),Yo=x(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),dW=x(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),fW=x(()=>{let t=ut(".mermaidTooltip");return t.empty()&&(t=ut("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip"),k_=(function(){var t=x(function(ve,Ce,Ve,se){for(Ve=Ve||{},se=ve.length;se--;Ve[ve[se]]=Ce);return Ve},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],o=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],y=[1,32],v=[1,33],T=[1,34],b=[1,35],w=[1,36],C=[1,37],S=[1,38],k=[1,39],E=[1,40],_=[1,41],M=[1,42],L=[1,43],P=[1,44],D=[1,45],R=[1,46],I=[1,47],$=[1,48],O=[1,50],N=[1,51],F=[1,52],z=[1,53],V=[1,54],B=[1,55],G=[1,56],H=[1,57],q=[1,58],Z=[1,59],Y=[1,60],ie=[14,42],K=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Q=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],te=[1,82],J=[1,83],ge=[1,84],ee=[1,85],Re=[12,14,42],Ie=[12,14,33,42],Be=[12,14,33,42,76,77,79,80],ce=[12,33],oe=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],be={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:x(function(Ce,Ve,se,de,Te,ae,he){var W=ae.length-1;switch(Te){case 3:de.setDirection("TB");break;case 4:de.setDirection("BT");break;case 5:de.setDirection("RL");break;case 6:de.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:de.setC4Type(ae[W-3]);break;case 19:de.setTitle(ae[W].substring(6)),this.$=ae[W].substring(6);break;case 20:de.setAccDescription(ae[W].substring(15)),this.$=ae[W].substring(15);break;case 21:this.$=ae[W].trim(),de.setTitle(this.$);break;case 22:case 23:this.$=ae[W].trim(),de.setAccDescription(this.$);break;case 28:ae[W].splice(2,0,"ENTERPRISE"),de.addPersonOrSystemBoundary(...ae[W]),this.$=ae[W];break;case 29:ae[W].splice(2,0,"SYSTEM"),de.addPersonOrSystemBoundary(...ae[W]),this.$=ae[W];break;case 30:de.addPersonOrSystemBoundary(...ae[W]),this.$=ae[W];break;case 31:ae[W].splice(2,0,"CONTAINER"),de.addContainerBoundary(...ae[W]),this.$=ae[W];break;case 32:de.addDeploymentNode("node",...ae[W]),this.$=ae[W];break;case 33:de.addDeploymentNode("nodeL",...ae[W]),this.$=ae[W];break;case 34:de.addDeploymentNode("nodeR",...ae[W]),this.$=ae[W];break;case 35:de.popBoundaryParseStack();break;case 39:de.addPersonOrSystem("person",...ae[W]),this.$=ae[W];break;case 40:de.addPersonOrSystem("external_person",...ae[W]),this.$=ae[W];break;case 41:de.addPersonOrSystem("system",...ae[W]),this.$=ae[W];break;case 42:de.addPersonOrSystem("system_db",...ae[W]),this.$=ae[W];break;case 43:de.addPersonOrSystem("system_queue",...ae[W]),this.$=ae[W];break;case 44:de.addPersonOrSystem("external_system",...ae[W]),this.$=ae[W];break;case 45:de.addPersonOrSystem("external_system_db",...ae[W]),this.$=ae[W];break;case 46:de.addPersonOrSystem("external_system_queue",...ae[W]),this.$=ae[W];break;case 47:de.addContainer("container",...ae[W]),this.$=ae[W];break;case 48:de.addContainer("container_db",...ae[W]),this.$=ae[W];break;case 49:de.addContainer("container_queue",...ae[W]),this.$=ae[W];break;case 50:de.addContainer("external_container",...ae[W]),this.$=ae[W];break;case 51:de.addContainer("external_container_db",...ae[W]),this.$=ae[W];break;case 52:de.addContainer("external_container_queue",...ae[W]),this.$=ae[W];break;case 53:de.addComponent("component",...ae[W]),this.$=ae[W];break;case 54:de.addComponent("component_db",...ae[W]),this.$=ae[W];break;case 55:de.addComponent("component_queue",...ae[W]),this.$=ae[W];break;case 56:de.addComponent("external_component",...ae[W]),this.$=ae[W];break;case 57:de.addComponent("external_component_db",...ae[W]),this.$=ae[W];break;case 58:de.addComponent("external_component_queue",...ae[W]),this.$=ae[W];break;case 60:de.addRel("rel",...ae[W]),this.$=ae[W];break;case 61:de.addRel("birel",...ae[W]),this.$=ae[W];break;case 62:de.addRel("rel_u",...ae[W]),this.$=ae[W];break;case 63:de.addRel("rel_d",...ae[W]),this.$=ae[W];break;case 64:de.addRel("rel_l",...ae[W]),this.$=ae[W];break;case 65:de.addRel("rel_r",...ae[W]),this.$=ae[W];break;case 66:de.addRel("rel_b",...ae[W]),this.$=ae[W];break;case 67:ae[W].splice(0,1),de.addRel("rel",...ae[W]),this.$=ae[W];break;case 68:de.updateElStyle("update_el_style",...ae[W]),this.$=ae[W];break;case 69:de.updateRelStyle("update_rel_style",...ae[W]),this.$=ae[W];break;case 70:de.updateLayoutConfig("update_layout_config",...ae[W]),this.$=ae[W];break;case 71:this.$=[ae[W]];break;case 72:ae[W].unshift(ae[W-1]),this.$=ae[W];break;case 73:case 75:this.$=ae[W].trim();break;case 74:let ne={};ne[ae[W-1].trim()]=ae[W].trim(),this.$=ne;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{14:[1,74]},t(ie,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y}),t(ie,[2,14]),t(K,[2,16],{12:[1,76]}),t(ie,[2,36],{12:[1,77]}),t(Q,[2,19]),t(Q,[2,20]),{25:[1,78]},{27:[1,79]},t(Q,[2,23]),{35:80,75:81,76:te,77:J,79:ge,80:ee},{35:86,75:81,76:te,77:J,79:ge,80:ee},{35:87,75:81,76:te,77:J,79:ge,80:ee},{35:88,75:81,76:te,77:J,79:ge,80:ee},{35:89,75:81,76:te,77:J,79:ge,80:ee},{35:90,75:81,76:te,77:J,79:ge,80:ee},{35:91,75:81,76:te,77:J,79:ge,80:ee},{35:92,75:81,76:te,77:J,79:ge,80:ee},{35:93,75:81,76:te,77:J,79:ge,80:ee},{35:94,75:81,76:te,77:J,79:ge,80:ee},{35:95,75:81,76:te,77:J,79:ge,80:ee},{35:96,75:81,76:te,77:J,79:ge,80:ee},{35:97,75:81,76:te,77:J,79:ge,80:ee},{35:98,75:81,76:te,77:J,79:ge,80:ee},{35:99,75:81,76:te,77:J,79:ge,80:ee},{35:100,75:81,76:te,77:J,79:ge,80:ee},{35:101,75:81,76:te,77:J,79:ge,80:ee},{35:102,75:81,76:te,77:J,79:ge,80:ee},{35:103,75:81,76:te,77:J,79:ge,80:ee},{35:104,75:81,76:te,77:J,79:ge,80:ee},t(Re,[2,59]),{35:105,75:81,76:te,77:J,79:ge,80:ee},{35:106,75:81,76:te,77:J,79:ge,80:ee},{35:107,75:81,76:te,77:J,79:ge,80:ee},{35:108,75:81,76:te,77:J,79:ge,80:ee},{35:109,75:81,76:te,77:J,79:ge,80:ee},{35:110,75:81,76:te,77:J,79:ge,80:ee},{35:111,75:81,76:te,77:J,79:ge,80:ee},{35:112,75:81,76:te,77:J,79:ge,80:ee},{35:113,75:81,76:te,77:J,79:ge,80:ee},{35:114,75:81,76:te,77:J,79:ge,80:ee},{35:115,75:81,76:te,77:J,79:ge,80:ee},{20:116,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{12:[1,118],33:[1,117]},{35:119,75:81,76:te,77:J,79:ge,80:ee},{35:120,75:81,76:te,77:J,79:ge,80:ee},{35:121,75:81,76:te,77:J,79:ge,80:ee},{35:122,75:81,76:te,77:J,79:ge,80:ee},{35:123,75:81,76:te,77:J,79:ge,80:ee},{35:124,75:81,76:te,77:J,79:ge,80:ee},{35:125,75:81,76:te,77:J,79:ge,80:ee},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ie,[2,15]),t(K,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(ie,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y}),t(Q,[2,21]),t(Q,[2,22]),t(Re,[2,39]),t(Ie,[2,71],{75:81,35:132,76:te,77:J,79:ge,80:ee}),t(Be,[2,73]),{78:[1,133]},t(Be,[2,75]),t(Be,[2,76]),t(Re,[2,40]),t(Re,[2,41]),t(Re,[2,42]),t(Re,[2,43]),t(Re,[2,44]),t(Re,[2,45]),t(Re,[2,46]),t(Re,[2,47]),t(Re,[2,48]),t(Re,[2,49]),t(Re,[2,50]),t(Re,[2,51]),t(Re,[2,52]),t(Re,[2,53]),t(Re,[2,54]),t(Re,[2,55]),t(Re,[2,56]),t(Re,[2,57]),t(Re,[2,58]),t(Re,[2,60]),t(Re,[2,61]),t(Re,[2,62]),t(Re,[2,63]),t(Re,[2,64]),t(Re,[2,65]),t(Re,[2,66]),t(Re,[2,67]),t(Re,[2,68]),t(Re,[2,69]),t(Re,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(ce,[2,28]),t(ce,[2,29]),t(ce,[2,30]),t(ce,[2,31]),t(ce,[2,32]),t(ce,[2,33]),t(ce,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(K,[2,18]),t(ie,[2,38]),t(Ie,[2,72]),t(Be,[2,74]),t(Re,[2,24]),t(Re,[2,35]),t(oe,[2,25]),t(oe,[2,26],{12:[1,138]}),t(oe,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:x(function(Ce,Ve){if(Ve.recoverable)this.trace(Ce);else{var se=new Error(Ce);throw se.hash=Ve,se}},"parseError"),parse:x(function(Ce){var Ve=this,se=[0],de=[],Te=[null],ae=[],he=this.table,W="",ne=0,j=0,ue=2,X=1,Oe=ae.slice.call(arguments,1),xe=Object.create(this.lexer),Ge={yy:{}};for(var _e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_e)&&(Ge.yy[_e]=this.yy[_e]);xe.setInput(Ce,Ge.yy),Ge.yy.lexer=xe,Ge.yy.parser=this,typeof xe.yylloc>"u"&&(xe.yylloc={});var $e=xe.yylloc;ae.push($e);var Me=xe.options&&xe.options.ranges;typeof Ge.yy.parseError=="function"?this.parseError=Ge.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function He(pe){se.length=se.length-2*pe,Te.length=Te.length-pe,ae.length=ae.length-pe}x(He,"popStack");function De(){var pe;return pe=de.pop()||xe.lex()||X,typeof pe!="number"&&(pe instanceof Array&&(de=pe,pe=de.pop()),pe=Ve.symbols_[pe]||pe),pe}x(De,"lex");for(var Ke,Ae,at,Ee,pt={},ht,rt,Et,vt;;){if(Ae=se[se.length-1],this.defaultActions[Ae]?at=this.defaultActions[Ae]:((Ke===null||typeof Ke>"u")&&(Ke=De()),at=he[Ae]&&he[Ae][Ke]),typeof at>"u"||!at.length||!at[0]){var ot="";vt=[];for(ht in he[Ae])this.terminals_[ht]&&ht>ue&&vt.push("'"+this.terminals_[ht]+"'");xe.showPosition?ot="Parse error on line "+(ne+1)+`: `+xe.showPosition()+` Expecting `+vt.join(", ")+", got '"+(this.terminals_[Ke]||Ke)+"'":ot="Parse error on line "+(ne+1)+": Unexpected "+(Ke==X?"end of input":"'"+(this.terminals_[Ke]||Ke)+"'"),this.parseError(ot,{text:xe.match,token:this.terminals_[Ke]||Ke,line:xe.yylineno,loc:$e,expected:vt})}if(at[0]instanceof Array&&at.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ae+", token: "+Ke);switch(at[0]){case 1:se.push(Ke),Te.push(xe.yytext),ae.push(xe.yylloc),se.push(at[1]),Ke=null,j=xe.yyleng,W=xe.yytext,ne=xe.yylineno,$e=xe.yylloc;break;case 2:if(rt=this.productions_[at[1]][1],pt.$=Te[Te.length-rt],pt._$={first_line:ae[ae.length-(rt||1)].first_line,last_line:ae[ae.length-1].last_line,first_column:ae[ae.length-(rt||1)].first_column,last_column:ae[ae.length-1].last_column},Me&&(pt._$.range=[ae[ae.length-(rt||1)].range[0],ae[ae.length-1].range[1]]),Ee=this.performAction.apply(pt,[W,j,ne,Ge.yy,at[1],Te,ae].concat(Oe)),typeof Ee<"u")return Ee;rt&&(se=se.slice(0,-1*rt*2),Te=Te.slice(0,-1*rt),ae=ae.slice(0,-1*rt)),se.push(this.productions_[at[1]][0]),Te.push(pt.$),ae.push(pt._$),Et=he[se[se.length-2]][se[se.length-1]],se.push(Et);break;case 3:return!0}}return!0},"parse")},fe=(function(){var ve={EOF:1,parseError:x(function(Ve,se){if(this.yy.parser)this.yy.parser.parseError(Ve,se);else throw new Error(Ve)},"parseError"),setInput:x(function(Ce,Ve){return this.yy=Ve||this.yy||{},this._input=Ce,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Ce=this._input[0];this.yytext+=Ce,this.yyleng++,this.offset++,this.match+=Ce,this.matched+=Ce;var Ve=Ce.match(/(?:\r\n?|\n).*/g);return Ve?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ce},"input"),unput:x(function(Ce){var Ve=Ce.length,se=Ce.split(/(?:\r\n?|\n)/g);this._input=Ce+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ve),this.offset-=Ve;var de=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),se.length-1&&(this.yylineno-=se.length-1);var Te=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:se?(se.length===de.length?this.yylloc.first_column:0)+de[de.length-se.length].length-se[0].length:this.yylloc.first_column-Ve},this.options.ranges&&(this.yylloc.range=[Te[0],Te[0]+this.yyleng-Ve]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Ce){this.unput(this.match.slice(Ce))},"less"),pastInput:x(function(){var Ce=this.matched.substr(0,this.matched.length-this.match.length);return(Ce.length>20?"...":"")+Ce.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Ce=this.match;return Ce.length<20&&(Ce+=this._input.substr(0,20-Ce.length)),(Ce.substr(0,20)+(Ce.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Ce=this.pastInput(),Ve=new Array(Ce.length+1).join("-");return Ce+this.upcomingInput()+` `+Ve+"^"},"showPosition"),test_match:x(function(Ce,Ve){var se,de,Te;if(this.options.backtrack_lexer&&(Te={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Te.yylloc.range=this.yylloc.range.slice(0))),de=Ce[0].match(/(?:\r\n?|\n).*/g),de&&(this.yylineno+=de.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:de?de[de.length-1].length-de[de.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ce[0].length},this.yytext+=Ce[0],this.match+=Ce[0],this.matches=Ce,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Ce[0].length),this.matched+=Ce[0],se=this.performAction.call(this,this.yy,this,Ve,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),se)return se;if(this._backtrack){for(var ae in Te)this[ae]=Te[ae];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ce,Ve,se,de;this._more||(this.yytext="",this.match="");for(var Te=this._currentRules(),ae=0;aeVe[0].length)){if(Ve=se,de=ae,this.options.backtrack_lexer){if(Ce=this.test_match(se,Te[ae]),Ce!==!1)return Ce;if(this._backtrack){Ve=!1;continue}else return!1}else if(!this.options.flex)break}return Ve?(Ce=this.test_match(Ve,Te[de]),Ce!==!1?Ce:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Ve=this.next();return Ve||this.lex()},"lex"),begin:x(function(Ve){this.conditionStack.push(Ve)},"begin"),popState:x(function(){var Ve=this.conditionStack.length-1;return Ve>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Ve){return Ve=this.conditionStack.length-1-Math.abs(Ve||0),Ve>=0?this.conditionStack[Ve]:"INITIAL"},"topState"),pushState:x(function(Ve){this.begin(Ve)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(Ve,se,de,Te){switch(de){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return ve})();be.lexer=fe;function Pe(){this.yy={}}return x(Pe,"Parser"),Pe.prototype=be,be.Parser=Pe,new Pe})();k_.parser=k_;var umt=k_,lc=[],Ud=[""],Vs="global",ec="",tu=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],ck=[],pW="",gW=!1,S_=4,E_=2,U2e,hmt=x(function(){return U2e},"getC4Type"),dmt=x(function(t){U2e=Wr(t,Fe())},"setC4Type"),fmt=x(function(t,e,r,n,i,a,s,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=ck.find(d=>d.from===e&&d.to===r);if(h?u=h:ck.push(u),u.type=t,u.from=e,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){let[d,f]=Object.entries(i)[0];u[d]={text:f}}else u.techn={text:i};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[d,f]=Object.entries(a)[0];u[d]={text:f}}else u.descr={text:a};if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]=f}else u.sprite=s;if(typeof o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.tags=o;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=Nf()},"addRel"),pmt=x(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=lc.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,lc.push(o)),r==null?o.label={text:""}:o.label={text:r},n==null)o.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];o[u]={text:h}}else o.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];o[u]=h}else o.sprite=i;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];o[u]=h}else o.tags=a;if(typeof s=="object"){let[u,h]=Object.entries(s)[0];o[u]=h}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=Vs,o.wrap=Nf()},"addPersonOrSystem"),gmt=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=lc.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,lc.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=Nf(),l.typeC4Shape={text:t},l.parentBoundary=Vs},"addContainer"),mmt=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=lc.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,lc.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=Nf(),l.typeC4Shape={text:t},l.parentBoundary=Vs},"addComponent"),ymt=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=tu.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,tu.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Vs,a.wrap=Nf(),ec=Vs,Vs=t,Ud.push(ec)},"addPersonOrSystemBoundary"),vmt=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=tu.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,tu.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Vs,a.wrap=Nf(),ec=Vs,Vs=t,Ud.push(ec)},"addContainerBoundary"),bmt=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=tu.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,tu.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.nodeType=t,l.parentBoundary=Vs,l.wrap=Nf(),ec=Vs,Vs=e,Ud.push(ec)},"addDeploymentNode"),xmt=x(function(){Vs=ec,Ud.pop(),ec=Ud.pop(),Ud.push(ec)},"popBoundaryParseStack"),Tmt=x(function(t,e,r,n,i,a,s,o,l,u,h){let d=lc.find(f=>f.alias===e);if(!(d===void 0&&(d=tu.find(f=>f.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[f,p]=Object.entries(r)[0];d[f]=p}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[f,p]=Object.entries(n)[0];d[f]=p}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[f,p]=Object.entries(i)[0];d[f]=p}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];d[f]=p}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.shape=s;if(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.sprite=o;if(l!=null)if(typeof l=="object"){let[f,p]=Object.entries(l)[0];d[f]=p}else d.techn=l;if(u!=null)if(typeof u=="object"){let[f,p]=Object.entries(u)[0];d[f]=p}else d.legendText=u;if(h!=null)if(typeof h=="object"){let[f,p]=Object.entries(h)[0];d[f]=p}else d.legendSprite=h}},"updateElStyle"),wmt=x(function(t,e,r,n,i,a,s){const o=ck.find(l=>l.from===e&&l.to===r);if(o!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];o[l]=u}else o.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];o[l]=u}else o.lineColor=i;if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(s)}},"updateRelStyle"),Cmt=x(function(t,e,r){let n=S_,i=E_;if(typeof e=="object"){const a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){const a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(S_=n),i>=1&&(E_=i)},"updateLayoutConfig"),kmt=x(function(){return S_},"getC4ShapeInRow"),Smt=x(function(){return E_},"getC4BoundaryInRow"),Emt=x(function(){return Vs},"getCurrentBoundaryParse"),Amt=x(function(){return ec},"getParentBoundaryParse"),Y2e=x(function(t){return t==null?lc:lc.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),_mt=x(function(t){return lc.find(e=>e.alias===t)},"getC4Shape"),Rmt=x(function(t){return Object.keys(Y2e(t))},"getC4ShapeKeys"),X2e=x(function(t){return t==null?tu:tu.filter(e=>e.parentBoundary===t)},"getBoundaries"),Lmt=X2e,Mmt=x(function(){return ck},"getRels"),Imt=x(function(){return pW},"getTitle"),Nmt=x(function(t){gW=t},"setWrap"),Nf=x(function(){return gW},"autoWrap"),Dmt=x(function(){lc=[],tu=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],ec="",Vs="global",Ud=[""],ck=[],Ud=[""],pW="",gW=!1,S_=4,E_=2},"clear"),Omt={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},$mt={FILLED:0,OPEN:1},Pmt={LEFTOF:0,RIGHTOF:1,OVER:2},Bmt=x(function(t){pW=Wr(t,Fe())},"setTitle"),xP={addPersonOrSystem:pmt,addPersonOrSystemBoundary:ymt,addContainer:gmt,addContainerBoundary:vmt,addComponent:mmt,addDeploymentNode:bmt,popBoundaryParseStack:xmt,addRel:fmt,updateElStyle:Tmt,updateRelStyle:wmt,updateLayoutConfig:Cmt,autoWrap:Nf,setWrap:Nmt,getC4ShapeArray:Y2e,getC4Shape:_mt,getC4ShapeKeys:Rmt,getBoundaries:X2e,getBoundarys:Lmt,getCurrentBoundaryParse:Emt,getParentBoundaryParse:Amt,getRels:Mmt,getTitle:Imt,getC4Type:hmt,getC4ShapeInRow:kmt,getC4BoundaryInRow:Smt,setAccTitle:Hn,getAccTitle:ni,getAccDescription:ai,setAccDescription:ii,getConfig:x(()=>Fe().c4,"getConfig"),clear:Dmt,LINETYPE:Omt,ARROWTYPE:$mt,PLACEMENT:Pmt,setTitle:Bmt,setC4Type:dmt},mW=x(function(t,e){return xL(t,e)},"drawRect"),j2e=x(function(t,e,r,n,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:ig.sanitizeUrl(a);s.attr("xlink:href",o)},"drawImage"),Fmt=x((t,e,r,n)=>{const i=t.append("g");let a=0;for(let s of e){let o=s.textColor?s.textColor:"#444444",l=s.lineColor?s.lineColor:"#444444",u=s.offsetX?parseInt(s.offsetX):0,h=s.offsetY?parseInt(s.offsetY):0,d="";if(a===0){let p=i.append("line");p.attr("x1",s.startPoint.x),p.attr("y1",s.startPoint.y),p.attr("x2",s.endPoint.x),p.attr("y2",s.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)"),a=-1}else{let p=i.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",s.startPoint.x).replaceAll("starty",s.startPoint.y).replaceAll("controlx",s.startPoint.x+(s.endPoint.x-s.startPoint.x)/2-(s.endPoint.x-s.startPoint.x)/4).replaceAll("controly",s.startPoint.y+(s.endPoint.y-s.startPoint.y)/2).replaceAll("stopx",s.endPoint.x).replaceAll("stopy",s.endPoint.y)),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();rh(r)(s.label.text,i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+h,s.label.width,s.label.height,{fill:o},f),s.techn&&s.techn.text!==""&&(f=r.messageFont(),rh(r)("["+s.techn.text+"]",i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+r.messageFontSize+5+h,Math.max(s.label.width,s.techn.width),s.techn.height,{fill:o,"font-style":"italic"},f))}},"drawRels"),zmt=x(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};mW(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,rh(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},u),e.type&&e.type.text!==""&&(u=r.boundaryFont(),u.fontColor=s,rh(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},u)),e.descr&&e.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=s,rh(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),Vmt=x(function(t,e,r){var d;let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const o=t.append("g");o.attr("class","person-man");const l=Yo();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},mW(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let u=jmt(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",a).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":j2e(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,rh(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&((d=e.techn)==null?void 0:d.text)!==""?rh(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&e.type.text!==""&&rh(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},h),e.descr&&e.descr.text!==""&&(h=r.personFont(),h.fontColor=a,rh(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),Gmt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Wmt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Hmt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),qmt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),Umt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),Ymt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Xmt=x(function(t,e){const n=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),n.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),jmt=x((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),rh=(function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(At.lineBreakRegex);for(let y=0;y=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>K2e)&&(r=this.nextData.startx+e.margin+Jt.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},wP(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},x(qy,"Bounds"),qy),wP=x(function(t){Wi(Jt,t),t.fontFamily&&(Jt.personFontFamily=Jt.systemFontFamily=Jt.messageFontFamily=t.fontFamily),t.fontSize&&(Jt.personFontSize=Jt.systemFontSize=Jt.messageFontSize=t.fontSize),t.fontWeight&&(Jt.personFontWeight=Jt.systemFontWeight=Jt.messageFontWeight=t.fontWeight)},"setConf"),bT=x((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),x3=x(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),Kmt=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function gl(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=Fw(e[t].text,i,n),e[t].textLines=e[t].text.split(At.lineBreakRegex).length,e[t].width=i,e[t].height=RA(e[t].text,n);else{let a=e[t].text.split(At.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(const o of a)e[t].width=Math.max(zs(o,n),e[t].width),s=RA(o,n),e[t].height=e[t].height+s}}x(gl,"calcC4ShapeTextWH");var Q2e=x(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=Jt.c4ShapeMargin-35;let n=e.wrap&&Jt.wrap,i=x3(Jt);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=zs(e.label.text,i);gl("label",e,n,i,a),Ic.drawBoundary(t,e,Jt)},"drawBoundary"),J2e=x(function(t,e,r,n){let i=0;for(const a of n){i=0;const s=r[a];let o=bT(Jt,s.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,s.typeC4Shape.width=zs("«"+s.typeC4Shape.text+"»",o),s.typeC4Shape.height=o.fontSize+2,s.typeC4Shape.Y=Jt.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let l=s.wrap&&Jt.wrap,u=Jt.width-Jt.c4ShapePadding*2,h=bT(Jt,s.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",gl("label",s,l,h,u),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let p=bT(Jt,s.typeC4Shape.text);gl("type",s,l,p,u),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let p=bT(Jt,s.techn.text);gl("techn",s,l,p,u),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,f=s.label.width;if(s.descr&&s.descr.text!==""){let p=bT(Jt,s.typeC4Shape.text);gl("descr",s,l,p,u),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,f=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}f=f+Jt.c4ShapePadding,s.width=Math.max(s.width||Jt.width,f,Jt.width),s.height=Math.max(s.height||Jt.height,d,Jt.height),s.margin=s.margin||Jt.c4ShapeMargin,t.insert(s),Ic.drawC4Shape(e,s,Jt)}t.bumpLastMargin(Jt.c4ShapeMargin)},"drawC4ShapeArray"),Uy,el=(Uy=class{constructor(e,r){this.x=e,this.y=r}},x(Uy,"Point"),Uy),Ete=x(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-a),h=u/l,d=t.height/t.width,f=null;return n==a&&ri?f=new el(r,o):r==i&&na&&(f=new el(s,n)),r>i&&n=h?f=new el(r,o+h*t.width/2):f=new el(s-l/u*t.height/2,n+t.height):r=h?f=new el(r+t.width,o+h*t.width/2):f=new el(s+l/u*t.height/2,n+t.height):ra?d>=h?f=new el(r+t.width,o-h*t.width/2):f=new el(s+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new el(r,o-t.width/2*h):f=new el(s-t.height/2*l/u,n)),f},"getIntersectPoint"),Zmt=x(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=Ete(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=Ete(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),Qmt=x(function(t,e,r,n,i){let a=0;for(let s of e){a=a+1;let o=s.wrap&&Jt.wrap,l=Kmt(Jt);n.db.getC4Type()==="C4Dynamic"&&(s.label.text=a+": "+s.label.text);let h=zs(s.label.text,l);gl("label",s,o,l,h),s.techn&&s.techn.text!==""&&(h=zs(s.techn.text,l),gl("techn",s,o,l,h)),s.descr&&s.descr.text!==""&&(h=zs(s.descr.text,l),gl("descr",s,o,l,h));let d=r(s.from),f=r(s.to),p=Zmt(d,f);s.startPoint=p.startPoint,s.endPoint=p.endPoint}Ic.drawRels(t,e,Jt,i)},"drawRels");function yW(t,e,r,n,i){let a=new Z2e(i);a.data.widthLimit=r.data.widthLimit/Math.min(TP,n.length);for(let[s,o]of n.entries()){let l=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=l,l=o.image.Y+o.image.height);let u=o.wrap&&Jt.wrap,h=x3(Jt);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",gl("label",o,u,h,a.data.widthLimit),o.label.Y=l+8,l=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let g=x3(Jt);gl("type",o,u,g,a.data.widthLimit),o.type.Y=l+5,l=o.type.Y+o.type.height}if(o.descr&&o.descr.text!==""){let g=x3(Jt);g.fontSize=g.fontSize-2,gl("descr",o,u,g,a.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(s==0||s%TP===0){let g=r.data.startx+Jt.diagramMarginX,m=r.data.stopy+Jt.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+Jt.diagramMarginX:a.data.startx,m=a.data.starty;a.setData(g,g,m,m)}a.name=o.alias;let d=i.db.getC4ShapeArray(o.alias),f=i.db.getC4ShapeKeys(o.alias);f.length>0&&J2e(a,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&yW(t,e,a,p,i),o.alias!=="global"&&Q2e(t,o,a),r.data.stopy=Math.max(a.data.stopy+Jt.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+Jt.c4ShapeMargin,r.data.stopx),A_=Math.max(A_,r.data.stopx),__=Math.max(__,r.data.stopy)}}x(yW,"drawInsideBoundary");var Jmt=x(function(t,e,r,n){Jt=Fe().c4;const i=Fe().securityLevel;let a;i==="sandbox"&&(a=ut("#i"+e));const s=ut(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(Jt.wrap),K2e=o.getC4ShapeInRow(),TP=o.getC4BoundaryInRow(),le.debug(`C:${JSON.stringify(Jt,null,2)}`);const l=i==="sandbox"?s.select(`[id="${e}"]`):ut(`[id="${e}"]`);Ic.insertComputerIcon(l,e),Ic.insertDatabaseIcon(l,e),Ic.insertClockIcon(l,e);let u=new Z2e(n);u.setData(Jt.diagramMarginX,Jt.diagramMarginX,Jt.diagramMarginY,Jt.diagramMarginY),u.data.widthLimit=screen.availWidth,A_=Jt.diagramMarginX,__=Jt.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");yW(l,"",u,d,n),Ic.insertArrowHead(l,e),Ic.insertArrowEnd(l,e),Ic.insertArrowCrossHead(l,e),Ic.insertArrowFilledHead(l,e),Qmt(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=A_,u.data.stopy=__;const f=u.data;let g=f.stopy-f.starty+2*Jt.diagramMarginY;const y=f.stopx-f.startx+2*Jt.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*Jt.diagramMarginX).attr("y",f.starty+Jt.diagramMarginY),Ai(l,g,y,Jt.useMaxWidth);const v=h?60:0;l.attr("viewBox",f.startx-Jt.diagramMarginX+" -"+(Jt.diagramMarginY+v)+" "+y+" "+(g+v)),le.debug("models:",f)},"draw"),Ate={drawPersonOrSystemArray:J2e,drawBoundary:Q2e,setConf:wP,draw:Jmt},eyt=x(t=>`.person { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Ve=this.next();return Ve||this.lex()},"lex"),begin:x(function(Ve){this.conditionStack.push(Ve)},"begin"),popState:x(function(){var Ve=this.conditionStack.length-1;return Ve>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Ve){return Ve=this.conditionStack.length-1-Math.abs(Ve||0),Ve>=0?this.conditionStack[Ve]:"INITIAL"},"topState"),pushState:x(function(Ve){this.begin(Ve)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(Ve,se,de,Te){switch(de){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return ve})();be.lexer=fe;function Pe(){this.yy={}}return x(Pe,"Parser"),Pe.prototype=be,be.Parser=Pe,new Pe})();k_.parser=k_;var fmt=k_,lc=[],Ud=[""],Vs="global",ec="",tu=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],ck=[],pW="",gW=!1,S_=4,E_=2,Y2e,pmt=x(function(){return Y2e},"getC4Type"),gmt=x(function(t){Y2e=Wr(t,Fe())},"setC4Type"),mmt=x(function(t,e,r,n,i,a,s,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=ck.find(d=>d.from===e&&d.to===r);if(h?u=h:ck.push(u),u.type=t,u.from=e,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){let[d,f]=Object.entries(i)[0];u[d]={text:f}}else u.techn={text:i};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[d,f]=Object.entries(a)[0];u[d]={text:f}}else u.descr={text:a};if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]=f}else u.sprite=s;if(typeof o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.tags=o;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=Nf()},"addRel"),ymt=x(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=lc.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,lc.push(o)),r==null?o.label={text:""}:o.label={text:r},n==null)o.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];o[u]={text:h}}else o.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];o[u]=h}else o.sprite=i;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];o[u]=h}else o.tags=a;if(typeof s=="object"){let[u,h]=Object.entries(s)[0];o[u]=h}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=Vs,o.wrap=Nf()},"addPersonOrSystem"),vmt=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=lc.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,lc.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=Nf(),l.typeC4Shape={text:t},l.parentBoundary=Vs},"addContainer"),bmt=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=lc.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,lc.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=Nf(),l.typeC4Shape={text:t},l.parentBoundary=Vs},"addComponent"),xmt=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=tu.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,tu.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Vs,a.wrap=Nf(),ec=Vs,Vs=t,Ud.push(ec)},"addPersonOrSystemBoundary"),Tmt=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=tu.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,tu.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Vs,a.wrap=Nf(),ec=Vs,Vs=t,Ud.push(ec)},"addContainerBoundary"),wmt=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=tu.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,tu.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.nodeType=t,l.parentBoundary=Vs,l.wrap=Nf(),ec=Vs,Vs=e,Ud.push(ec)},"addDeploymentNode"),Cmt=x(function(){Vs=ec,Ud.pop(),ec=Ud.pop(),Ud.push(ec)},"popBoundaryParseStack"),kmt=x(function(t,e,r,n,i,a,s,o,l,u,h){let d=lc.find(f=>f.alias===e);if(!(d===void 0&&(d=tu.find(f=>f.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[f,p]=Object.entries(r)[0];d[f]=p}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[f,p]=Object.entries(n)[0];d[f]=p}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[f,p]=Object.entries(i)[0];d[f]=p}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];d[f]=p}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.shape=s;if(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.sprite=o;if(l!=null)if(typeof l=="object"){let[f,p]=Object.entries(l)[0];d[f]=p}else d.techn=l;if(u!=null)if(typeof u=="object"){let[f,p]=Object.entries(u)[0];d[f]=p}else d.legendText=u;if(h!=null)if(typeof h=="object"){let[f,p]=Object.entries(h)[0];d[f]=p}else d.legendSprite=h}},"updateElStyle"),Smt=x(function(t,e,r,n,i,a,s){const o=ck.find(l=>l.from===e&&l.to===r);if(o!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];o[l]=u}else o.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];o[l]=u}else o.lineColor=i;if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(s)}},"updateRelStyle"),Emt=x(function(t,e,r){let n=S_,i=E_;if(typeof e=="object"){const a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){const a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(S_=n),i>=1&&(E_=i)},"updateLayoutConfig"),Amt=x(function(){return S_},"getC4ShapeInRow"),_mt=x(function(){return E_},"getC4BoundaryInRow"),Rmt=x(function(){return Vs},"getCurrentBoundaryParse"),Lmt=x(function(){return ec},"getParentBoundaryParse"),X2e=x(function(t){return t==null?lc:lc.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),Mmt=x(function(t){return lc.find(e=>e.alias===t)},"getC4Shape"),Imt=x(function(t){return Object.keys(X2e(t))},"getC4ShapeKeys"),j2e=x(function(t){return t==null?tu:tu.filter(e=>e.parentBoundary===t)},"getBoundaries"),Nmt=j2e,Dmt=x(function(){return ck},"getRels"),Omt=x(function(){return pW},"getTitle"),$mt=x(function(t){gW=t},"setWrap"),Nf=x(function(){return gW},"autoWrap"),Pmt=x(function(){lc=[],tu=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],ec="",Vs="global",Ud=[""],ck=[],Ud=[""],pW="",gW=!1,S_=4,E_=2},"clear"),Bmt={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},Fmt={FILLED:0,OPEN:1},zmt={LEFTOF:0,RIGHTOF:1,OVER:2},Vmt=x(function(t){pW=Wr(t,Fe())},"setTitle"),xP={addPersonOrSystem:ymt,addPersonOrSystemBoundary:xmt,addContainer:vmt,addContainerBoundary:Tmt,addComponent:bmt,addDeploymentNode:wmt,popBoundaryParseStack:Cmt,addRel:mmt,updateElStyle:kmt,updateRelStyle:Smt,updateLayoutConfig:Emt,autoWrap:Nf,setWrap:$mt,getC4ShapeArray:X2e,getC4Shape:Mmt,getC4ShapeKeys:Imt,getBoundaries:j2e,getBoundarys:Nmt,getCurrentBoundaryParse:Rmt,getParentBoundaryParse:Lmt,getRels:Dmt,getTitle:Omt,getC4Type:pmt,getC4ShapeInRow:Amt,getC4BoundaryInRow:_mt,setAccTitle:Hn,getAccTitle:ni,getAccDescription:ai,setAccDescription:ii,getConfig:x(()=>Fe().c4,"getConfig"),clear:Pmt,LINETYPE:Bmt,ARROWTYPE:Fmt,PLACEMENT:zmt,setTitle:Vmt,setC4Type:gmt},mW=x(function(t,e){return xL(t,e)},"drawRect"),K2e=x(function(t,e,r,n,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:ig.sanitizeUrl(a);s.attr("xlink:href",o)},"drawImage"),Gmt=x((t,e,r,n)=>{const i=t.append("g");let a=0;for(let s of e){let o=s.textColor?s.textColor:"#444444",l=s.lineColor?s.lineColor:"#444444",u=s.offsetX?parseInt(s.offsetX):0,h=s.offsetY?parseInt(s.offsetY):0,d="";if(a===0){let p=i.append("line");p.attr("x1",s.startPoint.x),p.attr("y1",s.startPoint.y),p.attr("x2",s.endPoint.x),p.attr("y2",s.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)"),a=-1}else{let p=i.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",s.startPoint.x).replaceAll("starty",s.startPoint.y).replaceAll("controlx",s.startPoint.x+(s.endPoint.x-s.startPoint.x)/2-(s.endPoint.x-s.startPoint.x)/4).replaceAll("controly",s.startPoint.y+(s.endPoint.y-s.startPoint.y)/2).replaceAll("stopx",s.endPoint.x).replaceAll("stopy",s.endPoint.y)),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();rh(r)(s.label.text,i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+h,s.label.width,s.label.height,{fill:o},f),s.techn&&s.techn.text!==""&&(f=r.messageFont(),rh(r)("["+s.techn.text+"]",i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+r.messageFontSize+5+h,Math.max(s.label.width,s.techn.width),s.techn.height,{fill:o,"font-style":"italic"},f))}},"drawRels"),Wmt=x(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};mW(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,rh(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},u),e.type&&e.type.text!==""&&(u=r.boundaryFont(),u.fontColor=s,rh(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},u)),e.descr&&e.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=s,rh(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),Hmt=x(function(t,e,r){var d;let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const o=t.append("g");o.attr("class","person-man");const l=Yo();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},mW(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let u=Qmt(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",a).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":K2e(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,rh(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&((d=e.techn)==null?void 0:d.text)!==""?rh(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&e.type.text!==""&&rh(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},h),e.descr&&e.descr.text!==""&&(h=r.personFont(),h.fontColor=a,rh(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),qmt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Umt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Ymt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Xmt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),jmt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),Kmt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Zmt=x(function(t,e){const n=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),n.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),Qmt=x((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),rh=(function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(At.lineBreakRegex);for(let y=0;y=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>Z2e)&&(r=this.nextData.startx+e.margin+Jt.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},wP(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},x(qy,"Bounds"),qy),wP=x(function(t){Wi(Jt,t),t.fontFamily&&(Jt.personFontFamily=Jt.systemFontFamily=Jt.messageFontFamily=t.fontFamily),t.fontSize&&(Jt.personFontSize=Jt.systemFontSize=Jt.messageFontSize=t.fontSize),t.fontWeight&&(Jt.personFontWeight=Jt.systemFontWeight=Jt.messageFontWeight=t.fontWeight)},"setConf"),bT=x((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),x3=x(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),Jmt=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function gl(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=Fw(e[t].text,i,n),e[t].textLines=e[t].text.split(At.lineBreakRegex).length,e[t].width=i,e[t].height=RA(e[t].text,n);else{let a=e[t].text.split(At.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(const o of a)e[t].width=Math.max(zs(o,n),e[t].width),s=RA(o,n),e[t].height=e[t].height+s}}x(gl,"calcC4ShapeTextWH");var J2e=x(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=Jt.c4ShapeMargin-35;let n=e.wrap&&Jt.wrap,i=x3(Jt);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=zs(e.label.text,i);gl("label",e,n,i,a),Ic.drawBoundary(t,e,Jt)},"drawBoundary"),ebe=x(function(t,e,r,n){let i=0;for(const a of n){i=0;const s=r[a];let o=bT(Jt,s.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,s.typeC4Shape.width=zs("«"+s.typeC4Shape.text+"»",o),s.typeC4Shape.height=o.fontSize+2,s.typeC4Shape.Y=Jt.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let l=s.wrap&&Jt.wrap,u=Jt.width-Jt.c4ShapePadding*2,h=bT(Jt,s.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",gl("label",s,l,h,u),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let p=bT(Jt,s.typeC4Shape.text);gl("type",s,l,p,u),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let p=bT(Jt,s.techn.text);gl("techn",s,l,p,u),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,f=s.label.width;if(s.descr&&s.descr.text!==""){let p=bT(Jt,s.typeC4Shape.text);gl("descr",s,l,p,u),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,f=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}f=f+Jt.c4ShapePadding,s.width=Math.max(s.width||Jt.width,f,Jt.width),s.height=Math.max(s.height||Jt.height,d,Jt.height),s.margin=s.margin||Jt.c4ShapeMargin,t.insert(s),Ic.drawC4Shape(e,s,Jt)}t.bumpLastMargin(Jt.c4ShapeMargin)},"drawC4ShapeArray"),Uy,el=(Uy=class{constructor(e,r){this.x=e,this.y=r}},x(Uy,"Point"),Uy),Ate=x(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-a),h=u/l,d=t.height/t.width,f=null;return n==a&&ri?f=new el(r,o):r==i&&na&&(f=new el(s,n)),r>i&&n=h?f=new el(r,o+h*t.width/2):f=new el(s-l/u*t.height/2,n+t.height):r=h?f=new el(r+t.width,o+h*t.width/2):f=new el(s+l/u*t.height/2,n+t.height):ra?d>=h?f=new el(r+t.width,o-h*t.width/2):f=new el(s+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new el(r,o-t.width/2*h):f=new el(s-t.height/2*l/u,n)),f},"getIntersectPoint"),eyt=x(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=Ate(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=Ate(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),tyt=x(function(t,e,r,n,i){let a=0;for(let s of e){a=a+1;let o=s.wrap&&Jt.wrap,l=Jmt(Jt);n.db.getC4Type()==="C4Dynamic"&&(s.label.text=a+": "+s.label.text);let h=zs(s.label.text,l);gl("label",s,o,l,h),s.techn&&s.techn.text!==""&&(h=zs(s.techn.text,l),gl("techn",s,o,l,h)),s.descr&&s.descr.text!==""&&(h=zs(s.descr.text,l),gl("descr",s,o,l,h));let d=r(s.from),f=r(s.to),p=eyt(d,f);s.startPoint=p.startPoint,s.endPoint=p.endPoint}Ic.drawRels(t,e,Jt,i)},"drawRels");function yW(t,e,r,n,i){let a=new Q2e(i);a.data.widthLimit=r.data.widthLimit/Math.min(TP,n.length);for(let[s,o]of n.entries()){let l=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=l,l=o.image.Y+o.image.height);let u=o.wrap&&Jt.wrap,h=x3(Jt);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",gl("label",o,u,h,a.data.widthLimit),o.label.Y=l+8,l=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let g=x3(Jt);gl("type",o,u,g,a.data.widthLimit),o.type.Y=l+5,l=o.type.Y+o.type.height}if(o.descr&&o.descr.text!==""){let g=x3(Jt);g.fontSize=g.fontSize-2,gl("descr",o,u,g,a.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(s==0||s%TP===0){let g=r.data.startx+Jt.diagramMarginX,m=r.data.stopy+Jt.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+Jt.diagramMarginX:a.data.startx,m=a.data.starty;a.setData(g,g,m,m)}a.name=o.alias;let d=i.db.getC4ShapeArray(o.alias),f=i.db.getC4ShapeKeys(o.alias);f.length>0&&ebe(a,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&yW(t,e,a,p,i),o.alias!=="global"&&J2e(t,o,a),r.data.stopy=Math.max(a.data.stopy+Jt.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+Jt.c4ShapeMargin,r.data.stopx),A_=Math.max(A_,r.data.stopx),__=Math.max(__,r.data.stopy)}}x(yW,"drawInsideBoundary");var ryt=x(function(t,e,r,n){Jt=Fe().c4;const i=Fe().securityLevel;let a;i==="sandbox"&&(a=ut("#i"+e));const s=ut(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(Jt.wrap),Z2e=o.getC4ShapeInRow(),TP=o.getC4BoundaryInRow(),le.debug(`C:${JSON.stringify(Jt,null,2)}`);const l=i==="sandbox"?s.select(`[id="${e}"]`):ut(`[id="${e}"]`);Ic.insertComputerIcon(l,e),Ic.insertDatabaseIcon(l,e),Ic.insertClockIcon(l,e);let u=new Q2e(n);u.setData(Jt.diagramMarginX,Jt.diagramMarginX,Jt.diagramMarginY,Jt.diagramMarginY),u.data.widthLimit=screen.availWidth,A_=Jt.diagramMarginX,__=Jt.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");yW(l,"",u,d,n),Ic.insertArrowHead(l,e),Ic.insertArrowEnd(l,e),Ic.insertArrowCrossHead(l,e),Ic.insertArrowFilledHead(l,e),tyt(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=A_,u.data.stopy=__;const f=u.data;let g=f.stopy-f.starty+2*Jt.diagramMarginY;const y=f.stopx-f.startx+2*Jt.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*Jt.diagramMarginX).attr("y",f.starty+Jt.diagramMarginY),Ai(l,g,y,Jt.useMaxWidth);const v=h?60:0;l.attr("viewBox",f.startx-Jt.diagramMarginX+" -"+(Jt.diagramMarginY+v)+" "+y+" "+(g+v)),le.debug("models:",f)},"draw"),_te={drawPersonOrSystemArray:ebe,drawBoundary:J2e,setConf:wP,draw:ryt},nyt=x(t=>`.person { stroke: ${t.personBorder}; fill: ${t.personBkg}; } -`,"getStyles"),tyt=eyt,ryt={parser:umt,db:xP,renderer:Ate,styles:tyt,init:x(({c4:t,wrap:e})=>{Ate.setConf(t),xP.setWrap(e)},"init")};const nyt=Object.freeze(Object.defineProperty({__proto__:null,diagram:ryt},Symbol.toStringTag,{value:"Module"}));var CS=x(()=>` +`,"getStyles"),iyt=nyt,ayt={parser:fmt,db:xP,renderer:_te,styles:iyt,init:x(({c4:t,wrap:e})=>{_te.setConf(t),xP.setWrap(e)},"init")};const syt=Object.freeze(Object.defineProperty({__proto__:null,diagram:ayt},Symbol.toStringTag,{value:"Module"}));var CS=x(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; @@ -1147,21 +1149,21 @@ Expecting `+vt.join(", ")+", got '"+(this.terminals_[Ke]||Ke)+"'":ot="Parse erro stroke: revert; stroke-width: revert; } -`,"getIconStyles"),Ox=x((t,e)=>{let r;return e==="sandbox"&&(r=ut("#i"+t)),ut(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),mg=x((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=iyt(t,e);Ai(t,a,i,n);const l=ayt(s,o,i,a,e);t.attr("viewBox",l),le.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),iyt=x((t,e)=>{var n;const r=((n=t.node())==null?void 0:n.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),ayt=x((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),syt="flowchart-",Yy,oyt=(Yy=class{constructor(){this.vertexCounter=0,this.config=Fe(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Hn,this.setAccDescription=ii,this.setDiagramTitle=ti,this.getAccTitle=ni,this.getAccDescription=ai,this.getDiagramTitle=Yn,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(e){return At.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,i,a,s,o={},l){var p,g;if(!e||e.trim().length===0)return;let u;if(l!==void 0){let m;l.includes(` +`,"getIconStyles"),Ox=x((t,e)=>{let r;return e==="sandbox"&&(r=ut("#i"+t)),ut(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),mg=x((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=oyt(t,e);Ai(t,a,i,n);const l=lyt(s,o,i,a,e);t.attr("viewBox",l),le.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),oyt=x((t,e)=>{var n;const r=((n=t.node())==null?void 0:n.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),lyt=x((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),cyt="flowchart-",Yy,uyt=(Yy=class{constructor(){this.vertexCounter=0,this.config=Fe(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Hn,this.setAccDescription=ii,this.setDiagramTitle=ti,this.getAccTitle=ni,this.getAccDescription=ai,this.getDiagramTitle=Yn,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(e){return At.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,i,a,s,o={},l){var p,g;if(!e||e.trim().length===0)return;let u;if(l!==void 0){let m;l.includes(` `)?m=l+` `:m=`{ `+l+` -}`,u=dR(m,{schema:hR})}const h=this.edges.find(m=>m.id===e);if(h){const m=u;(m==null?void 0:m.animate)!==void 0&&(h.animate=m.animate),(m==null?void 0:m.animation)!==void 0&&(h.animation=m.animation),(m==null?void 0:m.curve)!==void 0&&(h.interpolate=m.curve);return}let d,f=this.vertices.get(e);if(f===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&le.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:syt+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=Fe(),d=this.sanitizeText(r.text.trim()),f.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),f.text=d):f.text===void 0&&(f.text=e),n!==void 0&&(f.type=n),i!=null&&i.forEach(m=>{f.styles.push(m)}),a!=null&&a.forEach(m=>{f.classes.push(m)}),s!==void 0&&(f.dir=s),f.props===void 0?f.props=o:o!==void 0&&Object.assign(f.props,o),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!Ppe(u.shape))throw new Error(`No such shape: ${u.shape}.`);f.type=u==null?void 0:u.shape}u!=null&&u.label&&(f.text=u==null?void 0:u.label,f.labelType=this.sanitizeNodeLabelType(u==null?void 0:u.labelType)),u!=null&&u.icon&&(f.icon=u==null?void 0:u.icon,!((p=u.label)!=null&&p.trim())&&f.text===e&&(f.text="")),u!=null&&u.form&&(f.form=u==null?void 0:u.form),u!=null&&u.pos&&(f.pos=u==null?void 0:u.pos),u!=null&&u.img&&(f.img=u==null?void 0:u.img,!((g=u.label)!=null&&g.trim())&&f.text===e&&(f.text="")),u!=null&&u.constraint&&(f.constraint=u.constraint),u.w&&(f.assetWidth=Number(u.w)),u.h&&(f.assetHeight=Number(u.h))}}addSingleLink(e,r,n,i){const o={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};le.info("abc78 Got edge...",o);const l=n.text;if(l!==void 0&&(o.text=this.sanitizeText(l.text.trim()),o.text.startsWith('"')&&o.text.endsWith('"')&&(o.text=o.text.substring(1,o.text.length-1)),o.labelType=this.sanitizeNodeLabelType(l.type)),n!==void 0&&(o.type=n.type,o.stroke=n.stroke,o.length=n.length>10?10:n.length),i&&!this.edges.some(u=>u.id===i))o.id=i,o.isUserDefinedId=!0;else{const u=this.edges.filter(h=>h.start===o.start&&h.end===o.end);u.length===0?o.id=dy(o.start,o.end,{counter:0,prefix:"L"}):o.id=dy(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))le.info("Pushing edge..."),this.edges.push(o);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. +}`,u=dR(m,{schema:hR})}const h=this.edges.find(m=>m.id===e);if(h){const m=u;(m==null?void 0:m.animate)!==void 0&&(h.animate=m.animate),(m==null?void 0:m.animation)!==void 0&&(h.animation=m.animation),(m==null?void 0:m.curve)!==void 0&&(h.interpolate=m.curve);return}let d,f=this.vertices.get(e);if(f===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&le.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:cyt+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=Fe(),d=this.sanitizeText(r.text.trim()),f.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),f.text=d):f.text===void 0&&(f.text=e),n!==void 0&&(f.type=n),i!=null&&i.forEach(m=>{f.styles.push(m)}),a!=null&&a.forEach(m=>{f.classes.push(m)}),s!==void 0&&(f.dir=s),f.props===void 0?f.props=o:o!==void 0&&Object.assign(f.props,o),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!Bpe(u.shape))throw new Error(`No such shape: ${u.shape}.`);f.type=u==null?void 0:u.shape}u!=null&&u.label&&(f.text=u==null?void 0:u.label,f.labelType=this.sanitizeNodeLabelType(u==null?void 0:u.labelType)),u!=null&&u.icon&&(f.icon=u==null?void 0:u.icon,!((p=u.label)!=null&&p.trim())&&f.text===e&&(f.text="")),u!=null&&u.form&&(f.form=u==null?void 0:u.form),u!=null&&u.pos&&(f.pos=u==null?void 0:u.pos),u!=null&&u.img&&(f.img=u==null?void 0:u.img,!((g=u.label)!=null&&g.trim())&&f.text===e&&(f.text="")),u!=null&&u.constraint&&(f.constraint=u.constraint),u.w&&(f.assetWidth=Number(u.w)),u.h&&(f.assetHeight=Number(u.h))}}addSingleLink(e,r,n,i){const o={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};le.info("abc78 Got edge...",o);const l=n.text;if(l!==void 0&&(o.text=this.sanitizeText(l.text.trim()),o.text.startsWith('"')&&o.text.endsWith('"')&&(o.text=o.text.substring(1,o.text.length-1)),o.labelType=this.sanitizeNodeLabelType(l.type)),n!==void 0&&(o.type=n.type,o.stroke=n.stroke,o.length=n.length>10?10:n.length),i&&!this.edges.some(u=>u.id===i))o.id=i,o.isUserDefinedId=!0;else{const u=this.edges.filter(h=>h.start===o.start&&h.end===o.end);u.length===0?o.id=dy(o.start,o.end,{counter:0,prefix:"L"}):o.id=dy(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))le.info("Pushing edge..."),this.edges.push(o);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. Initialize mermaid with maxEdges set to a higher number to allow more edges. You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;le.info("addLink",e,r,i);for(const a of e)for(const s of r){const o=a===e[e.length-1],l=s===r[0];o&&l?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,a,s,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((a=(i=this.edges[n])==null?void 0:i.style)==null?void 0:a.length)??0)>0&&!((o=(s=this.edges[n])==null?void 0:s.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n!=null&&n.forEach(s=>{if(/color/.exec(s)){const o=s.replace("fill","bgFill");a.textStyles.push(o)}a.styles.push(s)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const a=this.edges.find(o=>o.id===n);a&&a.classes.push(r);const s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){if(Fe().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{const s=this.lookUpDomId(e),o=document.querySelector(`[id="${s}"]`);o!==null&&o.addEventListener("click",()=>{yr.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=yr.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const r=fW();ut(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=ut(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(ph.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),ut(a.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=Fe(),On()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const o=x(g=>{const m={boolean:{},number:{},string:{}},y=[];let v;return{nodeList:g.filter(function(b){const w=typeof b;return b.stmt&&b.stmt==="dir"?(v=b.value,!1):b.trim()===""?!1:w in m?m[w].hasOwnProperty(b)?!1:m[w][b]=!0:y.includes(b)?!1:y.push(b)}),dir:v}},"uniq")(r.flat()),l=o.nodeList,u=o.dir,h=u!==void 0,d=Fe().flowchart??{},f=u??(d.inheritDir?this.getDirection()??Fe().direction??void 0:void 0);if(this.version==="gen-1")for(let g=0;g2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,a=1;for(;i=0){const o=this.indexNodes2(e,s);if(o.result)return{result:!0,count:a+o.count};a=a+o.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let a=0;a":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const o=this.countChar(".",n);return o&&(a="dotted",s=o),{type:i,stroke:a,length:s}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(e.nodes[a])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,a,s){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:((h=a.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){const e=Fe(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&s.set(h.id,!0);for(const d of h.nodes)a.set(d,h.id)}for(let u=i.length-1;u>=0;u--){const h=i[u];r.push({id:h.id,label:h.title,labelStyle:"",labelType:h.labelType,parentId:a.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir==="TD"?"TB":h.dir,explicitDir:h.hasExplicitDir,isGroup:!0,look:e.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,a,s,e,e.look||"classic")});const l=this.getEdges();return l.forEach((u,h)=>{var m;const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:dy(u.start,u.end,{counter:h,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelType:u.labelType,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:(u==null?void 0:u.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":d,arrowTypeEnd:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:p,style:p,pattern:u.stroke,look:e.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||((m=e.flowchart)==null?void 0:m.curve)};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return ice.flowchart}},x(Yy,"FlowDB"),Yy),lyt=x(function(t,e){return e.db.getClasses()},"getClasses"),cyt=x(async function(t,e,r,n,i){var f;le.info("REF0:"),le.info("Drawing state diagram (v2)",e);const{securityLevel:a,flowchart:s,layout:o}=Fe();n.db.setDiagramId(e),le.debug("Before getData: ");const l=n.db.getData();le.debug("Data: ",l);const u=Ox(e,a),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=nS(o),l.layoutAlgorithm==="dagre"&&o==="elk"&&le.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),l.direction=h,l.nodeSpacing=(s==null?void 0:s.nodeSpacing)||50,l.rankSpacing=(s==null?void 0:s.rankSpacing)||50,l.markers=["point","circle","cross"],l.diagramId=e,le.debug("REF1:",l),await xx(l,u,i);const d=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;yr.insertTitle(u,"flowchartTitleText",(s==null?void 0:s.titleTopMargin)||0,n.db.getDiagramTitle()),mg(u,d,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),uyt={getClasses:lyt,draw:cyt},CP=(function(){var t=x(function(Or,yt,it,xt){for(it=it||{},xt=Or.length;xt--;it[Or[xt]]=yt);return it},"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],a=[2,2],s=[1,13],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,50],m=[1,49],y=[1,29],v=[1,30],T=[1,31],b=[1,32],w=[1,33],C=[1,45],S=[1,47],k=[1,43],E=[1,48],_=[1,44],M=[1,51],L=[1,46],P=[1,52],D=[1,53],R=[1,34],I=[1,35],$=[1,36],O=[1,37],N=[1,38],F=[1,58],z=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],V=[1,62],B=[1,61],G=[1,63],H=[8,9,11,75,77,78],q=[1,79],Z=[1,92],Y=[1,97],ie=[1,96],K=[1,93],Q=[1,89],te=[1,95],J=[1,91],ge=[1,98],ee=[1,94],Re=[1,99],Ie=[1,90],Be=[8,9,10,11,40,75,77,78],ce=[8,9,10,11,40,46,75,77,78],oe=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],be=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],fe=[44,60,89,102,105,106,109,111,114,115,116],Pe=[1,122],ve=[1,123],Ce=[1,125],Ve=[1,124],se=[44,60,62,74,89,102,105,106,109,111,114,115,116],de=[1,134],Te=[1,148],ae=[1,149],he=[1,150],W=[1,151],ne=[1,136],j=[1,138],ue=[1,142],X=[1,143],Oe=[1,144],xe=[1,145],Ge=[1,146],_e=[1,147],$e=[1,152],Me=[1,153],He=[1,132],De=[1,133],Ke=[1,140],Ae=[1,135],at=[1,139],Ee=[1,137],pt=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],ht=[1,155],rt=[1,157],Et=[8,9,11],vt=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],ot=[1,177],pe=[1,173],Ct=[1,174],lt=[1,178],st=[1,175],mt=[1,176],_r=[77,116,119],Se=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Ue=[10,106],tt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],kt=[1,248],Nt=[1,246],sr=[1,250],Qt=[1,244],vr=[1,245],nr=[1,247],Rr=[1,249],Zt=[1,251],gr=[1,269],Dr=[8,9,11,106],Qe=[8,9,10,11,60,84,105,106,109,110,111,112],ct={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:x(function(yt,it,xt,nt,Ht,ke,rn){var Ne=ke.length-1;switch(Ht){case 2:this.$=[];break;case 3:(!Array.isArray(ke[Ne])||ke[Ne].length>0)&&ke[Ne-1].push(ke[Ne]),this.$=ke[Ne-1];break;case 4:case 183:this.$=ke[Ne];break;case 11:nt.setDirection("TB"),this.$="TB";break;case 12:nt.setDirection(ke[Ne-1]),this.$=ke[Ne-1];break;case 27:this.$=ke[Ne-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=nt.addSubGraph(ke[Ne-6],ke[Ne-1],ke[Ne-4]);break;case 34:this.$=nt.addSubGraph(ke[Ne-3],ke[Ne-1],ke[Ne-3]);break;case 35:this.$=nt.addSubGraph(void 0,ke[Ne-1],void 0);break;case 37:this.$=ke[Ne].trim(),nt.setAccTitle(this.$);break;case 38:case 39:this.$=ke[Ne].trim(),nt.setAccDescription(this.$);break;case 43:this.$=ke[Ne-1]+ke[Ne];break;case 44:this.$=ke[Ne];break;case 45:nt.addVertex(ke[Ne-1][ke[Ne-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,ke[Ne]),nt.addLink(ke[Ne-3].stmt,ke[Ne-1],ke[Ne-2]),this.$={stmt:ke[Ne-1],nodes:ke[Ne-1].concat(ke[Ne-3].nodes)};break;case 46:nt.addLink(ke[Ne-2].stmt,ke[Ne],ke[Ne-1]),this.$={stmt:ke[Ne],nodes:ke[Ne].concat(ke[Ne-2].nodes)};break;case 47:nt.addLink(ke[Ne-3].stmt,ke[Ne-1],ke[Ne-2]),this.$={stmt:ke[Ne-1],nodes:ke[Ne-1].concat(ke[Ne-3].nodes)};break;case 48:this.$={stmt:ke[Ne-1],nodes:ke[Ne-1]};break;case 49:nt.addVertex(ke[Ne-1][ke[Ne-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,ke[Ne]),this.$={stmt:ke[Ne-1],nodes:ke[Ne-1],shapeData:ke[Ne]};break;case 50:this.$={stmt:ke[Ne],nodes:ke[Ne]};break;case 51:this.$=[ke[Ne]];break;case 52:nt.addVertex(ke[Ne-5][ke[Ne-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,ke[Ne-4]),this.$=ke[Ne-5].concat(ke[Ne]);break;case 53:this.$=ke[Ne-4].concat(ke[Ne]);break;case 54:this.$=ke[Ne];break;case 55:this.$=ke[Ne-2],nt.setClass(ke[Ne-2],ke[Ne]);break;case 56:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"square");break;case 57:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"doublecircle");break;case 58:this.$=ke[Ne-5],nt.addVertex(ke[Ne-5],ke[Ne-2],"circle");break;case 59:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"ellipse");break;case 60:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"stadium");break;case 61:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"subroutine");break;case 62:this.$=ke[Ne-7],nt.addVertex(ke[Ne-7],ke[Ne-1],"rect",void 0,void 0,void 0,Object.fromEntries([[ke[Ne-5],ke[Ne-3]]]));break;case 63:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"cylinder");break;case 64:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"round");break;case 65:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"diamond");break;case 66:this.$=ke[Ne-5],nt.addVertex(ke[Ne-5],ke[Ne-2],"hexagon");break;case 67:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"odd");break;case 68:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"trapezoid");break;case 69:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"inv_trapezoid");break;case 70:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"lean_right");break;case 71:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"lean_left");break;case 72:this.$=ke[Ne],nt.addVertex(ke[Ne]);break;case 73:ke[Ne-1].text=ke[Ne],this.$=ke[Ne-1];break;case 74:case 75:ke[Ne-2].text=ke[Ne-1],this.$=ke[Ne-2];break;case 76:this.$=ke[Ne];break;case 77:var Mr=nt.destructLink(ke[Ne],ke[Ne-2]);this.$={type:Mr.type,stroke:Mr.stroke,length:Mr.length,text:ke[Ne-1]};break;case 78:var Mr=nt.destructLink(ke[Ne],ke[Ne-2]);this.$={type:Mr.type,stroke:Mr.stroke,length:Mr.length,text:ke[Ne-1],id:ke[Ne-3]};break;case 79:this.$={text:ke[Ne],type:"text"};break;case 80:this.$={text:ke[Ne-1].text+""+ke[Ne],type:ke[Ne-1].type};break;case 81:this.$={text:ke[Ne],type:"string"};break;case 82:this.$={text:ke[Ne],type:"markdown"};break;case 83:var Mr=nt.destructLink(ke[Ne]);this.$={type:Mr.type,stroke:Mr.stroke,length:Mr.length};break;case 84:var Mr=nt.destructLink(ke[Ne]);this.$={type:Mr.type,stroke:Mr.stroke,length:Mr.length,id:ke[Ne-1]};break;case 85:this.$=ke[Ne-1];break;case 86:this.$={text:ke[Ne],type:"text"};break;case 87:this.$={text:ke[Ne-1].text+""+ke[Ne],type:ke[Ne-1].type};break;case 88:this.$={text:ke[Ne],type:"string"};break;case 89:case 104:this.$={text:ke[Ne],type:"markdown"};break;case 101:this.$={text:ke[Ne],type:"text"};break;case 102:this.$={text:ke[Ne-1].text+""+ke[Ne],type:ke[Ne-1].type};break;case 103:this.$={text:ke[Ne],type:"text"};break;case 105:this.$=ke[Ne-4],nt.addClass(ke[Ne-2],ke[Ne]);break;case 106:this.$=ke[Ne-4],nt.setClass(ke[Ne-2],ke[Ne]);break;case 107:case 115:this.$=ke[Ne-1],nt.setClickEvent(ke[Ne-1],ke[Ne]);break;case 108:case 116:this.$=ke[Ne-3],nt.setClickEvent(ke[Ne-3],ke[Ne-2]),nt.setTooltip(ke[Ne-3],ke[Ne]);break;case 109:this.$=ke[Ne-2],nt.setClickEvent(ke[Ne-2],ke[Ne-1],ke[Ne]);break;case 110:this.$=ke[Ne-4],nt.setClickEvent(ke[Ne-4],ke[Ne-3],ke[Ne-2]),nt.setTooltip(ke[Ne-4],ke[Ne]);break;case 111:this.$=ke[Ne-2],nt.setLink(ke[Ne-2],ke[Ne]);break;case 112:this.$=ke[Ne-4],nt.setLink(ke[Ne-4],ke[Ne-2]),nt.setTooltip(ke[Ne-4],ke[Ne]);break;case 113:this.$=ke[Ne-4],nt.setLink(ke[Ne-4],ke[Ne-2],ke[Ne]);break;case 114:this.$=ke[Ne-6],nt.setLink(ke[Ne-6],ke[Ne-4],ke[Ne]),nt.setTooltip(ke[Ne-6],ke[Ne-2]);break;case 117:this.$=ke[Ne-1],nt.setLink(ke[Ne-1],ke[Ne]);break;case 118:this.$=ke[Ne-3],nt.setLink(ke[Ne-3],ke[Ne-2]),nt.setTooltip(ke[Ne-3],ke[Ne]);break;case 119:this.$=ke[Ne-3],nt.setLink(ke[Ne-3],ke[Ne-2],ke[Ne]);break;case 120:this.$=ke[Ne-5],nt.setLink(ke[Ne-5],ke[Ne-4],ke[Ne]),nt.setTooltip(ke[Ne-5],ke[Ne-2]);break;case 121:this.$=ke[Ne-4],nt.addVertex(ke[Ne-2],void 0,void 0,ke[Ne]);break;case 122:this.$=ke[Ne-4],nt.updateLink([ke[Ne-2]],ke[Ne]);break;case 123:this.$=ke[Ne-4],nt.updateLink(ke[Ne-2],ke[Ne]);break;case 124:this.$=ke[Ne-8],nt.updateLinkInterpolate([ke[Ne-6]],ke[Ne-2]),nt.updateLink([ke[Ne-6]],ke[Ne]);break;case 125:this.$=ke[Ne-8],nt.updateLinkInterpolate(ke[Ne-6],ke[Ne-2]),nt.updateLink(ke[Ne-6],ke[Ne]);break;case 126:this.$=ke[Ne-6],nt.updateLinkInterpolate([ke[Ne-4]],ke[Ne]);break;case 127:this.$=ke[Ne-6],nt.updateLinkInterpolate(ke[Ne-4],ke[Ne]);break;case 128:case 130:this.$=[ke[Ne]];break;case 129:case 131:ke[Ne-2].push(ke[Ne]),this.$=ke[Ne-2];break;case 133:this.$=ke[Ne-1]+ke[Ne];break;case 181:this.$=ke[Ne];break;case 182:this.$=ke[Ne-1]+""+ke[Ne];break;case 184:this.$=ke[Ne-1]+""+ke[Ne];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D,121:R,122:I,123:$,124:O,125:N},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:F,15:54,18:57},t(z,[2,3]),t(z,[2,4]),t(z,[2,5]),t(z,[2,6]),t(z,[2,7]),t(z,[2,8]),{8:V,9:B,11:G,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:V,9:B,11:G,21:68},{8:V,9:B,11:G,21:69},{8:V,9:B,11:G,21:70},{8:V,9:B,11:G,21:71},{8:V,9:B,11:G,21:72},{8:V,9:B,10:[1,73],11:G,21:74},t(z,[2,36]),{35:[1,75]},{37:[1,76]},t(z,[2,39]),t(H,[2,50],{18:77,39:78,10:F,40:q}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:Z,44:Y,60:ie,80:[1,87],89:K,95:[1,84],97:[1,85],101:86,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie,120:88},t(z,[2,185]),t(z,[2,186]),t(z,[2,187]),t(z,[2,188]),t(z,[2,189]),t(Be,[2,51]),t(Be,[2,54],{46:[1,100]}),t(ce,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:C,102:S,105:k,106:E,109:_,111:M,114:L,115:P,116:D}),t(oe,[2,181]),t(oe,[2,142]),t(oe,[2,143]),t(oe,[2,144]),t(oe,[2,145]),t(oe,[2,146]),t(oe,[2,147]),t(oe,[2,148]),t(oe,[2,149]),t(oe,[2,150]),t(oe,[2,151]),t(oe,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(be,[2,26],{18:115,10:F}),t(z,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},t(z,[2,40]),t(z,[2,41]),t(z,[2,42]),t(fe,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Pe,81:ve,116:Ce,119:Ve},{75:[1,126],77:[1,127]},t(se,[2,83]),t(z,[2,28]),t(z,[2,29]),t(z,[2,30]),t(z,[2,31]),t(z,[2,32]),{10:de,12:Te,14:ae,27:he,28:128,32:W,44:ne,60:j,75:ue,80:[1,130],81:[1,131],83:141,84:X,85:Oe,86:xe,87:Ge,88:_e,89:$e,90:Me,91:129,105:He,109:De,111:Ke,114:Ae,115:at,116:Ee},t(pt,a,{5:154}),t(z,[2,37]),t(z,[2,38]),t(H,[2,48],{44:ht}),t(H,[2,49],{18:156,10:F,40:rt}),t(Be,[2,44]),{44:g,47:158,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},{44:g,47:163,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},t(Et,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Et,[2,115],{120:168,10:[1,167],14:Z,44:Y,60:ie,89:K,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie}),t(Et,[2,117],{10:[1,169]}),t(vt,[2,183]),t(vt,[2,170]),t(vt,[2,171]),t(vt,[2,172]),t(vt,[2,173]),t(vt,[2,174]),t(vt,[2,175]),t(vt,[2,176]),t(vt,[2,177]),t(vt,[2,178]),t(vt,[2,179]),t(vt,[2,180]),{44:g,47:170,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},{30:171,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:179,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:181,50:[1,180],67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:182,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:183,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:184,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{109:[1,185]},{30:186,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:187,65:[1,188],67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:189,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:190,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:191,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},t(oe,[2,182]),t(i,[2,20]),t(be,[2,25]),t(H,[2,46],{39:192,18:193,10:F,40:q}),t(fe,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{77:[1,197],79:198,116:Ce,119:Ve},t(_r,[2,79]),t(_r,[2,81]),t(_r,[2,82]),t(_r,[2,168]),t(_r,[2,169]),{76:199,79:121,80:Pe,81:ve,116:Ce,119:Ve},t(se,[2,84]),{8:V,9:B,10:de,11:G,12:Te,14:ae,21:201,27:he,29:[1,200],32:W,44:ne,60:j,75:ue,83:141,84:X,85:Oe,86:xe,87:Ge,88:_e,89:$e,90:Me,91:202,105:He,109:De,111:Ke,114:Ae,115:at,116:Ee},t(Se,[2,101]),t(Se,[2,103]),t(Se,[2,104]),t(Se,[2,157]),t(Se,[2,158]),t(Se,[2,159]),t(Se,[2,160]),t(Se,[2,161]),t(Se,[2,162]),t(Se,[2,163]),t(Se,[2,164]),t(Se,[2,165]),t(Se,[2,166]),t(Se,[2,167]),t(Se,[2,90]),t(Se,[2,91]),t(Se,[2,92]),t(Se,[2,93]),t(Se,[2,94]),t(Se,[2,95]),t(Se,[2,96]),t(Se,[2,97]),t(Se,[2,98]),t(Se,[2,99]),t(Se,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,203],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D,121:R,122:I,123:$,124:O,125:N},{10:F,18:204},{44:[1,205]},t(Be,[2,43]),{10:[1,206],44:g,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:113,114:L,115:P,116:D},{10:[1,207]},{10:[1,208],106:[1,209]},t(Ue,[2,128]),{10:[1,210],44:g,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:113,114:L,115:P,116:D},{10:[1,211],44:g,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:113,114:L,115:P,116:D},{80:[1,212]},t(Et,[2,109],{10:[1,213]}),t(Et,[2,111],{10:[1,214]}),{80:[1,215]},t(vt,[2,184]),{80:[1,216],98:[1,217]},t(Be,[2,55],{113:113,44:g,60:m,89:C,102:S,105:k,106:E,109:_,111:M,114:L,115:P,116:D}),{31:[1,218],67:ot,82:219,116:lt,117:st,118:mt},t(tt,[2,86]),t(tt,[2,88]),t(tt,[2,89]),t(tt,[2,153]),t(tt,[2,154]),t(tt,[2,155]),t(tt,[2,156]),{49:[1,220],67:ot,82:219,116:lt,117:st,118:mt},{30:221,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{51:[1,222],67:ot,82:219,116:lt,117:st,118:mt},{53:[1,223],67:ot,82:219,116:lt,117:st,118:mt},{55:[1,224],67:ot,82:219,116:lt,117:st,118:mt},{57:[1,225],67:ot,82:219,116:lt,117:st,118:mt},{60:[1,226]},{64:[1,227],67:ot,82:219,116:lt,117:st,118:mt},{66:[1,228],67:ot,82:219,116:lt,117:st,118:mt},{30:229,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{31:[1,230],67:ot,82:219,116:lt,117:st,118:mt},{67:ot,69:[1,231],71:[1,232],82:219,116:lt,117:st,118:mt},{67:ot,69:[1,234],71:[1,233],82:219,116:lt,117:st,118:mt},t(H,[2,45],{18:156,10:F,40:rt}),t(H,[2,47],{44:ht}),t(fe,[2,75]),t(fe,[2,74]),{62:[1,235],67:ot,82:219,116:lt,117:st,118:mt},t(fe,[2,77]),t(_r,[2,80]),{77:[1,236],79:198,116:Ce,119:Ve},{30:237,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},t(pt,a,{5:238}),t(Se,[2,102]),t(z,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},{10:F,18:240},{10:kt,60:Nt,84:sr,92:241,105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},{10:kt,60:Nt,84:sr,92:252,104:[1,253],105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},{10:kt,60:Nt,84:sr,92:254,104:[1,255],105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},{105:[1,256]},{10:kt,60:Nt,84:sr,92:257,105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},{44:g,47:258,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},t(Et,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Et,[2,116]),t(Et,[2,118],{10:[1,262]}),t(Et,[2,119]),t(ce,[2,56]),t(tt,[2,87]),t(ce,[2,57]),{51:[1,263],67:ot,82:219,116:lt,117:st,118:mt},t(ce,[2,64]),t(ce,[2,59]),t(ce,[2,60]),t(ce,[2,61]),{109:[1,264]},t(ce,[2,63]),t(ce,[2,65]),{66:[1,265],67:ot,82:219,116:lt,117:st,118:mt},t(ce,[2,67]),t(ce,[2,68]),t(ce,[2,70]),t(ce,[2,69]),t(ce,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(fe,[2,78]),{31:[1,266],67:ot,82:219,116:lt,117:st,118:mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,267],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D,121:R,122:I,123:$,124:O,125:N},t(Be,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},t(Et,[2,121],{106:gr}),t(Dr,[2,130],{108:270,10:kt,60:Nt,84:sr,105:Qt,109:vr,110:nr,111:Rr,112:Zt}),t(Qe,[2,132]),t(Qe,[2,134]),t(Qe,[2,135]),t(Qe,[2,136]),t(Qe,[2,137]),t(Qe,[2,138]),t(Qe,[2,139]),t(Qe,[2,140]),t(Qe,[2,141]),t(Et,[2,122],{106:gr}),{10:[1,271]},t(Et,[2,123],{106:gr}),{10:[1,272]},t(Ue,[2,129]),t(Et,[2,105],{106:gr}),t(Et,[2,106],{113:113,44:g,60:m,89:C,102:S,105:k,106:E,109:_,111:M,114:L,115:P,116:D}),t(Et,[2,110]),t(Et,[2,112],{10:[1,273]}),t(Et,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:V,9:B,11:G,21:278},t(z,[2,34]),t(Be,[2,52]),{10:kt,60:Nt,84:sr,105:Qt,107:279,108:243,109:vr,110:nr,111:Rr,112:Zt},t(Qe,[2,133]),{14:Z,44:Y,60:ie,89:K,101:280,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie,120:88},{14:Z,44:Y,60:ie,89:K,101:281,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie,120:88},{98:[1,282]},t(Et,[2,120]),t(ce,[2,58]),{30:283,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},t(ce,[2,66]),t(pt,a,{5:284}),t(Dr,[2,131],{108:270,10:kt,60:Nt,84:sr,105:Qt,109:vr,110:nr,111:Rr,112:Zt}),t(Et,[2,126],{120:168,10:[1,285],14:Z,44:Y,60:ie,89:K,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie}),t(Et,[2,127],{120:168,10:[1,286],14:Z,44:Y,60:ie,89:K,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie}),t(Et,[2,114]),{31:[1,287],67:ot,82:219,116:lt,117:st,118:mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,288],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D,121:R,122:I,123:$,124:O,125:N},{10:kt,60:Nt,84:sr,92:289,105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},{10:kt,60:Nt,84:sr,92:290,105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},t(ce,[2,62]),t(z,[2,33]),t(Et,[2,124],{106:gr}),t(Et,[2,125],{106:gr})],defaultActions:{},parseError:x(function(yt,it){if(it.recoverable)this.trace(yt);else{var xt=new Error(yt);throw xt.hash=it,xt}},"parseError"),parse:x(function(yt){var it=this,xt=[0],nt=[],Ht=[null],ke=[],rn=this.table,Ne="",Mr=0,nn=0,Bi=2,Qr=1,bn=ke.slice.call(arguments,1),Yr=Object.create(this.lexer),Da={yy:{}};for(var gc in this.yy)Object.prototype.hasOwnProperty.call(this.yy,gc)&&(Da.yy[gc]=this.yy[gc]);Yr.setInput(yt,Da.yy),Da.yy.lexer=Yr,Da.yy.parser=this,typeof Yr.yylloc>"u"&&(Yr.yylloc={});var xu=Yr.yylloc;ke.push(xu);var Vf=Yr.options&&Yr.options.ranges;typeof Da.yy.parseError=="function"?this.parseError=Da.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Tu(_n){xt.length=xt.length-2*_n,Ht.length=Ht.length-_n,ke.length=ke.length-_n}x(Tu,"popStack");function wu(){var _n;return _n=nt.pop()||Yr.lex()||Qr,typeof _n!="number"&&(_n instanceof Array&&(nt=_n,_n=nt.pop()),_n=it.symbols_[_n]||_n),_n}x(wu,"lex");for(var wt,Le,je,dt,Ft={},er,ur,gn,An;;){if(Le=xt[xt.length-1],this.defaultActions[Le]?je=this.defaultActions[Le]:((wt===null||typeof wt>"u")&&(wt=wu()),je=rn[Le]&&rn[Le][wt]),typeof je>"u"||!je.length||!je[0]){var da="";An=[];for(er in rn[Le])this.terminals_[er]&&er>Bi&&An.push("'"+this.terminals_[er]+"'");Yr.showPosition?da="Parse error on line "+(Mr+1)+`: +You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;le.info("addLink",e,r,i);for(const a of e)for(const s of r){const o=a===e[e.length-1],l=s===r[0];o&&l?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,a,s,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((a=(i=this.edges[n])==null?void 0:i.style)==null?void 0:a.length)??0)>0&&!((o=(s=this.edges[n])==null?void 0:s.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n!=null&&n.forEach(s=>{if(/color/.exec(s)){const o=s.replace("fill","bgFill");a.textStyles.push(o)}a.styles.push(s)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const a=this.edges.find(o=>o.id===n);a&&a.classes.push(r);const s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){if(Fe().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{const s=this.lookUpDomId(e),o=document.querySelector(`[id="${s}"]`);o!==null&&o.addEventListener("click",()=>{yr.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=yr.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const r=fW();ut(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=ut(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(ph.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),ut(a.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=Fe(),$n()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const o=x(g=>{const m={boolean:{},number:{},string:{}},y=[];let v;return{nodeList:g.filter(function(b){const w=typeof b;return b.stmt&&b.stmt==="dir"?(v=b.value,!1):b.trim()===""?!1:w in m?m[w].hasOwnProperty(b)?!1:m[w][b]=!0:y.includes(b)?!1:y.push(b)}),dir:v}},"uniq")(r.flat()),l=o.nodeList,u=o.dir,h=u!==void 0,d=Fe().flowchart??{},f=u??(d.inheritDir?this.getDirection()??Fe().direction??void 0:void 0);if(this.version==="gen-1")for(let g=0;g2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,a=1;for(;i=0){const o=this.indexNodes2(e,s);if(o.result)return{result:!0,count:a+o.count};a=a+o.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let a=0;a":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const o=this.countChar(".",n);return o&&(a="dotted",s=o),{type:i,stroke:a,length:s}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(e.nodes[a])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,a,s){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:((h=a.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){const e=Fe(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&s.set(h.id,!0);for(const d of h.nodes)a.set(d,h.id)}for(let u=i.length-1;u>=0;u--){const h=i[u];r.push({id:h.id,label:h.title,labelStyle:"",labelType:h.labelType,parentId:a.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir==="TD"?"TB":h.dir,explicitDir:h.hasExplicitDir,isGroup:!0,look:e.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,a,s,e,e.look||"classic")});const l=this.getEdges();return l.forEach((u,h)=>{var m;const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:dy(u.start,u.end,{counter:h,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelType:u.labelType,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:(u==null?void 0:u.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":d,arrowTypeEnd:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:p,style:p,pattern:u.stroke,look:e.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||((m=e.flowchart)==null?void 0:m.curve)};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return ace.flowchart}},x(Yy,"FlowDB"),Yy),hyt=x(function(t,e){return e.db.getClasses()},"getClasses"),dyt=x(async function(t,e,r,n,i){var f;le.info("REF0:"),le.info("Drawing state diagram (v2)",e);const{securityLevel:a,flowchart:s,layout:o}=Fe();n.db.setDiagramId(e),le.debug("Before getData: ");const l=n.db.getData();le.debug("Data: ",l);const u=Ox(e,a),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=nS(o),l.layoutAlgorithm==="dagre"&&o==="elk"&&le.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),l.direction=h,l.nodeSpacing=(s==null?void 0:s.nodeSpacing)||50,l.rankSpacing=(s==null?void 0:s.rankSpacing)||50,l.markers=["point","circle","cross"],l.diagramId=e,le.debug("REF1:",l),await xx(l,u,i);const d=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;yr.insertTitle(u,"flowchartTitleText",(s==null?void 0:s.titleTopMargin)||0,n.db.getDiagramTitle()),mg(u,d,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),fyt={getClasses:hyt,draw:dyt},CP=(function(){var t=x(function(Or,yt,it,xt){for(it=it||{},xt=Or.length;xt--;it[Or[xt]]=yt);return it},"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],a=[2,2],s=[1,13],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,50],m=[1,49],y=[1,29],v=[1,30],T=[1,31],b=[1,32],w=[1,33],C=[1,45],S=[1,47],k=[1,43],E=[1,48],_=[1,44],M=[1,51],L=[1,46],P=[1,52],D=[1,53],R=[1,34],I=[1,35],$=[1,36],O=[1,37],N=[1,38],F=[1,58],z=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],V=[1,62],B=[1,61],G=[1,63],H=[8,9,11,75,77,78],q=[1,79],Z=[1,92],Y=[1,97],ie=[1,96],K=[1,93],Q=[1,89],te=[1,95],J=[1,91],ge=[1,98],ee=[1,94],Re=[1,99],Ie=[1,90],Be=[8,9,10,11,40,75,77,78],ce=[8,9,10,11,40,46,75,77,78],oe=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],be=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],fe=[44,60,89,102,105,106,109,111,114,115,116],Pe=[1,122],ve=[1,123],Ce=[1,125],Ve=[1,124],se=[44,60,62,74,89,102,105,106,109,111,114,115,116],de=[1,134],Te=[1,148],ae=[1,149],he=[1,150],W=[1,151],ne=[1,136],j=[1,138],ue=[1,142],X=[1,143],Oe=[1,144],xe=[1,145],Ge=[1,146],_e=[1,147],$e=[1,152],Me=[1,153],He=[1,132],De=[1,133],Ke=[1,140],Ae=[1,135],at=[1,139],Ee=[1,137],pt=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],ht=[1,155],rt=[1,157],Et=[8,9,11],vt=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],ot=[1,177],pe=[1,173],Ct=[1,174],lt=[1,178],st=[1,175],mt=[1,176],_r=[77,116,119],Se=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Ue=[10,106],tt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],kt=[1,248],Nt=[1,246],sr=[1,250],Qt=[1,244],vr=[1,245],nr=[1,247],Rr=[1,249],Zt=[1,251],gr=[1,269],Dr=[8,9,11,106],Qe=[8,9,10,11,60,84,105,106,109,110,111,112],ct={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:x(function(yt,it,xt,nt,Ht,ke,rn){var Ne=ke.length-1;switch(Ht){case 2:this.$=[];break;case 3:(!Array.isArray(ke[Ne])||ke[Ne].length>0)&&ke[Ne-1].push(ke[Ne]),this.$=ke[Ne-1];break;case 4:case 183:this.$=ke[Ne];break;case 11:nt.setDirection("TB"),this.$="TB";break;case 12:nt.setDirection(ke[Ne-1]),this.$=ke[Ne-1];break;case 27:this.$=ke[Ne-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=nt.addSubGraph(ke[Ne-6],ke[Ne-1],ke[Ne-4]);break;case 34:this.$=nt.addSubGraph(ke[Ne-3],ke[Ne-1],ke[Ne-3]);break;case 35:this.$=nt.addSubGraph(void 0,ke[Ne-1],void 0);break;case 37:this.$=ke[Ne].trim(),nt.setAccTitle(this.$);break;case 38:case 39:this.$=ke[Ne].trim(),nt.setAccDescription(this.$);break;case 43:this.$=ke[Ne-1]+ke[Ne];break;case 44:this.$=ke[Ne];break;case 45:nt.addVertex(ke[Ne-1][ke[Ne-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,ke[Ne]),nt.addLink(ke[Ne-3].stmt,ke[Ne-1],ke[Ne-2]),this.$={stmt:ke[Ne-1],nodes:ke[Ne-1].concat(ke[Ne-3].nodes)};break;case 46:nt.addLink(ke[Ne-2].stmt,ke[Ne],ke[Ne-1]),this.$={stmt:ke[Ne],nodes:ke[Ne].concat(ke[Ne-2].nodes)};break;case 47:nt.addLink(ke[Ne-3].stmt,ke[Ne-1],ke[Ne-2]),this.$={stmt:ke[Ne-1],nodes:ke[Ne-1].concat(ke[Ne-3].nodes)};break;case 48:this.$={stmt:ke[Ne-1],nodes:ke[Ne-1]};break;case 49:nt.addVertex(ke[Ne-1][ke[Ne-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,ke[Ne]),this.$={stmt:ke[Ne-1],nodes:ke[Ne-1],shapeData:ke[Ne]};break;case 50:this.$={stmt:ke[Ne],nodes:ke[Ne]};break;case 51:this.$=[ke[Ne]];break;case 52:nt.addVertex(ke[Ne-5][ke[Ne-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,ke[Ne-4]),this.$=ke[Ne-5].concat(ke[Ne]);break;case 53:this.$=ke[Ne-4].concat(ke[Ne]);break;case 54:this.$=ke[Ne];break;case 55:this.$=ke[Ne-2],nt.setClass(ke[Ne-2],ke[Ne]);break;case 56:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"square");break;case 57:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"doublecircle");break;case 58:this.$=ke[Ne-5],nt.addVertex(ke[Ne-5],ke[Ne-2],"circle");break;case 59:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"ellipse");break;case 60:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"stadium");break;case 61:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"subroutine");break;case 62:this.$=ke[Ne-7],nt.addVertex(ke[Ne-7],ke[Ne-1],"rect",void 0,void 0,void 0,Object.fromEntries([[ke[Ne-5],ke[Ne-3]]]));break;case 63:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"cylinder");break;case 64:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"round");break;case 65:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"diamond");break;case 66:this.$=ke[Ne-5],nt.addVertex(ke[Ne-5],ke[Ne-2],"hexagon");break;case 67:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"odd");break;case 68:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"trapezoid");break;case 69:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"inv_trapezoid");break;case 70:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"lean_right");break;case 71:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"lean_left");break;case 72:this.$=ke[Ne],nt.addVertex(ke[Ne]);break;case 73:ke[Ne-1].text=ke[Ne],this.$=ke[Ne-1];break;case 74:case 75:ke[Ne-2].text=ke[Ne-1],this.$=ke[Ne-2];break;case 76:this.$=ke[Ne];break;case 77:var Mr=nt.destructLink(ke[Ne],ke[Ne-2]);this.$={type:Mr.type,stroke:Mr.stroke,length:Mr.length,text:ke[Ne-1]};break;case 78:var Mr=nt.destructLink(ke[Ne],ke[Ne-2]);this.$={type:Mr.type,stroke:Mr.stroke,length:Mr.length,text:ke[Ne-1],id:ke[Ne-3]};break;case 79:this.$={text:ke[Ne],type:"text"};break;case 80:this.$={text:ke[Ne-1].text+""+ke[Ne],type:ke[Ne-1].type};break;case 81:this.$={text:ke[Ne],type:"string"};break;case 82:this.$={text:ke[Ne],type:"markdown"};break;case 83:var Mr=nt.destructLink(ke[Ne]);this.$={type:Mr.type,stroke:Mr.stroke,length:Mr.length};break;case 84:var Mr=nt.destructLink(ke[Ne]);this.$={type:Mr.type,stroke:Mr.stroke,length:Mr.length,id:ke[Ne-1]};break;case 85:this.$=ke[Ne-1];break;case 86:this.$={text:ke[Ne],type:"text"};break;case 87:this.$={text:ke[Ne-1].text+""+ke[Ne],type:ke[Ne-1].type};break;case 88:this.$={text:ke[Ne],type:"string"};break;case 89:case 104:this.$={text:ke[Ne],type:"markdown"};break;case 101:this.$={text:ke[Ne],type:"text"};break;case 102:this.$={text:ke[Ne-1].text+""+ke[Ne],type:ke[Ne-1].type};break;case 103:this.$={text:ke[Ne],type:"text"};break;case 105:this.$=ke[Ne-4],nt.addClass(ke[Ne-2],ke[Ne]);break;case 106:this.$=ke[Ne-4],nt.setClass(ke[Ne-2],ke[Ne]);break;case 107:case 115:this.$=ke[Ne-1],nt.setClickEvent(ke[Ne-1],ke[Ne]);break;case 108:case 116:this.$=ke[Ne-3],nt.setClickEvent(ke[Ne-3],ke[Ne-2]),nt.setTooltip(ke[Ne-3],ke[Ne]);break;case 109:this.$=ke[Ne-2],nt.setClickEvent(ke[Ne-2],ke[Ne-1],ke[Ne]);break;case 110:this.$=ke[Ne-4],nt.setClickEvent(ke[Ne-4],ke[Ne-3],ke[Ne-2]),nt.setTooltip(ke[Ne-4],ke[Ne]);break;case 111:this.$=ke[Ne-2],nt.setLink(ke[Ne-2],ke[Ne]);break;case 112:this.$=ke[Ne-4],nt.setLink(ke[Ne-4],ke[Ne-2]),nt.setTooltip(ke[Ne-4],ke[Ne]);break;case 113:this.$=ke[Ne-4],nt.setLink(ke[Ne-4],ke[Ne-2],ke[Ne]);break;case 114:this.$=ke[Ne-6],nt.setLink(ke[Ne-6],ke[Ne-4],ke[Ne]),nt.setTooltip(ke[Ne-6],ke[Ne-2]);break;case 117:this.$=ke[Ne-1],nt.setLink(ke[Ne-1],ke[Ne]);break;case 118:this.$=ke[Ne-3],nt.setLink(ke[Ne-3],ke[Ne-2]),nt.setTooltip(ke[Ne-3],ke[Ne]);break;case 119:this.$=ke[Ne-3],nt.setLink(ke[Ne-3],ke[Ne-2],ke[Ne]);break;case 120:this.$=ke[Ne-5],nt.setLink(ke[Ne-5],ke[Ne-4],ke[Ne]),nt.setTooltip(ke[Ne-5],ke[Ne-2]);break;case 121:this.$=ke[Ne-4],nt.addVertex(ke[Ne-2],void 0,void 0,ke[Ne]);break;case 122:this.$=ke[Ne-4],nt.updateLink([ke[Ne-2]],ke[Ne]);break;case 123:this.$=ke[Ne-4],nt.updateLink(ke[Ne-2],ke[Ne]);break;case 124:this.$=ke[Ne-8],nt.updateLinkInterpolate([ke[Ne-6]],ke[Ne-2]),nt.updateLink([ke[Ne-6]],ke[Ne]);break;case 125:this.$=ke[Ne-8],nt.updateLinkInterpolate(ke[Ne-6],ke[Ne-2]),nt.updateLink(ke[Ne-6],ke[Ne]);break;case 126:this.$=ke[Ne-6],nt.updateLinkInterpolate([ke[Ne-4]],ke[Ne]);break;case 127:this.$=ke[Ne-6],nt.updateLinkInterpolate(ke[Ne-4],ke[Ne]);break;case 128:case 130:this.$=[ke[Ne]];break;case 129:case 131:ke[Ne-2].push(ke[Ne]),this.$=ke[Ne-2];break;case 133:this.$=ke[Ne-1]+ke[Ne];break;case 181:this.$=ke[Ne];break;case 182:this.$=ke[Ne-1]+""+ke[Ne];break;case 184:this.$=ke[Ne-1]+""+ke[Ne];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D,121:R,122:I,123:$,124:O,125:N},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:F,15:54,18:57},t(z,[2,3]),t(z,[2,4]),t(z,[2,5]),t(z,[2,6]),t(z,[2,7]),t(z,[2,8]),{8:V,9:B,11:G,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:V,9:B,11:G,21:68},{8:V,9:B,11:G,21:69},{8:V,9:B,11:G,21:70},{8:V,9:B,11:G,21:71},{8:V,9:B,11:G,21:72},{8:V,9:B,10:[1,73],11:G,21:74},t(z,[2,36]),{35:[1,75]},{37:[1,76]},t(z,[2,39]),t(H,[2,50],{18:77,39:78,10:F,40:q}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:Z,44:Y,60:ie,80:[1,87],89:K,95:[1,84],97:[1,85],101:86,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie,120:88},t(z,[2,185]),t(z,[2,186]),t(z,[2,187]),t(z,[2,188]),t(z,[2,189]),t(Be,[2,51]),t(Be,[2,54],{46:[1,100]}),t(ce,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:C,102:S,105:k,106:E,109:_,111:M,114:L,115:P,116:D}),t(oe,[2,181]),t(oe,[2,142]),t(oe,[2,143]),t(oe,[2,144]),t(oe,[2,145]),t(oe,[2,146]),t(oe,[2,147]),t(oe,[2,148]),t(oe,[2,149]),t(oe,[2,150]),t(oe,[2,151]),t(oe,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(be,[2,26],{18:115,10:F}),t(z,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},t(z,[2,40]),t(z,[2,41]),t(z,[2,42]),t(fe,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Pe,81:ve,116:Ce,119:Ve},{75:[1,126],77:[1,127]},t(se,[2,83]),t(z,[2,28]),t(z,[2,29]),t(z,[2,30]),t(z,[2,31]),t(z,[2,32]),{10:de,12:Te,14:ae,27:he,28:128,32:W,44:ne,60:j,75:ue,80:[1,130],81:[1,131],83:141,84:X,85:Oe,86:xe,87:Ge,88:_e,89:$e,90:Me,91:129,105:He,109:De,111:Ke,114:Ae,115:at,116:Ee},t(pt,a,{5:154}),t(z,[2,37]),t(z,[2,38]),t(H,[2,48],{44:ht}),t(H,[2,49],{18:156,10:F,40:rt}),t(Be,[2,44]),{44:g,47:158,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},{44:g,47:163,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},t(Et,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Et,[2,115],{120:168,10:[1,167],14:Z,44:Y,60:ie,89:K,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie}),t(Et,[2,117],{10:[1,169]}),t(vt,[2,183]),t(vt,[2,170]),t(vt,[2,171]),t(vt,[2,172]),t(vt,[2,173]),t(vt,[2,174]),t(vt,[2,175]),t(vt,[2,176]),t(vt,[2,177]),t(vt,[2,178]),t(vt,[2,179]),t(vt,[2,180]),{44:g,47:170,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},{30:171,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:179,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:181,50:[1,180],67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:182,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:183,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:184,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{109:[1,185]},{30:186,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:187,65:[1,188],67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:189,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:190,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:191,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},t(oe,[2,182]),t(i,[2,20]),t(be,[2,25]),t(H,[2,46],{39:192,18:193,10:F,40:q}),t(fe,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{77:[1,197],79:198,116:Ce,119:Ve},t(_r,[2,79]),t(_r,[2,81]),t(_r,[2,82]),t(_r,[2,168]),t(_r,[2,169]),{76:199,79:121,80:Pe,81:ve,116:Ce,119:Ve},t(se,[2,84]),{8:V,9:B,10:de,11:G,12:Te,14:ae,21:201,27:he,29:[1,200],32:W,44:ne,60:j,75:ue,83:141,84:X,85:Oe,86:xe,87:Ge,88:_e,89:$e,90:Me,91:202,105:He,109:De,111:Ke,114:Ae,115:at,116:Ee},t(Se,[2,101]),t(Se,[2,103]),t(Se,[2,104]),t(Se,[2,157]),t(Se,[2,158]),t(Se,[2,159]),t(Se,[2,160]),t(Se,[2,161]),t(Se,[2,162]),t(Se,[2,163]),t(Se,[2,164]),t(Se,[2,165]),t(Se,[2,166]),t(Se,[2,167]),t(Se,[2,90]),t(Se,[2,91]),t(Se,[2,92]),t(Se,[2,93]),t(Se,[2,94]),t(Se,[2,95]),t(Se,[2,96]),t(Se,[2,97]),t(Se,[2,98]),t(Se,[2,99]),t(Se,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,203],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D,121:R,122:I,123:$,124:O,125:N},{10:F,18:204},{44:[1,205]},t(Be,[2,43]),{10:[1,206],44:g,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:113,114:L,115:P,116:D},{10:[1,207]},{10:[1,208],106:[1,209]},t(Ue,[2,128]),{10:[1,210],44:g,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:113,114:L,115:P,116:D},{10:[1,211],44:g,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:113,114:L,115:P,116:D},{80:[1,212]},t(Et,[2,109],{10:[1,213]}),t(Et,[2,111],{10:[1,214]}),{80:[1,215]},t(vt,[2,184]),{80:[1,216],98:[1,217]},t(Be,[2,55],{113:113,44:g,60:m,89:C,102:S,105:k,106:E,109:_,111:M,114:L,115:P,116:D}),{31:[1,218],67:ot,82:219,116:lt,117:st,118:mt},t(tt,[2,86]),t(tt,[2,88]),t(tt,[2,89]),t(tt,[2,153]),t(tt,[2,154]),t(tt,[2,155]),t(tt,[2,156]),{49:[1,220],67:ot,82:219,116:lt,117:st,118:mt},{30:221,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{51:[1,222],67:ot,82:219,116:lt,117:st,118:mt},{53:[1,223],67:ot,82:219,116:lt,117:st,118:mt},{55:[1,224],67:ot,82:219,116:lt,117:st,118:mt},{57:[1,225],67:ot,82:219,116:lt,117:st,118:mt},{60:[1,226]},{64:[1,227],67:ot,82:219,116:lt,117:st,118:mt},{66:[1,228],67:ot,82:219,116:lt,117:st,118:mt},{30:229,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{31:[1,230],67:ot,82:219,116:lt,117:st,118:mt},{67:ot,69:[1,231],71:[1,232],82:219,116:lt,117:st,118:mt},{67:ot,69:[1,234],71:[1,233],82:219,116:lt,117:st,118:mt},t(H,[2,45],{18:156,10:F,40:rt}),t(H,[2,47],{44:ht}),t(fe,[2,75]),t(fe,[2,74]),{62:[1,235],67:ot,82:219,116:lt,117:st,118:mt},t(fe,[2,77]),t(_r,[2,80]),{77:[1,236],79:198,116:Ce,119:Ve},{30:237,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},t(pt,a,{5:238}),t(Se,[2,102]),t(z,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},{10:F,18:240},{10:kt,60:Nt,84:sr,92:241,105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},{10:kt,60:Nt,84:sr,92:252,104:[1,253],105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},{10:kt,60:Nt,84:sr,92:254,104:[1,255],105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},{105:[1,256]},{10:kt,60:Nt,84:sr,92:257,105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},{44:g,47:258,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},t(Et,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Et,[2,116]),t(Et,[2,118],{10:[1,262]}),t(Et,[2,119]),t(ce,[2,56]),t(tt,[2,87]),t(ce,[2,57]),{51:[1,263],67:ot,82:219,116:lt,117:st,118:mt},t(ce,[2,64]),t(ce,[2,59]),t(ce,[2,60]),t(ce,[2,61]),{109:[1,264]},t(ce,[2,63]),t(ce,[2,65]),{66:[1,265],67:ot,82:219,116:lt,117:st,118:mt},t(ce,[2,67]),t(ce,[2,68]),t(ce,[2,70]),t(ce,[2,69]),t(ce,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(fe,[2,78]),{31:[1,266],67:ot,82:219,116:lt,117:st,118:mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,267],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D,121:R,122:I,123:$,124:O,125:N},t(Be,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},t(Et,[2,121],{106:gr}),t(Dr,[2,130],{108:270,10:kt,60:Nt,84:sr,105:Qt,109:vr,110:nr,111:Rr,112:Zt}),t(Qe,[2,132]),t(Qe,[2,134]),t(Qe,[2,135]),t(Qe,[2,136]),t(Qe,[2,137]),t(Qe,[2,138]),t(Qe,[2,139]),t(Qe,[2,140]),t(Qe,[2,141]),t(Et,[2,122],{106:gr}),{10:[1,271]},t(Et,[2,123],{106:gr}),{10:[1,272]},t(Ue,[2,129]),t(Et,[2,105],{106:gr}),t(Et,[2,106],{113:113,44:g,60:m,89:C,102:S,105:k,106:E,109:_,111:M,114:L,115:P,116:D}),t(Et,[2,110]),t(Et,[2,112],{10:[1,273]}),t(Et,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:V,9:B,11:G,21:278},t(z,[2,34]),t(Be,[2,52]),{10:kt,60:Nt,84:sr,105:Qt,107:279,108:243,109:vr,110:nr,111:Rr,112:Zt},t(Qe,[2,133]),{14:Z,44:Y,60:ie,89:K,101:280,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie,120:88},{14:Z,44:Y,60:ie,89:K,101:281,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie,120:88},{98:[1,282]},t(Et,[2,120]),t(ce,[2,58]),{30:283,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},t(ce,[2,66]),t(pt,a,{5:284}),t(Dr,[2,131],{108:270,10:kt,60:Nt,84:sr,105:Qt,109:vr,110:nr,111:Rr,112:Zt}),t(Et,[2,126],{120:168,10:[1,285],14:Z,44:Y,60:ie,89:K,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie}),t(Et,[2,127],{120:168,10:[1,286],14:Z,44:Y,60:ie,89:K,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie}),t(Et,[2,114]),{31:[1,287],67:ot,82:219,116:lt,117:st,118:mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,288],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D,121:R,122:I,123:$,124:O,125:N},{10:kt,60:Nt,84:sr,92:289,105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},{10:kt,60:Nt,84:sr,92:290,105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},t(ce,[2,62]),t(z,[2,33]),t(Et,[2,124],{106:gr}),t(Et,[2,125],{106:gr})],defaultActions:{},parseError:x(function(yt,it){if(it.recoverable)this.trace(yt);else{var xt=new Error(yt);throw xt.hash=it,xt}},"parseError"),parse:x(function(yt){var it=this,xt=[0],nt=[],Ht=[null],ke=[],rn=this.table,Ne="",Mr=0,nn=0,Bi=2,Qr=1,bn=ke.slice.call(arguments,1),Yr=Object.create(this.lexer),Da={yy:{}};for(var gc in this.yy)Object.prototype.hasOwnProperty.call(this.yy,gc)&&(Da.yy[gc]=this.yy[gc]);Yr.setInput(yt,Da.yy),Da.yy.lexer=Yr,Da.yy.parser=this,typeof Yr.yylloc>"u"&&(Yr.yylloc={});var xu=Yr.yylloc;ke.push(xu);var Vf=Yr.options&&Yr.options.ranges;typeof Da.yy.parseError=="function"?this.parseError=Da.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Tu(_n){xt.length=xt.length-2*_n,Ht.length=Ht.length-_n,ke.length=ke.length-_n}x(Tu,"popStack");function wu(){var _n;return _n=nt.pop()||Yr.lex()||Qr,typeof _n!="number"&&(_n instanceof Array&&(nt=_n,_n=nt.pop()),_n=it.symbols_[_n]||_n),_n}x(wu,"lex");for(var wt,Le,je,dt,Ft={},er,ur,gn,An;;){if(Le=xt[xt.length-1],this.defaultActions[Le]?je=this.defaultActions[Le]:((wt===null||typeof wt>"u")&&(wt=wu()),je=rn[Le]&&rn[Le][wt]),typeof je>"u"||!je.length||!je[0]){var fa="";An=[];for(er in rn[Le])this.terminals_[er]&&er>Bi&&An.push("'"+this.terminals_[er]+"'");Yr.showPosition?fa="Parse error on line "+(Mr+1)+`: `+Yr.showPosition()+` -Expecting `+An.join(", ")+", got '"+(this.terminals_[wt]||wt)+"'":da="Parse error on line "+(Mr+1)+": Unexpected "+(wt==Qr?"end of input":"'"+(this.terminals_[wt]||wt)+"'"),this.parseError(da,{text:Yr.match,token:this.terminals_[wt]||wt,line:Yr.yylineno,loc:xu,expected:An})}if(je[0]instanceof Array&&je.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Le+", token: "+wt);switch(je[0]){case 1:xt.push(wt),Ht.push(Yr.yytext),ke.push(Yr.yylloc),xt.push(je[1]),wt=null,nn=Yr.yyleng,Ne=Yr.yytext,Mr=Yr.yylineno,xu=Yr.yylloc;break;case 2:if(ur=this.productions_[je[1]][1],Ft.$=Ht[Ht.length-ur],Ft._$={first_line:ke[ke.length-(ur||1)].first_line,last_line:ke[ke.length-1].last_line,first_column:ke[ke.length-(ur||1)].first_column,last_column:ke[ke.length-1].last_column},Vf&&(Ft._$.range=[ke[ke.length-(ur||1)].range[0],ke[ke.length-1].range[1]]),dt=this.performAction.apply(Ft,[Ne,nn,Mr,Da.yy,je[1],Ht,ke].concat(bn)),typeof dt<"u")return dt;ur&&(xt=xt.slice(0,-1*ur*2),Ht=Ht.slice(0,-1*ur),ke=ke.slice(0,-1*ur)),xt.push(this.productions_[je[1]][0]),Ht.push(Ft.$),ke.push(Ft._$),gn=rn[xt[xt.length-2]][xt[xt.length-1]],xt.push(gn);break;case 3:return!0}}return!0},"parse")},It=(function(){var Or={EOF:1,parseError:x(function(it,xt){if(this.yy.parser)this.yy.parser.parseError(it,xt);else throw new Error(it)},"parseError"),setInput:x(function(yt,it){return this.yy=it||this.yy||{},this._input=yt,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var yt=this._input[0];this.yytext+=yt,this.yyleng++,this.offset++,this.match+=yt,this.matched+=yt;var it=yt.match(/(?:\r\n?|\n).*/g);return it?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),yt},"input"),unput:x(function(yt){var it=yt.length,xt=yt.split(/(?:\r\n?|\n)/g);this._input=yt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-it),this.offset-=it;var nt=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),xt.length-1&&(this.yylineno-=xt.length-1);var Ht=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:xt?(xt.length===nt.length?this.yylloc.first_column:0)+nt[nt.length-xt.length].length-xt[0].length:this.yylloc.first_column-it},this.options.ranges&&(this.yylloc.range=[Ht[0],Ht[0]+this.yyleng-it]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+An.join(", ")+", got '"+(this.terminals_[wt]||wt)+"'":fa="Parse error on line "+(Mr+1)+": Unexpected "+(wt==Qr?"end of input":"'"+(this.terminals_[wt]||wt)+"'"),this.parseError(fa,{text:Yr.match,token:this.terminals_[wt]||wt,line:Yr.yylineno,loc:xu,expected:An})}if(je[0]instanceof Array&&je.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Le+", token: "+wt);switch(je[0]){case 1:xt.push(wt),Ht.push(Yr.yytext),ke.push(Yr.yylloc),xt.push(je[1]),wt=null,nn=Yr.yyleng,Ne=Yr.yytext,Mr=Yr.yylineno,xu=Yr.yylloc;break;case 2:if(ur=this.productions_[je[1]][1],Ft.$=Ht[Ht.length-ur],Ft._$={first_line:ke[ke.length-(ur||1)].first_line,last_line:ke[ke.length-1].last_line,first_column:ke[ke.length-(ur||1)].first_column,last_column:ke[ke.length-1].last_column},Vf&&(Ft._$.range=[ke[ke.length-(ur||1)].range[0],ke[ke.length-1].range[1]]),dt=this.performAction.apply(Ft,[Ne,nn,Mr,Da.yy,je[1],Ht,ke].concat(bn)),typeof dt<"u")return dt;ur&&(xt=xt.slice(0,-1*ur*2),Ht=Ht.slice(0,-1*ur),ke=ke.slice(0,-1*ur)),xt.push(this.productions_[je[1]][0]),Ht.push(Ft.$),ke.push(Ft._$),gn=rn[xt[xt.length-2]][xt[xt.length-1]],xt.push(gn);break;case 3:return!0}}return!0},"parse")},It=(function(){var Or={EOF:1,parseError:x(function(it,xt){if(this.yy.parser)this.yy.parser.parseError(it,xt);else throw new Error(it)},"parseError"),setInput:x(function(yt,it){return this.yy=it||this.yy||{},this._input=yt,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var yt=this._input[0];this.yytext+=yt,this.yyleng++,this.offset++,this.match+=yt,this.matched+=yt;var it=yt.match(/(?:\r\n?|\n).*/g);return it?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),yt},"input"),unput:x(function(yt){var it=yt.length,xt=yt.split(/(?:\r\n?|\n)/g);this._input=yt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-it),this.offset-=it;var nt=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),xt.length-1&&(this.yylineno-=xt.length-1);var Ht=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:xt?(xt.length===nt.length?this.yylloc.first_column:0)+nt[nt.length-xt.length].length-xt[0].length:this.yylloc.first_column-it},this.options.ranges&&(this.yylloc.range=[Ht[0],Ht[0]+this.yyleng-it]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(yt){this.unput(this.match.slice(yt))},"less"),pastInput:x(function(){var yt=this.matched.substr(0,this.matched.length-this.match.length);return(yt.length>20?"...":"")+yt.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var yt=this.match;return yt.length<20&&(yt+=this._input.substr(0,20-yt.length)),(yt.substr(0,20)+(yt.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var yt=this.pastInput(),it=new Array(yt.length+1).join("-");return yt+this.upcomingInput()+` `+it+"^"},"showPosition"),test_match:x(function(yt,it){var xt,nt,Ht;if(this.options.backtrack_lexer&&(Ht={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ht.yylloc.range=this.yylloc.range.slice(0))),nt=yt[0].match(/(?:\r\n?|\n).*/g),nt&&(this.yylineno+=nt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:nt?nt[nt.length-1].length-nt[nt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+yt[0].length},this.yytext+=yt[0],this.match+=yt[0],this.matches=yt,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(yt[0].length),this.matched+=yt[0],xt=this.performAction.call(this,this.yy,this,it,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),xt)return xt;if(this._backtrack){for(var ke in Ht)this[ke]=Ht[ke];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var yt,it,xt,nt;this._more||(this.yytext="",this.match="");for(var Ht=this._currentRules(),ke=0;keit[0].length)){if(it=xt,nt=ke,this.options.backtrack_lexer){if(yt=this.test_match(xt,Ht[ke]),yt!==!1)return yt;if(this._backtrack){it=!1;continue}else return!1}else if(!this.options.flex)break}return it?(yt=this.test_match(it,Ht[nt]),yt!==!1?yt:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var it=this.next();return it||this.lex()},"lex"),begin:x(function(it){this.conditionStack.push(it)},"begin"),popState:x(function(){var it=this.conditionStack.length-1;return it>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(it){return it=this.conditionStack.length-1-Math.abs(it||0),it>=0?this.conditionStack[it]:"INITIAL"},"topState"),pushState:x(function(it){this.begin(it)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(it,xt,nt,Ht){switch(nt){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),xt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const ke=/\n\s*/g;return xt.yytext=xt.yytext.replace(ke,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return it.lex.firstGraph()&&this.begin("dir"),12;case 36:return it.lex.firstGraph()&&this.begin("dir"),12;case 37:return it.lex.firstGraph()&&this.begin("dir"),12;case 38:return it.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState("thickEdgeText"),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState("dottedEdgeText"),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return Or})();ct.lexer=It;function cr(){this.yy={}}return x(cr,"Parser"),cr.prototype=ct,ct.Parser=cr,new cr})();CP.parser=CP;var ebe=CP,tbe=Object.assign({},ebe);tbe.parse=t=>{const e=t.replace(/}\s*\n/g,`} -`);return ebe.parse(e)};var hyt=tbe,dyt=x((t,e)=>{const r=wz,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return jl(n,i,a,e)},"fade"),fyt=x(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var it=this.next();return it||this.lex()},"lex"),begin:x(function(it){this.conditionStack.push(it)},"begin"),popState:x(function(){var it=this.conditionStack.length-1;return it>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(it){return it=this.conditionStack.length-1-Math.abs(it||0),it>=0?this.conditionStack[it]:"INITIAL"},"topState"),pushState:x(function(it){this.begin(it)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(it,xt,nt,Ht){switch(nt){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),xt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const ke=/\n\s*/g;return xt.yytext=xt.yytext.replace(ke,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return it.lex.firstGraph()&&this.begin("dir"),12;case 36:return it.lex.firstGraph()&&this.begin("dir"),12;case 37:return it.lex.firstGraph()&&this.begin("dir"),12;case 38:return it.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState("thickEdgeText"),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState("dottedEdgeText"),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return Or})();ct.lexer=It;function cr(){this.yy={}}return x(cr,"Parser"),cr.prototype=ct,ct.Parser=cr,new cr})();CP.parser=CP;var tbe=CP,rbe=Object.assign({},tbe);rbe.parse=t=>{const e=t.replace(/}\s*\n/g,`} +`);return tbe.parse(e)};var pyt=rbe,gyt=x((t,e)=>{const r=wz,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return jl(n,i,a,e)},"fade"),myt=x(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -1242,7 +1244,7 @@ Expecting `+An.join(", ")+", got '"+(this.terminals_[wt]||wt)+"'":da="Parse erro /* For html labels only */ .labelBkg { - background-color: ${dyt(t.edgeLabelBackground,.5)}; + background-color: ${gyt(t.edgeLabelBackground,.5)}; // background-color: } @@ -1302,19 +1304,19 @@ Expecting `+An.join(", ")+", got '"+(this.terminals_[wt]||wt)+"'":da="Parse erro text-align: center; } ${CS()} -`,"getStyles"),rbe=fyt,vW=x(({defaultLayout:t,styles:e=rbe}={})=>({parser:hyt,get db(){return new oyt},renderer:uyt,styles:e,init:x(r=>{r.flowchart||(r.flowchart={});const n=Zle().layout??t??r.layout;n&&jD({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,jD({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),pyt=vW();const bW=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:vW,diagram:pyt},Symbol.toStringTag,{value:"Module"}));var gyt=x(t=>`${rbe(t)} +`,"getStyles"),nbe=myt,vW=x(({defaultLayout:t,styles:e=nbe}={})=>({parser:pyt,get db(){return new uyt},renderer:fyt,styles:e,init:x(r=>{r.flowchart||(r.flowchart={});const n=Qle().layout??t??r.layout;n&&jD({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,jD({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),yyt=vW();const bW=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:vW,diagram:yyt},Symbol.toStringTag,{value:"Module"}));var vyt=x(t=>`${nbe(t)} .swimlane.cluster rect { stroke: ${t.clusterBorder} !important; } [data-look="neo"].cluster rect { filter: none; } -`,"getStyles"),myt=gyt,yyt=vW({defaultLayout:"swimlane",styles:myt});const vyt=Object.freeze(Object.defineProperty({__proto__:null,diagram:yyt},Symbol.toStringTag,{value:"Module"}));var kP=(function(){var t=x(function(Re,Ie,Be,ce){for(Be=Be||{},ce=Re.length;ce--;Be[Re[ce]]=Ie);return Be},"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],n=[1,11],i=[1,12],a=[1,13],s=[1,23],o=[1,24],l=[1,25],u=[1,26],h=[1,27],d=[1,19],f=[1,28],p=[1,29],g=[1,20],m=[1,18],y=[1,21],v=[1,22],T=[1,36],b=[1,37],w=[1,38],C=[1,39],S=[1,40],k=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],E=[1,45],_=[1,46],M=[1,55],L=[40,48,50,51,52,71,72],P=[1,66],D=[1,64],R=[1,61],I=[1,65],$=[1,67],O=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],N=[66,67,68,69,70],F=[1,85],z=[1,84],V=[1,82],B=[1,83],G=[6,10,42,47],H=[6,10,13,41,42,47,48,49],q=[1,93],Z=[1,92],Y=[1,91],ie=[19,58],K=[1,102],Q=[1,101],te=[19,58,61,63],J={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:x(function(Ie,Be,ce,oe,be,fe,Pe){var ve=fe.length-1;switch(be){case 1:break;case 2:this.$=[];break;case 3:fe[ve-1].push(fe[ve]),this.$=fe[ve-1];break;case 4:case 5:this.$=fe[ve];break;case 6:case 7:this.$=[];break;case 8:oe.addEntity(fe[ve-4]),oe.addEntity(fe[ve-2]),oe.addRelationship(fe[ve-4],fe[ve],fe[ve-2],fe[ve-3]);break;case 9:oe.addEntity(fe[ve-8]),oe.addEntity(fe[ve-4]),oe.addRelationship(fe[ve-8],fe[ve],fe[ve-4],fe[ve-5]),oe.setClass([fe[ve-8]],fe[ve-6]),oe.setClass([fe[ve-4]],fe[ve-2]);break;case 10:oe.addEntity(fe[ve-6]),oe.addEntity(fe[ve-2]),oe.addRelationship(fe[ve-6],fe[ve],fe[ve-2],fe[ve-3]),oe.setClass([fe[ve-6]],fe[ve-4]);break;case 11:oe.addEntity(fe[ve-6]),oe.addEntity(fe[ve-4]),oe.addRelationship(fe[ve-6],fe[ve],fe[ve-4],fe[ve-5]),oe.setClass([fe[ve-4]],fe[ve-2]);break;case 12:oe.addEntity(fe[ve-3]),oe.addAttributes(fe[ve-3],fe[ve-1]);break;case 13:oe.addEntity(fe[ve-5]),oe.addAttributes(fe[ve-5],fe[ve-1]),oe.setClass([fe[ve-5]],fe[ve-3]);break;case 14:oe.addEntity(fe[ve-2]);break;case 15:oe.addEntity(fe[ve-4]),oe.setClass([fe[ve-4]],fe[ve-2]);break;case 16:oe.addEntity(fe[ve]);break;case 17:oe.addEntity(fe[ve-2]),oe.setClass([fe[ve-2]],fe[ve]);break;case 18:oe.addEntity(fe[ve-6],fe[ve-4]),oe.addAttributes(fe[ve-6],fe[ve-1]);break;case 19:oe.addEntity(fe[ve-8],fe[ve-6]),oe.addAttributes(fe[ve-8],fe[ve-1]),oe.setClass([fe[ve-8]],fe[ve-3]);break;case 20:oe.addEntity(fe[ve-5],fe[ve-3]);break;case 21:oe.addEntity(fe[ve-7],fe[ve-5]),oe.setClass([fe[ve-7]],fe[ve-2]);break;case 22:oe.addEntity(fe[ve-3],fe[ve-1]);break;case 23:oe.addEntity(fe[ve-5],fe[ve-3]),oe.setClass([fe[ve-5]],fe[ve]);break;case 24:case 25:this.$=fe[ve].trim(),oe.setAccTitle(this.$);break;case 26:case 27:this.$=fe[ve].trim(),oe.setAccDescription(this.$);break;case 32:oe.setDirection("TB");break;case 33:oe.setDirection("BT");break;case 34:oe.setDirection("RL");break;case 35:oe.setDirection("LR");break;case 36:this.$=fe[ve-3],oe.addClass(fe[ve-2],fe[ve-1]);break;case 37:case 38:case 59:case 68:this.$=[fe[ve]];break;case 39:case 40:this.$=fe[ve-2].concat([fe[ve]]);break;case 41:this.$=fe[ve-2],oe.setClass(fe[ve-1],fe[ve]);break;case 42:this.$=fe[ve-3],oe.addCssStyles(fe[ve-2],fe[ve-1]);break;case 43:this.$=[fe[ve]];break;case 44:fe[ve-2].push(fe[ve]),this.$=fe[ve-2];break;case 46:this.$=fe[ve-1]+fe[ve];break;case 54:case 80:case 81:this.$=fe[ve].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=fe[ve];break;case 60:fe[ve].push(fe[ve-1]),this.$=fe[ve];break;case 61:this.$={type:fe[ve-1],name:fe[ve]};break;case 62:this.$={type:fe[ve-2],name:fe[ve-1],keys:fe[ve]};break;case 63:this.$={type:fe[ve-2],name:fe[ve-1],comment:fe[ve]};break;case 64:this.$={type:fe[ve-3],name:fe[ve-2],keys:fe[ve-1],comment:fe[ve]};break;case 65:case 67:case 70:this.$=fe[ve];break;case 66:this.$=fe[ve-1]+fe[ve];break;case 69:fe[ve-2].push(fe[ve]),this.$=fe[ve-2];break;case 71:this.$=fe[ve].replace(/"/g,"");break;case 72:this.$={cardA:fe[ve],relType:fe[ve-1],cardB:fe[ve-2]};break;case 73:this.$=oe.Cardinality.ZERO_OR_ONE;break;case 74:this.$=oe.Cardinality.ZERO_OR_MORE;break;case 75:this.$=oe.Cardinality.ONE_OR_MORE;break;case 76:this.$=oe.Cardinality.ONLY_ONE;break;case 77:this.$=oe.Cardinality.MD_PARENT;break;case 78:this.$=oe.Identification.NON_IDENTIFYING;break;case 79:this.$=oe.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:30,11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:T,67:b,68:w,69:C,70:S}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(k,[2,54]),t(k,[2,55]),t(k,[2,56]),t(k,[2,57]),t(k,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:E,41:_},{16:47,40:E,41:_},{16:48,40:E,41:_},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:y,52:v},{16:50,40:E,41:_},{18:51,19:[1,52],53:53,54:54,58:M},{11:56,40:d,48:g,50:m,51:y,52:v},{65:57,71:[1,58],72:[1,59]},t(L,[2,73]),t(L,[2,74]),t(L,[2,75]),t(L,[2,76]),t(L,[2,77]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:P,38:60,41:D,42:R,45:62,46:63,48:I,49:$},t(O,[2,37]),t(O,[2,38]),{16:68,40:E,41:_,42:R},{13:P,38:69,41:D,42:R,45:62,46:63,48:I,49:$},{13:[1,70],15:[1,71]},t(e,[2,17],{64:35,12:72,17:[1,73],42:R,66:T,67:b,68:w,69:C,70:S}),{19:[1,74]},t(e,[2,14]),{18:75,19:[2,59],53:53,54:54,58:M},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:T,67:b,68:w,69:C,70:S},t(N,[2,78]),t(N,[2,79]),{6:F,10:z,39:81,42:V,47:B},{40:[1,86],41:[1,87]},t(G,[2,43],{46:88,13:P,41:D,48:I,49:$}),t(H,[2,45]),t(H,[2,50]),t(H,[2,51]),t(H,[2,52]),t(H,[2,53]),t(e,[2,41],{42:R}),{6:F,10:z,39:89,42:V,47:B},{14:90,40:q,50:Z,73:Y},{16:94,40:E,41:_},{11:95,40:d,48:g,50:m,51:y,52:v},{18:96,19:[1,97],53:53,54:54,58:M},t(e,[2,12]),{19:[2,60]},t(ie,[2,61],{56:98,57:99,60:100,62:K,63:Q}),t([19,58,62,63],[2,67]),{58:[2,66]},t(e,[2,22],{15:[1,104],17:[1,103]}),t([40,48,50,51,52],[2,72]),t(e,[2,36]),{13:P,41:D,45:105,46:63,48:I,49:$},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(O,[2,39]),t(O,[2,40]),t(H,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,80]),t(e,[2,81]),t(e,[2,82]),{13:[1,106],42:R},{13:[1,108],15:[1,107]},{19:[1,109]},t(e,[2,15]),t(ie,[2,62],{57:110,61:[1,111],63:Q}),t(ie,[2,63]),t(te,[2,68]),t(ie,[2,71]),t(te,[2,70]),{18:112,19:[1,113],53:53,54:54,58:M},{16:114,40:E,41:_},t(G,[2,44],{46:88,13:P,41:D,48:I,49:$}),{14:115,40:q,50:Z,73:Y},{16:116,40:E,41:_},{14:117,40:q,50:Z,73:Y},t(e,[2,13]),t(ie,[2,64]),{60:118,62:K},{19:[1,119]},t(e,[2,20]),t(e,[2,23],{17:[1,120],42:R}),t(e,[2,11]),{13:[1,121],42:R},t(e,[2,10]),t(te,[2,69]),t(e,[2,18]),{18:122,19:[1,123],53:53,54:54,58:M},{14:124,40:q,50:Z,73:Y},{19:[1,125]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:x(function(Ie,Be){if(Be.recoverable)this.trace(Ie);else{var ce=new Error(Ie);throw ce.hash=Be,ce}},"parseError"),parse:x(function(Ie){var Be=this,ce=[0],oe=[],be=[null],fe=[],Pe=this.table,ve="",Ce=0,Ve=0,se=2,de=1,Te=fe.slice.call(arguments,1),ae=Object.create(this.lexer),he={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(he.yy[W]=this.yy[W]);ae.setInput(Ie,he.yy),he.yy.lexer=ae,he.yy.parser=this,typeof ae.yylloc>"u"&&(ae.yylloc={});var ne=ae.yylloc;fe.push(ne);var j=ae.options&&ae.options.ranges;typeof he.yy.parseError=="function"?this.parseError=he.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(at){ce.length=ce.length-2*at,be.length=be.length-at,fe.length=fe.length-at}x(ue,"popStack");function X(){var at;return at=oe.pop()||ae.lex()||de,typeof at!="number"&&(at instanceof Array&&(oe=at,at=oe.pop()),at=Be.symbols_[at]||at),at}x(X,"lex");for(var Oe,xe,Ge,_e,$e={},Me,He,De,Ke;;){if(xe=ce[ce.length-1],this.defaultActions[xe]?Ge=this.defaultActions[xe]:((Oe===null||typeof Oe>"u")&&(Oe=X()),Ge=Pe[xe]&&Pe[xe][Oe]),typeof Ge>"u"||!Ge.length||!Ge[0]){var Ae="";Ke=[];for(Me in Pe[xe])this.terminals_[Me]&&Me>se&&Ke.push("'"+this.terminals_[Me]+"'");ae.showPosition?Ae="Parse error on line "+(Ce+1)+`: +`,"getStyles"),byt=vyt,xyt=vW({defaultLayout:"swimlane",styles:byt});const Tyt=Object.freeze(Object.defineProperty({__proto__:null,diagram:xyt},Symbol.toStringTag,{value:"Module"}));var kP=(function(){var t=x(function(Re,Ie,Be,ce){for(Be=Be||{},ce=Re.length;ce--;Be[Re[ce]]=Ie);return Be},"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],n=[1,11],i=[1,12],a=[1,13],s=[1,23],o=[1,24],l=[1,25],u=[1,26],h=[1,27],d=[1,19],f=[1,28],p=[1,29],g=[1,20],m=[1,18],y=[1,21],v=[1,22],T=[1,36],b=[1,37],w=[1,38],C=[1,39],S=[1,40],k=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],E=[1,45],_=[1,46],M=[1,55],L=[40,48,50,51,52,71,72],P=[1,66],D=[1,64],R=[1,61],I=[1,65],$=[1,67],O=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],N=[66,67,68,69,70],F=[1,85],z=[1,84],V=[1,82],B=[1,83],G=[6,10,42,47],H=[6,10,13,41,42,47,48,49],q=[1,93],Z=[1,92],Y=[1,91],ie=[19,58],K=[1,102],Q=[1,101],te=[19,58,61,63],J={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:x(function(Ie,Be,ce,oe,be,fe,Pe){var ve=fe.length-1;switch(be){case 1:break;case 2:this.$=[];break;case 3:fe[ve-1].push(fe[ve]),this.$=fe[ve-1];break;case 4:case 5:this.$=fe[ve];break;case 6:case 7:this.$=[];break;case 8:oe.addEntity(fe[ve-4]),oe.addEntity(fe[ve-2]),oe.addRelationship(fe[ve-4],fe[ve],fe[ve-2],fe[ve-3]);break;case 9:oe.addEntity(fe[ve-8]),oe.addEntity(fe[ve-4]),oe.addRelationship(fe[ve-8],fe[ve],fe[ve-4],fe[ve-5]),oe.setClass([fe[ve-8]],fe[ve-6]),oe.setClass([fe[ve-4]],fe[ve-2]);break;case 10:oe.addEntity(fe[ve-6]),oe.addEntity(fe[ve-2]),oe.addRelationship(fe[ve-6],fe[ve],fe[ve-2],fe[ve-3]),oe.setClass([fe[ve-6]],fe[ve-4]);break;case 11:oe.addEntity(fe[ve-6]),oe.addEntity(fe[ve-4]),oe.addRelationship(fe[ve-6],fe[ve],fe[ve-4],fe[ve-5]),oe.setClass([fe[ve-4]],fe[ve-2]);break;case 12:oe.addEntity(fe[ve-3]),oe.addAttributes(fe[ve-3],fe[ve-1]);break;case 13:oe.addEntity(fe[ve-5]),oe.addAttributes(fe[ve-5],fe[ve-1]),oe.setClass([fe[ve-5]],fe[ve-3]);break;case 14:oe.addEntity(fe[ve-2]);break;case 15:oe.addEntity(fe[ve-4]),oe.setClass([fe[ve-4]],fe[ve-2]);break;case 16:oe.addEntity(fe[ve]);break;case 17:oe.addEntity(fe[ve-2]),oe.setClass([fe[ve-2]],fe[ve]);break;case 18:oe.addEntity(fe[ve-6],fe[ve-4]),oe.addAttributes(fe[ve-6],fe[ve-1]);break;case 19:oe.addEntity(fe[ve-8],fe[ve-6]),oe.addAttributes(fe[ve-8],fe[ve-1]),oe.setClass([fe[ve-8]],fe[ve-3]);break;case 20:oe.addEntity(fe[ve-5],fe[ve-3]);break;case 21:oe.addEntity(fe[ve-7],fe[ve-5]),oe.setClass([fe[ve-7]],fe[ve-2]);break;case 22:oe.addEntity(fe[ve-3],fe[ve-1]);break;case 23:oe.addEntity(fe[ve-5],fe[ve-3]),oe.setClass([fe[ve-5]],fe[ve]);break;case 24:case 25:this.$=fe[ve].trim(),oe.setAccTitle(this.$);break;case 26:case 27:this.$=fe[ve].trim(),oe.setAccDescription(this.$);break;case 32:oe.setDirection("TB");break;case 33:oe.setDirection("BT");break;case 34:oe.setDirection("RL");break;case 35:oe.setDirection("LR");break;case 36:this.$=fe[ve-3],oe.addClass(fe[ve-2],fe[ve-1]);break;case 37:case 38:case 59:case 68:this.$=[fe[ve]];break;case 39:case 40:this.$=fe[ve-2].concat([fe[ve]]);break;case 41:this.$=fe[ve-2],oe.setClass(fe[ve-1],fe[ve]);break;case 42:this.$=fe[ve-3],oe.addCssStyles(fe[ve-2],fe[ve-1]);break;case 43:this.$=[fe[ve]];break;case 44:fe[ve-2].push(fe[ve]),this.$=fe[ve-2];break;case 46:this.$=fe[ve-1]+fe[ve];break;case 54:case 80:case 81:this.$=fe[ve].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=fe[ve];break;case 60:fe[ve].push(fe[ve-1]),this.$=fe[ve];break;case 61:this.$={type:fe[ve-1],name:fe[ve]};break;case 62:this.$={type:fe[ve-2],name:fe[ve-1],keys:fe[ve]};break;case 63:this.$={type:fe[ve-2],name:fe[ve-1],comment:fe[ve]};break;case 64:this.$={type:fe[ve-3],name:fe[ve-2],keys:fe[ve-1],comment:fe[ve]};break;case 65:case 67:case 70:this.$=fe[ve];break;case 66:this.$=fe[ve-1]+fe[ve];break;case 69:fe[ve-2].push(fe[ve]),this.$=fe[ve-2];break;case 71:this.$=fe[ve].replace(/"/g,"");break;case 72:this.$={cardA:fe[ve],relType:fe[ve-1],cardB:fe[ve-2]};break;case 73:this.$=oe.Cardinality.ZERO_OR_ONE;break;case 74:this.$=oe.Cardinality.ZERO_OR_MORE;break;case 75:this.$=oe.Cardinality.ONE_OR_MORE;break;case 76:this.$=oe.Cardinality.ONLY_ONE;break;case 77:this.$=oe.Cardinality.MD_PARENT;break;case 78:this.$=oe.Identification.NON_IDENTIFYING;break;case 79:this.$=oe.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:30,11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:T,67:b,68:w,69:C,70:S}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(k,[2,54]),t(k,[2,55]),t(k,[2,56]),t(k,[2,57]),t(k,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:E,41:_},{16:47,40:E,41:_},{16:48,40:E,41:_},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:y,52:v},{16:50,40:E,41:_},{18:51,19:[1,52],53:53,54:54,58:M},{11:56,40:d,48:g,50:m,51:y,52:v},{65:57,71:[1,58],72:[1,59]},t(L,[2,73]),t(L,[2,74]),t(L,[2,75]),t(L,[2,76]),t(L,[2,77]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:P,38:60,41:D,42:R,45:62,46:63,48:I,49:$},t(O,[2,37]),t(O,[2,38]),{16:68,40:E,41:_,42:R},{13:P,38:69,41:D,42:R,45:62,46:63,48:I,49:$},{13:[1,70],15:[1,71]},t(e,[2,17],{64:35,12:72,17:[1,73],42:R,66:T,67:b,68:w,69:C,70:S}),{19:[1,74]},t(e,[2,14]),{18:75,19:[2,59],53:53,54:54,58:M},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:T,67:b,68:w,69:C,70:S},t(N,[2,78]),t(N,[2,79]),{6:F,10:z,39:81,42:V,47:B},{40:[1,86],41:[1,87]},t(G,[2,43],{46:88,13:P,41:D,48:I,49:$}),t(H,[2,45]),t(H,[2,50]),t(H,[2,51]),t(H,[2,52]),t(H,[2,53]),t(e,[2,41],{42:R}),{6:F,10:z,39:89,42:V,47:B},{14:90,40:q,50:Z,73:Y},{16:94,40:E,41:_},{11:95,40:d,48:g,50:m,51:y,52:v},{18:96,19:[1,97],53:53,54:54,58:M},t(e,[2,12]),{19:[2,60]},t(ie,[2,61],{56:98,57:99,60:100,62:K,63:Q}),t([19,58,62,63],[2,67]),{58:[2,66]},t(e,[2,22],{15:[1,104],17:[1,103]}),t([40,48,50,51,52],[2,72]),t(e,[2,36]),{13:P,41:D,45:105,46:63,48:I,49:$},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(O,[2,39]),t(O,[2,40]),t(H,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,80]),t(e,[2,81]),t(e,[2,82]),{13:[1,106],42:R},{13:[1,108],15:[1,107]},{19:[1,109]},t(e,[2,15]),t(ie,[2,62],{57:110,61:[1,111],63:Q}),t(ie,[2,63]),t(te,[2,68]),t(ie,[2,71]),t(te,[2,70]),{18:112,19:[1,113],53:53,54:54,58:M},{16:114,40:E,41:_},t(G,[2,44],{46:88,13:P,41:D,48:I,49:$}),{14:115,40:q,50:Z,73:Y},{16:116,40:E,41:_},{14:117,40:q,50:Z,73:Y},t(e,[2,13]),t(ie,[2,64]),{60:118,62:K},{19:[1,119]},t(e,[2,20]),t(e,[2,23],{17:[1,120],42:R}),t(e,[2,11]),{13:[1,121],42:R},t(e,[2,10]),t(te,[2,69]),t(e,[2,18]),{18:122,19:[1,123],53:53,54:54,58:M},{14:124,40:q,50:Z,73:Y},{19:[1,125]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:x(function(Ie,Be){if(Be.recoverable)this.trace(Ie);else{var ce=new Error(Ie);throw ce.hash=Be,ce}},"parseError"),parse:x(function(Ie){var Be=this,ce=[0],oe=[],be=[null],fe=[],Pe=this.table,ve="",Ce=0,Ve=0,se=2,de=1,Te=fe.slice.call(arguments,1),ae=Object.create(this.lexer),he={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(he.yy[W]=this.yy[W]);ae.setInput(Ie,he.yy),he.yy.lexer=ae,he.yy.parser=this,typeof ae.yylloc>"u"&&(ae.yylloc={});var ne=ae.yylloc;fe.push(ne);var j=ae.options&&ae.options.ranges;typeof he.yy.parseError=="function"?this.parseError=he.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(at){ce.length=ce.length-2*at,be.length=be.length-at,fe.length=fe.length-at}x(ue,"popStack");function X(){var at;return at=oe.pop()||ae.lex()||de,typeof at!="number"&&(at instanceof Array&&(oe=at,at=oe.pop()),at=Be.symbols_[at]||at),at}x(X,"lex");for(var Oe,xe,Ge,_e,$e={},Me,He,De,Ke;;){if(xe=ce[ce.length-1],this.defaultActions[xe]?Ge=this.defaultActions[xe]:((Oe===null||typeof Oe>"u")&&(Oe=X()),Ge=Pe[xe]&&Pe[xe][Oe]),typeof Ge>"u"||!Ge.length||!Ge[0]){var Ae="";Ke=[];for(Me in Pe[xe])this.terminals_[Me]&&Me>se&&Ke.push("'"+this.terminals_[Me]+"'");ae.showPosition?Ae="Parse error on line "+(Ce+1)+`: `+ae.showPosition()+` Expecting `+Ke.join(", ")+", got '"+(this.terminals_[Oe]||Oe)+"'":Ae="Parse error on line "+(Ce+1)+": Unexpected "+(Oe==de?"end of input":"'"+(this.terminals_[Oe]||Oe)+"'"),this.parseError(Ae,{text:ae.match,token:this.terminals_[Oe]||Oe,line:ae.yylineno,loc:ne,expected:Ke})}if(Ge[0]instanceof Array&&Ge.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xe+", token: "+Oe);switch(Ge[0]){case 1:ce.push(Oe),be.push(ae.yytext),fe.push(ae.yylloc),ce.push(Ge[1]),Oe=null,Ve=ae.yyleng,ve=ae.yytext,Ce=ae.yylineno,ne=ae.yylloc;break;case 2:if(He=this.productions_[Ge[1]][1],$e.$=be[be.length-He],$e._$={first_line:fe[fe.length-(He||1)].first_line,last_line:fe[fe.length-1].last_line,first_column:fe[fe.length-(He||1)].first_column,last_column:fe[fe.length-1].last_column},j&&($e._$.range=[fe[fe.length-(He||1)].range[0],fe[fe.length-1].range[1]]),_e=this.performAction.apply($e,[ve,Ve,Ce,he.yy,Ge[1],be,fe].concat(Te)),typeof _e<"u")return _e;He&&(ce=ce.slice(0,-1*He*2),be=be.slice(0,-1*He),fe=fe.slice(0,-1*He)),ce.push(this.productions_[Ge[1]][0]),be.push($e.$),fe.push($e._$),De=Pe[ce[ce.length-2]][ce[ce.length-1]],ce.push(De);break;case 3:return!0}}return!0},"parse")},ge=(function(){var Re={EOF:1,parseError:x(function(Be,ce){if(this.yy.parser)this.yy.parser.parseError(Be,ce);else throw new Error(Be)},"parseError"),setInput:x(function(Ie,Be){return this.yy=Be||this.yy||{},this._input=Ie,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Ie=this._input[0];this.yytext+=Ie,this.yyleng++,this.offset++,this.match+=Ie,this.matched+=Ie;var Be=Ie.match(/(?:\r\n?|\n).*/g);return Be?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ie},"input"),unput:x(function(Ie){var Be=Ie.length,ce=Ie.split(/(?:\r\n?|\n)/g);this._input=Ie+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Be),this.offset-=Be;var oe=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),ce.length-1&&(this.yylineno-=ce.length-1);var be=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ce?(ce.length===oe.length?this.yylloc.first_column:0)+oe[oe.length-ce.length].length-ce[0].length:this.yylloc.first_column-Be},this.options.ranges&&(this.yylloc.range=[be[0],be[0]+this.yyleng-Be]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Ie){this.unput(this.match.slice(Ie))},"less"),pastInput:x(function(){var Ie=this.matched.substr(0,this.matched.length-this.match.length);return(Ie.length>20?"...":"")+Ie.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Ie=this.match;return Ie.length<20&&(Ie+=this._input.substr(0,20-Ie.length)),(Ie.substr(0,20)+(Ie.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Ie=this.pastInput(),Be=new Array(Ie.length+1).join("-");return Ie+this.upcomingInput()+` `+Be+"^"},"showPosition"),test_match:x(function(Ie,Be){var ce,oe,be;if(this.options.backtrack_lexer&&(be={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(be.yylloc.range=this.yylloc.range.slice(0))),oe=Ie[0].match(/(?:\r\n?|\n).*/g),oe&&(this.yylineno+=oe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:oe?oe[oe.length-1].length-oe[oe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ie[0].length},this.yytext+=Ie[0],this.match+=Ie[0],this.matches=Ie,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Ie[0].length),this.matched+=Ie[0],ce=this.performAction.call(this,this.yy,this,Be,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ce)return ce;if(this._backtrack){for(var fe in be)this[fe]=be[fe];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ie,Be,ce,oe;this._more||(this.yytext="",this.match="");for(var be=this._currentRules(),fe=0;feBe[0].length)){if(Be=ce,oe=fe,this.options.backtrack_lexer){if(Ie=this.test_match(ce,be[fe]),Ie!==!1)return Ie;if(this._backtrack){Be=!1;continue}else return!1}else if(!this.options.flex)break}return Be?(Ie=this.test_match(Be,be[oe]),Ie!==!1?Ie:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Be=this.next();return Be||this.lex()},"lex"),begin:x(function(Be){this.conditionStack.push(Be)},"begin"),popState:x(function(){var Be=this.conditionStack.length-1;return Be>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Be){return Be=this.conditionStack.length-1-Math.abs(Be||0),Be>=0?this.conditionStack[Be]:"INITIAL"},"topState"),pushState:x(function(Be){this.begin(Be)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Be,ce,oe,be){switch(oe){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin("block_bq");break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return ce.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin("style"),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin("style"),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return ce.yytext[0];case 81:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],inclusive:!0}}};return Re})();J.lexer=ge;function ee(){this.yy={}}return x(ee,"Parser"),ee.prototype=J,J.Parser=ee,new ee})();kP.parser=kP;var byt=kP,Xy,xyt=(Xy=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Hn,this.getAccTitle=ni,this.setAccDescription=ii,this.getAccDescription=ai,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getConfig=x(()=>Fe().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(e,r=""){var n;return this.entities.has(e)?!((n=this.entities.get(e))!=null&&n.alias)&&r&&(this.entities.get(e).alias=r,le.info(`Add alias '${r}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:r,shape:"erBox",look:Fe().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),le.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,r){const n=this.addEntity(e);let i;for(i=r.length-1;i>=0;i--)r[i].keys||(r[i].keys=[]),r[i].comment||(r[i].comment=""),n.attributes.push(r[i]),le.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const a=this.entities.get(e),s=this.entities.get(n);if(!a||!s)return;const o={entityA:a.id,roleA:r,entityB:s.id,relSpec:i};this.relationships.push(o),le.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}addCssStyles(e,r){for(const n of e){const i=this.entities.get(n);if(!r||!i)return;for(const a of r)i.cssStyles.push(a)}}addClass(e,r){e.forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)})})}setClass(e,r){for(const n of e){const i=this.entities.get(n);if(i)for(const a of r)i.cssClasses+=" "+a}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],On()}getData(){const e=[],r=[],n=Fe();let i=0;for(const s of this.entities.keys()){const o=this.entities.get(s);o&&(o.cssCompiledStyles=this.getCompiledStyles(o.cssClasses.split(" ")),o.colorIndex=i++,e.push(o))}let a=0;for(const s of this.relationships){const o={id:dy(s.entityA,s.entityB,{prefix:"id",counter:a++}),type:"normal",curve:"basis",start:s.entityA,end:s.entityB,label:s.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:s.relSpec.cardB.toLowerCase(),arrowTypeEnd:s.relSpec.cardA.toLowerCase(),pattern:s.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(o)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},x(Xy,"ErDB"),Xy),nbe={};Z6(nbe,{draw:()=>Tyt});var Tyt=x(async function(t,e,r,n){le.info("REF0:"),le.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=Fe(),o=n.db.getData(),l=Ox(e,i);o.type=n.type,o.layoutAlgorithm=nS(s),o.config.flowchart.nodeSpacing=(a==null?void 0:a.nodeSpacing)||140,o.config.flowchart.rankSpacing=(a==null?void 0:a.rankSpacing)||80,o.direction=n.db.getDirection();const{config:u}=o,{look:h}=u;h==="neo"?o.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await xx(o,l),o.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=ut(this),m=p.attr("id").replace("-background",""),y=l.select(`#${CSS.escape(m)}`);if(!y.empty()){const v=y.attr("transform");p.attr("transform",v)}});const f=8;yr.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),mg(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),_te=x((t,e)=>{const r=wz,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return jl(n,i,a,e)},"fade"),T3=new Set(["redux-color","redux-dark-color"]),wyt=x(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!T3.has(e))return"";const a=(n==null?void 0:n.length)>0;let s="";for(let o=0;o0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Be){return Be=this.conditionStack.length-1-Math.abs(Be||0),Be>=0?this.conditionStack[Be]:"INITIAL"},"topState"),pushState:x(function(Be){this.begin(Be)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Be,ce,oe,be){switch(oe){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin("block_bq");break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return ce.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin("style"),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin("style"),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return ce.yytext[0];case 81:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],inclusive:!0}}};return Re})();J.lexer=ge;function ee(){this.yy={}}return x(ee,"Parser"),ee.prototype=J,J.Parser=ee,new ee})();kP.parser=kP;var wyt=kP,Xy,Cyt=(Xy=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Hn,this.getAccTitle=ni,this.setAccDescription=ii,this.getAccDescription=ai,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getConfig=x(()=>Fe().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(e,r=""){var n;return this.entities.has(e)?!((n=this.entities.get(e))!=null&&n.alias)&&r&&(this.entities.get(e).alias=r,le.info(`Add alias '${r}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:r,shape:"erBox",look:Fe().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),le.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,r){const n=this.addEntity(e);let i;for(i=r.length-1;i>=0;i--)r[i].keys||(r[i].keys=[]),r[i].comment||(r[i].comment=""),n.attributes.push(r[i]),le.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const a=this.entities.get(e),s=this.entities.get(n);if(!a||!s)return;const o={entityA:a.id,roleA:r,entityB:s.id,relSpec:i};this.relationships.push(o),le.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}addCssStyles(e,r){for(const n of e){const i=this.entities.get(n);if(!r||!i)return;for(const a of r)i.cssStyles.push(a)}}addClass(e,r){e.forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)})})}setClass(e,r){for(const n of e){const i=this.entities.get(n);if(i)for(const a of r)i.cssClasses+=" "+a}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],$n()}getData(){const e=[],r=[],n=Fe();let i=0;for(const s of this.entities.keys()){const o=this.entities.get(s);o&&(o.cssCompiledStyles=this.getCompiledStyles(o.cssClasses.split(" ")),o.colorIndex=i++,e.push(o))}let a=0;for(const s of this.relationships){const o={id:dy(s.entityA,s.entityB,{prefix:"id",counter:a++}),type:"normal",curve:"basis",start:s.entityA,end:s.entityB,label:s.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:s.relSpec.cardB.toLowerCase(),arrowTypeEnd:s.relSpec.cardA.toLowerCase(),pattern:s.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(o)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},x(Xy,"ErDB"),Xy),ibe={};Z6(ibe,{draw:()=>kyt});var kyt=x(async function(t,e,r,n){le.info("REF0:"),le.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=Fe(),o=n.db.getData(),l=Ox(e,i);o.type=n.type,o.layoutAlgorithm=nS(s),o.config.flowchart.nodeSpacing=(a==null?void 0:a.nodeSpacing)||140,o.config.flowchart.rankSpacing=(a==null?void 0:a.rankSpacing)||80,o.direction=n.db.getDirection();const{config:u}=o,{look:h}=u;h==="neo"?o.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await xx(o,l),o.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=ut(this),m=p.attr("id").replace("-background",""),y=l.select(`#${CSS.escape(m)}`);if(!y.empty()){const v=y.attr("transform");p.attr("transform",v)}});const f=8;yr.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),mg(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Rte=x((t,e)=>{const r=wz,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return jl(n,i,a,e)},"fade"),T3=new Set(["redux-color","redux-dark-color"]),Syt=x(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!T3.has(e))return"";const a=(n==null?void 0:n.length)>0;let s="";for(let o=0;o{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` - ${wyt(t)} + `;return s},"genColor"),Eyt=x(t=>{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` + ${Syt(t)} .entityBox { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; @@ -1342,7 +1344,7 @@ Expecting `+Ke.join(", ")+", got '"+(this.terminals_[Oe]||Oe)+"'":Ae="Parse erro } .labelBkg { - background-color: ${T3.has(r)&&n?n:_te(t.tertiaryColor,.5)}; + background-color: ${T3.has(r)&&n?n:Rte(t.tertiaryColor,.5)}; } .edgeLabel { @@ -1391,17 +1393,17 @@ Expecting `+Ke.join(", ")+", got '"+(this.terminals_[Oe]||Oe)+"'":Ae="Parse erro stroke-width: 1; } [data-look=neo].labelBkg { - background-color: ${_te(t.tertiaryColor,.5)}; + background-color: ${Rte(t.tertiaryColor,.5)}; } -`},"getStyles"),kyt=Cyt,Syt={parser:byt,get db(){return new xyt},renderer:nbe,styles:kyt};const Eyt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Syt},Symbol.toStringTag,{value:"Module"}));var jy,xW=(jy=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},x(jy,"ImperativeState"),jy);function eo(t,e){var r,n,i;t.accDescr&&((r=e.setAccDescription)==null||r.call(e,t.accDescr)),t.accTitle&&((n=e.setAccTitle)==null||n.call(e,t.accTitle)),t.title&&((i=e.setDiagramTitle)==null||i.call(e,t.title))}x(eo,"populateCommonDb");var Ayt=Object.create,kS=Object.defineProperty,_yt=Object.getOwnPropertyDescriptor,TW=Object.getOwnPropertyNames,Ryt=Object.getPrototypeOf,Lyt=Object.prototype.hasOwnProperty,A=(t,e)=>kS(t,"name",{value:e,configurable:!0}),Myt=(t,e)=>function(){return t&&(e=(0,t[TW(t)[0]])(t=0)),e},Nr=(t,e)=>function(){return e||(0,t[TW(t)[0]])((e={exports:{}}).exports,e),e.exports},Df=(t,e)=>{for(var r in e)kS(t,r,{get:e[r],enumerable:!0})},wW=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of TW(e))!Lyt.call(t,i)&&i!==r&&kS(t,i,{get:()=>e[i],enumerable:!(n=_yt(e,i))||n.enumerable});return t},TL=(t,e,r)=>(wW(t,e,"default"),r),CW=(t,e,r)=>(r=t!=null?Ayt(Ryt(t)):{},wW(kS(r,"default",{value:t,enumerable:!0}),t)),kW=t=>wW(kS({},"__esModule",{value:!0}),t),wL={};Df(wL,{AnnotatedTextEdit:()=>Fu,ChangeAnnotation:()=>dp,ChangeAnnotationIdentifier:()=>Ba,CodeAction:()=>i9,CodeActionContext:()=>n9,CodeActionKind:()=>r9,CodeActionTriggerKind:()=>lw,CodeDescription:()=>DP,CodeLens:()=>a9,Color:()=>C3,ColorInformation:()=>_P,ColorPresentation:()=>RP,Command:()=>hp,CompletionItem:()=>HP,CompletionItemKind:()=>BP,CompletionItemLabelDetails:()=>WP,CompletionItemTag:()=>zP,CompletionList:()=>qP,CreateFile:()=>wm,DeleteFile:()=>km,Diagnostic:()=>iw,DiagnosticRelatedInformation:()=>k3,DiagnosticSeverity:()=>IP,DiagnosticTag:()=>NP,DocumentHighlight:()=>KP,DocumentHighlightKind:()=>jP,DocumentLink:()=>o9,DocumentSymbol:()=>t9,DocumentUri:()=>SP,EOL:()=>abe,FoldingRange:()=>MP,FoldingRangeKind:()=>LP,FormattingOptions:()=>s9,Hover:()=>UP,InlayHint:()=>m9,InlayHintKind:()=>A3,InlayHintLabelPart:()=>_3,InlineCompletionContext:()=>w9,InlineCompletionItem:()=>v9,InlineCompletionList:()=>b9,InlineCompletionTriggerKind:()=>x9,InlineValueContext:()=>g9,InlineValueEvaluatableExpression:()=>p9,InlineValueText:()=>d9,InlineValueVariableLookup:()=>f9,InsertReplaceEdit:()=>VP,InsertTextFormat:()=>FP,InsertTextMode:()=>GP,Location:()=>nw,LocationLink:()=>AP,MarkedString:()=>ow,MarkupContent:()=>Sm,MarkupKind:()=>E3,OptionalVersionedTextDocumentIdentifier:()=>sw,ParameterInformation:()=>YP,Position:()=>mn,Range:()=>jr,RenameFile:()=>Cm,SelectedCompletionInfo:()=>T9,SelectionRange:()=>l9,SemanticTokenModifiers:()=>u9,SemanticTokenTypes:()=>c9,SemanticTokens:()=>h9,SignatureInformation:()=>XP,StringValue:()=>y9,SymbolInformation:()=>JP,SymbolKind:()=>ZP,SymbolTag:()=>QP,TextDocument:()=>k9,TextDocumentEdit:()=>aw,TextDocumentIdentifier:()=>OP,TextDocumentItem:()=>PP,TextEdit:()=>kc,URI:()=>w3,VersionedTextDocumentIdentifier:()=>$P,WorkspaceChange:()=>ibe,WorkspaceEdit:()=>S3,WorkspaceFolder:()=>C9,WorkspaceSymbol:()=>e9,integer:()=>EP,uinteger:()=>rw});var SP,w3,EP,rw,mn,jr,nw,AP,C3,_P,RP,LP,MP,k3,IP,NP,DP,iw,hp,kc,dp,Ba,Fu,aw,wm,Cm,km,S3,xT,lN,ibe,OP,$P,sw,PP,E3,Sm,BP,FP,zP,VP,GP,WP,HP,qP,ow,UP,YP,XP,jP,KP,ZP,QP,JP,e9,t9,r9,lw,n9,i9,a9,s9,o9,l9,c9,u9,h9,d9,f9,p9,g9,A3,_3,m9,y9,v9,b9,x9,T9,w9,C9,abe,k9,Rte,Ze,SS=Myt({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(i){function a(s){return typeof s=="string"}A(a,"is"),i.is=a})(SP||(SP={})),(function(i){function a(s){return typeof s=="string"}A(a,"is"),i.is=a})(w3||(w3={})),(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}A(a,"is"),i.is=a})(EP||(EP={})),(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}A(a,"is"),i.is=a})(rw||(rw={})),(function(i){function a(o,l){return o===Number.MAX_VALUE&&(o=rw.MAX_VALUE),l===Number.MAX_VALUE&&(l=rw.MAX_VALUE),{line:o,character:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.objectLiteral(l)&&Ze.uinteger(l.line)&&Ze.uinteger(l.character)}A(s,"is"),i.is=s})(mn||(mn={})),(function(i){function a(o,l,u,h){if(Ze.uinteger(o)&&Ze.uinteger(l)&&Ze.uinteger(u)&&Ze.uinteger(h))return{start:mn.create(o,l),end:mn.create(u,h)};if(mn.is(o)&&mn.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.objectLiteral(l)&&mn.is(l.start)&&mn.is(l.end)}A(s,"is"),i.is=s})(jr||(jr={})),(function(i){function a(o,l){return{uri:o,range:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.objectLiteral(l)&&jr.is(l.range)&&(Ze.string(l.uri)||Ze.undefined(l.uri))}A(s,"is"),i.is=s})(nw||(nw={})),(function(i){function a(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.objectLiteral(l)&&jr.is(l.targetRange)&&Ze.string(l.targetUri)&&jr.is(l.targetSelectionRange)&&(jr.is(l.originSelectionRange)||Ze.undefined(l.originSelectionRange))}A(s,"is"),i.is=s})(AP||(AP={})),(function(i){function a(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&Ze.numberRange(l.red,0,1)&&Ze.numberRange(l.green,0,1)&&Ze.numberRange(l.blue,0,1)&&Ze.numberRange(l.alpha,0,1)}A(s,"is"),i.is=s})(C3||(C3={})),(function(i){function a(o,l){return{range:o,color:l}}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&jr.is(l.range)&&C3.is(l.color)}A(s,"is"),i.is=s})(_P||(_P={})),(function(i){function a(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&Ze.string(l.label)&&(Ze.undefined(l.textEdit)||kc.is(l))&&(Ze.undefined(l.additionalTextEdits)||Ze.typedArray(l.additionalTextEdits,kc.is))}A(s,"is"),i.is=s})(RP||(RP={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(LP||(LP={})),(function(i){function a(o,l,u,h,d,f){const p={startLine:o,endLine:l};return Ze.defined(u)&&(p.startCharacter=u),Ze.defined(h)&&(p.endCharacter=h),Ze.defined(d)&&(p.kind=d),Ze.defined(f)&&(p.collapsedText=f),p}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&Ze.uinteger(l.startLine)&&Ze.uinteger(l.startLine)&&(Ze.undefined(l.startCharacter)||Ze.uinteger(l.startCharacter))&&(Ze.undefined(l.endCharacter)||Ze.uinteger(l.endCharacter))&&(Ze.undefined(l.kind)||Ze.string(l.kind))}A(s,"is"),i.is=s})(MP||(MP={})),(function(i){function a(o,l){return{location:o,message:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&nw.is(l.location)&&Ze.string(l.message)}A(s,"is"),i.is=s})(k3||(k3={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(IP||(IP={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(NP||(NP={})),(function(i){function a(s){const o=s;return Ze.objectLiteral(o)&&Ze.string(o.href)}A(a,"is"),i.is=a})(DP||(DP={})),(function(i){function a(o,l,u,h,d,f){let p={range:o,message:l};return Ze.defined(u)&&(p.severity=u),Ze.defined(h)&&(p.code=h),Ze.defined(d)&&(p.source=d),Ze.defined(f)&&(p.relatedInformation=f),p}A(a,"create"),i.create=a;function s(o){var l;let u=o;return Ze.defined(u)&&jr.is(u.range)&&Ze.string(u.message)&&(Ze.number(u.severity)||Ze.undefined(u.severity))&&(Ze.integer(u.code)||Ze.string(u.code)||Ze.undefined(u.code))&&(Ze.undefined(u.codeDescription)||Ze.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(Ze.string(u.source)||Ze.undefined(u.source))&&(Ze.undefined(u.relatedInformation)||Ze.typedArray(u.relatedInformation,k3.is))}A(s,"is"),i.is=s})(iw||(iw={})),(function(i){function a(o,l,...u){let h={title:o,command:l};return Ze.defined(u)&&u.length>0&&(h.arguments=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.string(l.title)&&Ze.string(l.command)}A(s,"is"),i.is=s})(hp||(hp={})),(function(i){function a(u,h){return{range:u,newText:h}}A(a,"replace"),i.replace=a;function s(u,h){return{range:{start:u,end:u},newText:h}}A(s,"insert"),i.insert=s;function o(u){return{range:u,newText:""}}A(o,"del"),i.del=o;function l(u){const h=u;return Ze.objectLiteral(h)&&Ze.string(h.newText)&&jr.is(h.range)}A(l,"is"),i.is=l})(kc||(kc={})),(function(i){function a(o,l,u){const h={label:o};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&Ze.string(l.label)&&(Ze.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(Ze.string(l.description)||l.description===void 0)}A(s,"is"),i.is=s})(dp||(dp={})),(function(i){function a(s){const o=s;return Ze.string(o)}A(a,"is"),i.is=a})(Ba||(Ba={})),(function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}A(a,"replace"),i.replace=a;function s(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}A(s,"insert"),i.insert=s;function o(u,h){return{range:u,newText:"",annotationId:h}}A(o,"del"),i.del=o;function l(u){const h=u;return kc.is(h)&&(dp.is(h.annotationId)||Ba.is(h.annotationId))}A(l,"is"),i.is=l})(Fu||(Fu={})),(function(i){function a(o,l){return{textDocument:o,edits:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&sw.is(l.textDocument)&&Array.isArray(l.edits)}A(s,"is"),i.is=s})(aw||(aw={})),(function(i){function a(o,l,u){let h={kind:"create",uri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="create"&&Ze.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||Ze.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||Ze.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||Ba.is(l.annotationId))}A(s,"is"),i.is=s})(wm||(wm={})),(function(i){function a(o,l,u,h){let d={kind:"rename",oldUri:o,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(d.options=u),h!==void 0&&(d.annotationId=h),d}A(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="rename"&&Ze.string(l.oldUri)&&Ze.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||Ze.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||Ze.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||Ba.is(l.annotationId))}A(s,"is"),i.is=s})(Cm||(Cm={})),(function(i){function a(o,l,u){let h={kind:"delete",uri:o};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="delete"&&Ze.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||Ze.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||Ze.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||Ba.is(l.annotationId))}A(s,"is"),i.is=s})(km||(km={})),(function(i){function a(s){let o=s;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(l=>Ze.string(l.kind)?wm.is(l)||Cm.is(l)||km.is(l):aw.is(l)))}A(a,"is"),i.is=a})(S3||(S3={})),xT=(t=class{constructor(a,s){this.edits=a,this.changeAnnotations=s}insert(a,s,o){let l,u;if(o===void 0?l=kc.insert(a,s):Ba.is(o)?(u=o,l=Fu.insert(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Fu.insert(a,s,u)),this.edits.push(l),u!==void 0)return u}replace(a,s,o){let l,u;if(o===void 0?l=kc.replace(a,s):Ba.is(o)?(u=o,l=Fu.replace(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Fu.replace(a,s,u)),this.edits.push(l),u!==void 0)return u}delete(a,s){let o,l;if(s===void 0?o=kc.del(a):Ba.is(s)?(l=s,o=Fu.del(a,s)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(s),o=Fu.del(a,l)),this.edits.push(o),l!==void 0)return l}add(a){this.edits.push(a)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(a){if(a===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},A(t,"TextEditChangeImpl"),t),lN=(e=class{constructor(a){this._annotations=a===void 0?Object.create(null):a,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(a,s){let o;if(Ba.is(a)?o=a:(o=this.nextId(),s=a),this._annotations[o]!==void 0)throw new Error(`Id ${o} is already in use.`);if(s===void 0)throw new Error(`No annotation provided for id ${o}`);return this._annotations[o]=s,this._size++,o}nextId(){return this._counter++,this._counter.toString()}},A(e,"ChangeAnnotations"),e),ibe=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new lN(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(s=>{if(aw.is(s)){const o=new xT(s.edits,this._changeAnnotations);this._textEditChanges[s.textDocument.uri]=o}})):a.changes&&Object.keys(a.changes).forEach(s=>{const o=new xT(a.changes[s]);this._textEditChanges[s]=o})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(a){if(sw.is(a)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const s={uri:a.uri,version:a.version};let o=this._textEditChanges[s.uri];if(!o){const l=[],u={textDocument:s,edits:l};this._workspaceEdit.documentChanges.push(u),o=new xT(l,this._changeAnnotations),this._textEditChanges[s.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let s=this._textEditChanges[a];if(!s){let o=[];this._workspaceEdit.changes[a]=o,s=new xT(o),this._textEditChanges[a]=s}return s}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new lN,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;dp.is(s)||Ba.is(s)?l=s:o=s;let u,h;if(l===void 0?u=wm.create(a,o):(h=Ba.is(l)?l:this._changeAnnotations.manage(l),u=wm.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(a,s,o,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;dp.is(o)||Ba.is(o)?u=o:l=o;let h,d;if(u===void 0?h=Cm.create(a,s,l):(d=Ba.is(u)?u:this._changeAnnotations.manage(u),h=Cm.create(a,s,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;dp.is(s)||Ba.is(s)?l=s:o=s;let u,h;if(l===void 0?u=km.create(a,o):(h=Ba.is(l)?l:this._changeAnnotations.manage(l),u=km.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},A(r,"WorkspaceChange"),r),(function(i){function a(o){return{uri:o}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.string(l.uri)}A(s,"is"),i.is=s})(OP||(OP={})),(function(i){function a(o,l){return{uri:o,version:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.string(l.uri)&&Ze.integer(l.version)}A(s,"is"),i.is=s})($P||($P={})),(function(i){function a(o,l){return{uri:o,version:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.string(l.uri)&&(l.version===null||Ze.integer(l.version))}A(s,"is"),i.is=s})(sw||(sw={})),(function(i){function a(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.string(l.uri)&&Ze.string(l.languageId)&&Ze.integer(l.version)&&Ze.string(l.text)}A(s,"is"),i.is=s})(PP||(PP={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(s){const o=s;return o===i.PlainText||o===i.Markdown}A(a,"is"),i.is=a})(E3||(E3={})),(function(i){function a(s){const o=s;return Ze.objectLiteral(s)&&E3.is(o.kind)&&Ze.string(o.value)}A(a,"is"),i.is=a})(Sm||(Sm={})),(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(BP||(BP={})),(function(i){i.PlainText=1,i.Snippet=2})(FP||(FP={})),(function(i){i.Deprecated=1})(zP||(zP={})),(function(i){function a(o,l,u){return{newText:o,insert:l,replace:u}}A(a,"create"),i.create=a;function s(o){const l=o;return l&&Ze.string(l.newText)&&jr.is(l.insert)&&jr.is(l.replace)}A(s,"is"),i.is=s})(VP||(VP={})),(function(i){i.asIs=1,i.adjustIndentation=2})(GP||(GP={})),(function(i){function a(s){const o=s;return o&&(Ze.string(o.detail)||o.detail===void 0)&&(Ze.string(o.description)||o.description===void 0)}A(a,"is"),i.is=a})(WP||(WP={})),(function(i){function a(s){return{label:s}}A(a,"create"),i.create=a})(HP||(HP={})),(function(i){function a(s,o){return{items:s||[],isIncomplete:!!o}}A(a,"create"),i.create=a})(qP||(qP={})),(function(i){function a(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}A(a,"fromPlainText"),i.fromPlainText=a;function s(o){const l=o;return Ze.string(l)||Ze.objectLiteral(l)&&Ze.string(l.language)&&Ze.string(l.value)}A(s,"is"),i.is=s})(ow||(ow={})),(function(i){function a(s){let o=s;return!!o&&Ze.objectLiteral(o)&&(Sm.is(o.contents)||ow.is(o.contents)||Ze.typedArray(o.contents,ow.is))&&(s.range===void 0||jr.is(s.range))}A(a,"is"),i.is=a})(UP||(UP={})),(function(i){function a(s,o){return o?{label:s,documentation:o}:{label:s}}A(a,"create"),i.create=a})(YP||(YP={})),(function(i){function a(s,o,...l){let u={label:s};return Ze.defined(o)&&(u.documentation=o),Ze.defined(l)?u.parameters=l:u.parameters=[],u}A(a,"create"),i.create=a})(XP||(XP={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(jP||(jP={})),(function(i){function a(s,o){let l={range:s};return Ze.number(o)&&(l.kind=o),l}A(a,"create"),i.create=a})(KP||(KP={})),(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(ZP||(ZP={})),(function(i){i.Deprecated=1})(QP||(QP={})),(function(i){function a(s,o,l,u,h){let d={name:s,kind:o,location:{uri:u,range:l}};return h&&(d.containerName=h),d}A(a,"create"),i.create=a})(JP||(JP={})),(function(i){function a(s,o,l,u){return u!==void 0?{name:s,kind:o,location:{uri:l,range:u}}:{name:s,kind:o,location:{uri:l}}}A(a,"create"),i.create=a})(e9||(e9={})),(function(i){function a(o,l,u,h,d,f){let p={name:o,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}A(a,"create"),i.create=a;function s(o){let l=o;return l&&Ze.string(l.name)&&Ze.number(l.kind)&&jr.is(l.range)&&jr.is(l.selectionRange)&&(l.detail===void 0||Ze.string(l.detail))&&(l.deprecated===void 0||Ze.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}A(s,"is"),i.is=s})(t9||(t9={})),(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(r9||(r9={})),(function(i){i.Invoked=1,i.Automatic=2})(lw||(lw={})),(function(i){function a(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.typedArray(l.diagnostics,iw.is)&&(l.only===void 0||Ze.typedArray(l.only,Ze.string))&&(l.triggerKind===void 0||l.triggerKind===lw.Invoked||l.triggerKind===lw.Automatic)}A(s,"is"),i.is=s})(n9||(n9={})),(function(i){function a(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):hp.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return l&&Ze.string(l.title)&&(l.diagnostics===void 0||Ze.typedArray(l.diagnostics,iw.is))&&(l.kind===void 0||Ze.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||hp.is(l.command))&&(l.isPreferred===void 0||Ze.boolean(l.isPreferred))&&(l.edit===void 0||S3.is(l.edit))}A(s,"is"),i.is=s})(i9||(i9={})),(function(i){function a(o,l){let u={range:o};return Ze.defined(l)&&(u.data=l),u}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&jr.is(l.range)&&(Ze.undefined(l.command)||hp.is(l.command))}A(s,"is"),i.is=s})(a9||(a9={})),(function(i){function a(o,l){return{tabSize:o,insertSpaces:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.uinteger(l.tabSize)&&Ze.boolean(l.insertSpaces)}A(s,"is"),i.is=s})(s9||(s9={})),(function(i){function a(o,l,u){return{range:o,target:l,data:u}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&jr.is(l.range)&&(Ze.undefined(l.target)||Ze.string(l.target))}A(s,"is"),i.is=s})(o9||(o9={})),(function(i){function a(o,l){return{range:o,parent:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.objectLiteral(l)&&jr.is(l.range)&&(l.parent===void 0||i.is(l.parent))}A(s,"is"),i.is=s})(l9||(l9={})),(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(c9||(c9={})),(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(u9||(u9={})),(function(i){function a(s){const o=s;return Ze.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}A(a,"is"),i.is=a})(h9||(h9={})),(function(i){function a(o,l){return{range:o,text:l}}A(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&jr.is(l.range)&&Ze.string(l.text)}A(s,"is"),i.is=s})(d9||(d9={})),(function(i){function a(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}A(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&jr.is(l.range)&&Ze.boolean(l.caseSensitiveLookup)&&(Ze.string(l.variableName)||l.variableName===void 0)}A(s,"is"),i.is=s})(f9||(f9={})),(function(i){function a(o,l){return{range:o,expression:l}}A(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&jr.is(l.range)&&(Ze.string(l.expression)||l.expression===void 0)}A(s,"is"),i.is=s})(p9||(p9={})),(function(i){function a(o,l){return{frameId:o,stoppedLocation:l}}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.defined(l)&&jr.is(o.stoppedLocation)}A(s,"is"),i.is=s})(g9||(g9={})),(function(i){i.Type=1,i.Parameter=2;function a(s){return s===1||s===2}A(a,"is"),i.is=a})(A3||(A3={})),(function(i){function a(o){return{value:o}}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&(l.tooltip===void 0||Ze.string(l.tooltip)||Sm.is(l.tooltip))&&(l.location===void 0||nw.is(l.location))&&(l.command===void 0||hp.is(l.command))}A(s,"is"),i.is=s})(_3||(_3={})),(function(i){function a(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&mn.is(l.position)&&(Ze.string(l.label)||Ze.typedArray(l.label,_3.is))&&(l.kind===void 0||A3.is(l.kind))&&l.textEdits===void 0||Ze.typedArray(l.textEdits,kc.is)&&(l.tooltip===void 0||Ze.string(l.tooltip)||Sm.is(l.tooltip))&&(l.paddingLeft===void 0||Ze.boolean(l.paddingLeft))&&(l.paddingRight===void 0||Ze.boolean(l.paddingRight))}A(s,"is"),i.is=s})(m9||(m9={})),(function(i){function a(s){return{kind:"snippet",value:s}}A(a,"createSnippet"),i.createSnippet=a})(y9||(y9={})),(function(i){function a(s,o,l,u){return{insertText:s,filterText:o,range:l,command:u}}A(a,"create"),i.create=a})(v9||(v9={})),(function(i){function a(s){return{items:s}}A(a,"create"),i.create=a})(b9||(b9={})),(function(i){i.Invoked=0,i.Automatic=1})(x9||(x9={})),(function(i){function a(s,o){return{range:s,text:o}}A(a,"create"),i.create=a})(T9||(T9={})),(function(i){function a(s,o){return{triggerKind:s,selectedCompletionInfo:o}}A(a,"create"),i.create=a})(w9||(w9={})),(function(i){function a(s){const o=s;return Ze.objectLiteral(o)&&w3.is(o.uri)&&Ze.string(o.name)}A(a,"is"),i.is=a})(C9||(C9={})),abe=[` +`},"getStyles"),Ayt=Eyt,_yt={parser:wyt,get db(){return new Cyt},renderer:ibe,styles:Ayt};const Ryt=Object.freeze(Object.defineProperty({__proto__:null,diagram:_yt},Symbol.toStringTag,{value:"Module"}));var jy,xW=(jy=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},x(jy,"ImperativeState"),jy);function eo(t,e){var r,n,i;t.accDescr&&((r=e.setAccDescription)==null||r.call(e,t.accDescr)),t.accTitle&&((n=e.setAccTitle)==null||n.call(e,t.accTitle)),t.title&&((i=e.setDiagramTitle)==null||i.call(e,t.title))}x(eo,"populateCommonDb");var Lyt=Object.create,kS=Object.defineProperty,Myt=Object.getOwnPropertyDescriptor,TW=Object.getOwnPropertyNames,Iyt=Object.getPrototypeOf,Nyt=Object.prototype.hasOwnProperty,A=(t,e)=>kS(t,"name",{value:e,configurable:!0}),Dyt=(t,e)=>function(){return t&&(e=(0,t[TW(t)[0]])(t=0)),e},Nr=(t,e)=>function(){return e||(0,t[TW(t)[0]])((e={exports:{}}).exports,e),e.exports},Df=(t,e)=>{for(var r in e)kS(t,r,{get:e[r],enumerable:!0})},wW=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of TW(e))!Nyt.call(t,i)&&i!==r&&kS(t,i,{get:()=>e[i],enumerable:!(n=Myt(e,i))||n.enumerable});return t},TL=(t,e,r)=>(wW(t,e,"default"),r),CW=(t,e,r)=>(r=t!=null?Lyt(Iyt(t)):{},wW(kS(r,"default",{value:t,enumerable:!0}),t)),kW=t=>wW(kS({},"__esModule",{value:!0}),t),wL={};Df(wL,{AnnotatedTextEdit:()=>Fu,ChangeAnnotation:()=>dp,ChangeAnnotationIdentifier:()=>Ba,CodeAction:()=>i9,CodeActionContext:()=>n9,CodeActionKind:()=>r9,CodeActionTriggerKind:()=>lw,CodeDescription:()=>DP,CodeLens:()=>a9,Color:()=>C3,ColorInformation:()=>_P,ColorPresentation:()=>RP,Command:()=>hp,CompletionItem:()=>HP,CompletionItemKind:()=>BP,CompletionItemLabelDetails:()=>WP,CompletionItemTag:()=>zP,CompletionList:()=>qP,CreateFile:()=>wm,DeleteFile:()=>km,Diagnostic:()=>iw,DiagnosticRelatedInformation:()=>k3,DiagnosticSeverity:()=>IP,DiagnosticTag:()=>NP,DocumentHighlight:()=>KP,DocumentHighlightKind:()=>jP,DocumentLink:()=>o9,DocumentSymbol:()=>t9,DocumentUri:()=>SP,EOL:()=>sbe,FoldingRange:()=>MP,FoldingRangeKind:()=>LP,FormattingOptions:()=>s9,Hover:()=>UP,InlayHint:()=>m9,InlayHintKind:()=>A3,InlayHintLabelPart:()=>_3,InlineCompletionContext:()=>w9,InlineCompletionItem:()=>v9,InlineCompletionList:()=>b9,InlineCompletionTriggerKind:()=>x9,InlineValueContext:()=>g9,InlineValueEvaluatableExpression:()=>p9,InlineValueText:()=>d9,InlineValueVariableLookup:()=>f9,InsertReplaceEdit:()=>VP,InsertTextFormat:()=>FP,InsertTextMode:()=>GP,Location:()=>nw,LocationLink:()=>AP,MarkedString:()=>ow,MarkupContent:()=>Sm,MarkupKind:()=>E3,OptionalVersionedTextDocumentIdentifier:()=>sw,ParameterInformation:()=>YP,Position:()=>mn,Range:()=>jr,RenameFile:()=>Cm,SelectedCompletionInfo:()=>T9,SelectionRange:()=>l9,SemanticTokenModifiers:()=>u9,SemanticTokenTypes:()=>c9,SemanticTokens:()=>h9,SignatureInformation:()=>XP,StringValue:()=>y9,SymbolInformation:()=>JP,SymbolKind:()=>ZP,SymbolTag:()=>QP,TextDocument:()=>k9,TextDocumentEdit:()=>aw,TextDocumentIdentifier:()=>OP,TextDocumentItem:()=>PP,TextEdit:()=>kc,URI:()=>w3,VersionedTextDocumentIdentifier:()=>$P,WorkspaceChange:()=>abe,WorkspaceEdit:()=>S3,WorkspaceFolder:()=>C9,WorkspaceSymbol:()=>e9,integer:()=>EP,uinteger:()=>rw});var SP,w3,EP,rw,mn,jr,nw,AP,C3,_P,RP,LP,MP,k3,IP,NP,DP,iw,hp,kc,dp,Ba,Fu,aw,wm,Cm,km,S3,xT,lN,abe,OP,$P,sw,PP,E3,Sm,BP,FP,zP,VP,GP,WP,HP,qP,ow,UP,YP,XP,jP,KP,ZP,QP,JP,e9,t9,r9,lw,n9,i9,a9,s9,o9,l9,c9,u9,h9,d9,f9,p9,g9,A3,_3,m9,y9,v9,b9,x9,T9,w9,C9,sbe,k9,Lte,Ze,SS=Dyt({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(i){function a(s){return typeof s=="string"}A(a,"is"),i.is=a})(SP||(SP={})),(function(i){function a(s){return typeof s=="string"}A(a,"is"),i.is=a})(w3||(w3={})),(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}A(a,"is"),i.is=a})(EP||(EP={})),(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}A(a,"is"),i.is=a})(rw||(rw={})),(function(i){function a(o,l){return o===Number.MAX_VALUE&&(o=rw.MAX_VALUE),l===Number.MAX_VALUE&&(l=rw.MAX_VALUE),{line:o,character:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.objectLiteral(l)&&Ze.uinteger(l.line)&&Ze.uinteger(l.character)}A(s,"is"),i.is=s})(mn||(mn={})),(function(i){function a(o,l,u,h){if(Ze.uinteger(o)&&Ze.uinteger(l)&&Ze.uinteger(u)&&Ze.uinteger(h))return{start:mn.create(o,l),end:mn.create(u,h)};if(mn.is(o)&&mn.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.objectLiteral(l)&&mn.is(l.start)&&mn.is(l.end)}A(s,"is"),i.is=s})(jr||(jr={})),(function(i){function a(o,l){return{uri:o,range:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.objectLiteral(l)&&jr.is(l.range)&&(Ze.string(l.uri)||Ze.undefined(l.uri))}A(s,"is"),i.is=s})(nw||(nw={})),(function(i){function a(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.objectLiteral(l)&&jr.is(l.targetRange)&&Ze.string(l.targetUri)&&jr.is(l.targetSelectionRange)&&(jr.is(l.originSelectionRange)||Ze.undefined(l.originSelectionRange))}A(s,"is"),i.is=s})(AP||(AP={})),(function(i){function a(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&Ze.numberRange(l.red,0,1)&&Ze.numberRange(l.green,0,1)&&Ze.numberRange(l.blue,0,1)&&Ze.numberRange(l.alpha,0,1)}A(s,"is"),i.is=s})(C3||(C3={})),(function(i){function a(o,l){return{range:o,color:l}}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&jr.is(l.range)&&C3.is(l.color)}A(s,"is"),i.is=s})(_P||(_P={})),(function(i){function a(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&Ze.string(l.label)&&(Ze.undefined(l.textEdit)||kc.is(l))&&(Ze.undefined(l.additionalTextEdits)||Ze.typedArray(l.additionalTextEdits,kc.is))}A(s,"is"),i.is=s})(RP||(RP={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(LP||(LP={})),(function(i){function a(o,l,u,h,d,f){const p={startLine:o,endLine:l};return Ze.defined(u)&&(p.startCharacter=u),Ze.defined(h)&&(p.endCharacter=h),Ze.defined(d)&&(p.kind=d),Ze.defined(f)&&(p.collapsedText=f),p}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&Ze.uinteger(l.startLine)&&Ze.uinteger(l.startLine)&&(Ze.undefined(l.startCharacter)||Ze.uinteger(l.startCharacter))&&(Ze.undefined(l.endCharacter)||Ze.uinteger(l.endCharacter))&&(Ze.undefined(l.kind)||Ze.string(l.kind))}A(s,"is"),i.is=s})(MP||(MP={})),(function(i){function a(o,l){return{location:o,message:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&nw.is(l.location)&&Ze.string(l.message)}A(s,"is"),i.is=s})(k3||(k3={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(IP||(IP={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(NP||(NP={})),(function(i){function a(s){const o=s;return Ze.objectLiteral(o)&&Ze.string(o.href)}A(a,"is"),i.is=a})(DP||(DP={})),(function(i){function a(o,l,u,h,d,f){let p={range:o,message:l};return Ze.defined(u)&&(p.severity=u),Ze.defined(h)&&(p.code=h),Ze.defined(d)&&(p.source=d),Ze.defined(f)&&(p.relatedInformation=f),p}A(a,"create"),i.create=a;function s(o){var l;let u=o;return Ze.defined(u)&&jr.is(u.range)&&Ze.string(u.message)&&(Ze.number(u.severity)||Ze.undefined(u.severity))&&(Ze.integer(u.code)||Ze.string(u.code)||Ze.undefined(u.code))&&(Ze.undefined(u.codeDescription)||Ze.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(Ze.string(u.source)||Ze.undefined(u.source))&&(Ze.undefined(u.relatedInformation)||Ze.typedArray(u.relatedInformation,k3.is))}A(s,"is"),i.is=s})(iw||(iw={})),(function(i){function a(o,l,...u){let h={title:o,command:l};return Ze.defined(u)&&u.length>0&&(h.arguments=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.string(l.title)&&Ze.string(l.command)}A(s,"is"),i.is=s})(hp||(hp={})),(function(i){function a(u,h){return{range:u,newText:h}}A(a,"replace"),i.replace=a;function s(u,h){return{range:{start:u,end:u},newText:h}}A(s,"insert"),i.insert=s;function o(u){return{range:u,newText:""}}A(o,"del"),i.del=o;function l(u){const h=u;return Ze.objectLiteral(h)&&Ze.string(h.newText)&&jr.is(h.range)}A(l,"is"),i.is=l})(kc||(kc={})),(function(i){function a(o,l,u){const h={label:o};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&Ze.string(l.label)&&(Ze.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(Ze.string(l.description)||l.description===void 0)}A(s,"is"),i.is=s})(dp||(dp={})),(function(i){function a(s){const o=s;return Ze.string(o)}A(a,"is"),i.is=a})(Ba||(Ba={})),(function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}A(a,"replace"),i.replace=a;function s(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}A(s,"insert"),i.insert=s;function o(u,h){return{range:u,newText:"",annotationId:h}}A(o,"del"),i.del=o;function l(u){const h=u;return kc.is(h)&&(dp.is(h.annotationId)||Ba.is(h.annotationId))}A(l,"is"),i.is=l})(Fu||(Fu={})),(function(i){function a(o,l){return{textDocument:o,edits:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&sw.is(l.textDocument)&&Array.isArray(l.edits)}A(s,"is"),i.is=s})(aw||(aw={})),(function(i){function a(o,l,u){let h={kind:"create",uri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="create"&&Ze.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||Ze.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||Ze.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||Ba.is(l.annotationId))}A(s,"is"),i.is=s})(wm||(wm={})),(function(i){function a(o,l,u,h){let d={kind:"rename",oldUri:o,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(d.options=u),h!==void 0&&(d.annotationId=h),d}A(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="rename"&&Ze.string(l.oldUri)&&Ze.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||Ze.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||Ze.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||Ba.is(l.annotationId))}A(s,"is"),i.is=s})(Cm||(Cm={})),(function(i){function a(o,l,u){let h={kind:"delete",uri:o};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="delete"&&Ze.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||Ze.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||Ze.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||Ba.is(l.annotationId))}A(s,"is"),i.is=s})(km||(km={})),(function(i){function a(s){let o=s;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(l=>Ze.string(l.kind)?wm.is(l)||Cm.is(l)||km.is(l):aw.is(l)))}A(a,"is"),i.is=a})(S3||(S3={})),xT=(t=class{constructor(a,s){this.edits=a,this.changeAnnotations=s}insert(a,s,o){let l,u;if(o===void 0?l=kc.insert(a,s):Ba.is(o)?(u=o,l=Fu.insert(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Fu.insert(a,s,u)),this.edits.push(l),u!==void 0)return u}replace(a,s,o){let l,u;if(o===void 0?l=kc.replace(a,s):Ba.is(o)?(u=o,l=Fu.replace(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Fu.replace(a,s,u)),this.edits.push(l),u!==void 0)return u}delete(a,s){let o,l;if(s===void 0?o=kc.del(a):Ba.is(s)?(l=s,o=Fu.del(a,s)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(s),o=Fu.del(a,l)),this.edits.push(o),l!==void 0)return l}add(a){this.edits.push(a)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(a){if(a===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},A(t,"TextEditChangeImpl"),t),lN=(e=class{constructor(a){this._annotations=a===void 0?Object.create(null):a,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(a,s){let o;if(Ba.is(a)?o=a:(o=this.nextId(),s=a),this._annotations[o]!==void 0)throw new Error(`Id ${o} is already in use.`);if(s===void 0)throw new Error(`No annotation provided for id ${o}`);return this._annotations[o]=s,this._size++,o}nextId(){return this._counter++,this._counter.toString()}},A(e,"ChangeAnnotations"),e),abe=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new lN(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(s=>{if(aw.is(s)){const o=new xT(s.edits,this._changeAnnotations);this._textEditChanges[s.textDocument.uri]=o}})):a.changes&&Object.keys(a.changes).forEach(s=>{const o=new xT(a.changes[s]);this._textEditChanges[s]=o})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(a){if(sw.is(a)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const s={uri:a.uri,version:a.version};let o=this._textEditChanges[s.uri];if(!o){const l=[],u={textDocument:s,edits:l};this._workspaceEdit.documentChanges.push(u),o=new xT(l,this._changeAnnotations),this._textEditChanges[s.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let s=this._textEditChanges[a];if(!s){let o=[];this._workspaceEdit.changes[a]=o,s=new xT(o),this._textEditChanges[a]=s}return s}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new lN,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;dp.is(s)||Ba.is(s)?l=s:o=s;let u,h;if(l===void 0?u=wm.create(a,o):(h=Ba.is(l)?l:this._changeAnnotations.manage(l),u=wm.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(a,s,o,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;dp.is(o)||Ba.is(o)?u=o:l=o;let h,d;if(u===void 0?h=Cm.create(a,s,l):(d=Ba.is(u)?u:this._changeAnnotations.manage(u),h=Cm.create(a,s,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;dp.is(s)||Ba.is(s)?l=s:o=s;let u,h;if(l===void 0?u=km.create(a,o):(h=Ba.is(l)?l:this._changeAnnotations.manage(l),u=km.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},A(r,"WorkspaceChange"),r),(function(i){function a(o){return{uri:o}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.string(l.uri)}A(s,"is"),i.is=s})(OP||(OP={})),(function(i){function a(o,l){return{uri:o,version:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.string(l.uri)&&Ze.integer(l.version)}A(s,"is"),i.is=s})($P||($P={})),(function(i){function a(o,l){return{uri:o,version:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.string(l.uri)&&(l.version===null||Ze.integer(l.version))}A(s,"is"),i.is=s})(sw||(sw={})),(function(i){function a(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.string(l.uri)&&Ze.string(l.languageId)&&Ze.integer(l.version)&&Ze.string(l.text)}A(s,"is"),i.is=s})(PP||(PP={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(s){const o=s;return o===i.PlainText||o===i.Markdown}A(a,"is"),i.is=a})(E3||(E3={})),(function(i){function a(s){const o=s;return Ze.objectLiteral(s)&&E3.is(o.kind)&&Ze.string(o.value)}A(a,"is"),i.is=a})(Sm||(Sm={})),(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(BP||(BP={})),(function(i){i.PlainText=1,i.Snippet=2})(FP||(FP={})),(function(i){i.Deprecated=1})(zP||(zP={})),(function(i){function a(o,l,u){return{newText:o,insert:l,replace:u}}A(a,"create"),i.create=a;function s(o){const l=o;return l&&Ze.string(l.newText)&&jr.is(l.insert)&&jr.is(l.replace)}A(s,"is"),i.is=s})(VP||(VP={})),(function(i){i.asIs=1,i.adjustIndentation=2})(GP||(GP={})),(function(i){function a(s){const o=s;return o&&(Ze.string(o.detail)||o.detail===void 0)&&(Ze.string(o.description)||o.description===void 0)}A(a,"is"),i.is=a})(WP||(WP={})),(function(i){function a(s){return{label:s}}A(a,"create"),i.create=a})(HP||(HP={})),(function(i){function a(s,o){return{items:s||[],isIncomplete:!!o}}A(a,"create"),i.create=a})(qP||(qP={})),(function(i){function a(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}A(a,"fromPlainText"),i.fromPlainText=a;function s(o){const l=o;return Ze.string(l)||Ze.objectLiteral(l)&&Ze.string(l.language)&&Ze.string(l.value)}A(s,"is"),i.is=s})(ow||(ow={})),(function(i){function a(s){let o=s;return!!o&&Ze.objectLiteral(o)&&(Sm.is(o.contents)||ow.is(o.contents)||Ze.typedArray(o.contents,ow.is))&&(s.range===void 0||jr.is(s.range))}A(a,"is"),i.is=a})(UP||(UP={})),(function(i){function a(s,o){return o?{label:s,documentation:o}:{label:s}}A(a,"create"),i.create=a})(YP||(YP={})),(function(i){function a(s,o,...l){let u={label:s};return Ze.defined(o)&&(u.documentation=o),Ze.defined(l)?u.parameters=l:u.parameters=[],u}A(a,"create"),i.create=a})(XP||(XP={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(jP||(jP={})),(function(i){function a(s,o){let l={range:s};return Ze.number(o)&&(l.kind=o),l}A(a,"create"),i.create=a})(KP||(KP={})),(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(ZP||(ZP={})),(function(i){i.Deprecated=1})(QP||(QP={})),(function(i){function a(s,o,l,u,h){let d={name:s,kind:o,location:{uri:u,range:l}};return h&&(d.containerName=h),d}A(a,"create"),i.create=a})(JP||(JP={})),(function(i){function a(s,o,l,u){return u!==void 0?{name:s,kind:o,location:{uri:l,range:u}}:{name:s,kind:o,location:{uri:l}}}A(a,"create"),i.create=a})(e9||(e9={})),(function(i){function a(o,l,u,h,d,f){let p={name:o,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}A(a,"create"),i.create=a;function s(o){let l=o;return l&&Ze.string(l.name)&&Ze.number(l.kind)&&jr.is(l.range)&&jr.is(l.selectionRange)&&(l.detail===void 0||Ze.string(l.detail))&&(l.deprecated===void 0||Ze.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}A(s,"is"),i.is=s})(t9||(t9={})),(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(r9||(r9={})),(function(i){i.Invoked=1,i.Automatic=2})(lw||(lw={})),(function(i){function a(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.typedArray(l.diagnostics,iw.is)&&(l.only===void 0||Ze.typedArray(l.only,Ze.string))&&(l.triggerKind===void 0||l.triggerKind===lw.Invoked||l.triggerKind===lw.Automatic)}A(s,"is"),i.is=s})(n9||(n9={})),(function(i){function a(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):hp.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return l&&Ze.string(l.title)&&(l.diagnostics===void 0||Ze.typedArray(l.diagnostics,iw.is))&&(l.kind===void 0||Ze.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||hp.is(l.command))&&(l.isPreferred===void 0||Ze.boolean(l.isPreferred))&&(l.edit===void 0||S3.is(l.edit))}A(s,"is"),i.is=s})(i9||(i9={})),(function(i){function a(o,l){let u={range:o};return Ze.defined(l)&&(u.data=l),u}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&jr.is(l.range)&&(Ze.undefined(l.command)||hp.is(l.command))}A(s,"is"),i.is=s})(a9||(a9={})),(function(i){function a(o,l){return{tabSize:o,insertSpaces:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.uinteger(l.tabSize)&&Ze.boolean(l.insertSpaces)}A(s,"is"),i.is=s})(s9||(s9={})),(function(i){function a(o,l,u){return{range:o,target:l,data:u}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&jr.is(l.range)&&(Ze.undefined(l.target)||Ze.string(l.target))}A(s,"is"),i.is=s})(o9||(o9={})),(function(i){function a(o,l){return{range:o,parent:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.objectLiteral(l)&&jr.is(l.range)&&(l.parent===void 0||i.is(l.parent))}A(s,"is"),i.is=s})(l9||(l9={})),(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(c9||(c9={})),(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(u9||(u9={})),(function(i){function a(s){const o=s;return Ze.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}A(a,"is"),i.is=a})(h9||(h9={})),(function(i){function a(o,l){return{range:o,text:l}}A(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&jr.is(l.range)&&Ze.string(l.text)}A(s,"is"),i.is=s})(d9||(d9={})),(function(i){function a(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}A(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&jr.is(l.range)&&Ze.boolean(l.caseSensitiveLookup)&&(Ze.string(l.variableName)||l.variableName===void 0)}A(s,"is"),i.is=s})(f9||(f9={})),(function(i){function a(o,l){return{range:o,expression:l}}A(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&jr.is(l.range)&&(Ze.string(l.expression)||l.expression===void 0)}A(s,"is"),i.is=s})(p9||(p9={})),(function(i){function a(o,l){return{frameId:o,stoppedLocation:l}}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.defined(l)&&jr.is(o.stoppedLocation)}A(s,"is"),i.is=s})(g9||(g9={})),(function(i){i.Type=1,i.Parameter=2;function a(s){return s===1||s===2}A(a,"is"),i.is=a})(A3||(A3={})),(function(i){function a(o){return{value:o}}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&(l.tooltip===void 0||Ze.string(l.tooltip)||Sm.is(l.tooltip))&&(l.location===void 0||nw.is(l.location))&&(l.command===void 0||hp.is(l.command))}A(s,"is"),i.is=s})(_3||(_3={})),(function(i){function a(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&mn.is(l.position)&&(Ze.string(l.label)||Ze.typedArray(l.label,_3.is))&&(l.kind===void 0||A3.is(l.kind))&&l.textEdits===void 0||Ze.typedArray(l.textEdits,kc.is)&&(l.tooltip===void 0||Ze.string(l.tooltip)||Sm.is(l.tooltip))&&(l.paddingLeft===void 0||Ze.boolean(l.paddingLeft))&&(l.paddingRight===void 0||Ze.boolean(l.paddingRight))}A(s,"is"),i.is=s})(m9||(m9={})),(function(i){function a(s){return{kind:"snippet",value:s}}A(a,"createSnippet"),i.createSnippet=a})(y9||(y9={})),(function(i){function a(s,o,l,u){return{insertText:s,filterText:o,range:l,command:u}}A(a,"create"),i.create=a})(v9||(v9={})),(function(i){function a(s){return{items:s}}A(a,"create"),i.create=a})(b9||(b9={})),(function(i){i.Invoked=0,i.Automatic=1})(x9||(x9={})),(function(i){function a(s,o){return{range:s,text:o}}A(a,"create"),i.create=a})(T9||(T9={})),(function(i){function a(s,o){return{triggerKind:s,selectedCompletionInfo:o}}A(a,"create"),i.create=a})(w9||(w9={})),(function(i){function a(s){const o=s;return Ze.objectLiteral(o)&&w3.is(o.uri)&&Ze.string(o.name)}A(a,"is"),i.is=a})(C9||(C9={})),sbe=[` `,`\r -`,"\r"],(function(i){function a(u,h,d,f){return new Rte(u,h,d,f)}A(a,"create"),i.create=a;function s(u){let h=u;return!!(Ze.defined(h)&&Ze.string(h.uri)&&(Ze.undefined(h.languageId)||Ze.string(h.languageId))&&Ze.uinteger(h.lineCount)&&Ze.func(h.getText)&&Ze.func(h.positionAt)&&Ze.func(h.offsetAt))}A(s,"is"),i.is=s;function o(u,h){let d=u.getText(),f=l(h,(g,m)=>{let y=g.range.start.line-m.range.start.line;return y===0?g.range.start.character-m.range.start.character:y}),p=d.length;for(let g=f.length-1;g>=0;g--){let m=f[g],y=u.offsetAt(m.range.start),v=u.offsetAt(m.range.end);if(v<=p)d=d.substring(0,y)+m.newText+d.substring(v,d.length);else throw new Error("Overlapping edit");p=y}return d}A(o,"applyEdits"),i.applyEdits=o;function l(u,h){if(u.length<=1)return u;const d=u.length/2|0,f=u.slice(0,d),p=u.slice(d);l(f,h),l(p,h);let g=0,m=0,y=0;for(;g{let y=g.range.start.line-m.range.start.line;return y===0?g.range.start.character-m.range.start.character:y}),p=d.length;for(let g=f.length-1;g>=0;g--){let m=f[g],y=u.offsetAt(m.range.start),v=u.offsetAt(m.range.end);if(v<=p)d=d.substring(0,y)+m.newText+d.substring(v,d.length);else throw new Error("Overlapping edit");p=y}return d}A(o,"applyEdits"),i.applyEdits=o;function l(u,h){if(u.length<=1)return u;const d=u.length/2|0,f=u.slice(0,d),p=u.slice(d);l(f,h),l(p,h);let g=0,m=0,y=0;for(;g0&&a.push(s.length),this._lineOffsets=a}return this._lineOffsets}positionAt(a){a=Math.max(Math.min(a,this._content.length),0);let s=this.getLineOffsets(),o=0,l=s.length;if(l===0)return mn.create(0,a);for(;oa?l=h:o=h+1}let u=o-1;return mn.create(u,a-s[u])}offsetAt(a){let s=this.getLineOffsets();if(a.line>=s.length)return this._content.length;if(a.line<0)return 0;let o=s[a.line],l=a.line+1"u"}A(o,"undefined"),i.undefined=o;function l(v){return v===!0||v===!1}A(l,"boolean"),i.boolean=l;function u(v){return a.call(v)==="[object String]"}A(u,"string"),i.string=u;function h(v){return a.call(v)==="[object Number]"}A(h,"number"),i.number=h;function d(v,T,b){return a.call(v)==="[object Number]"&&T<=v&&v<=b}A(d,"numberRange"),i.numberRange=d;function f(v){return a.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}A(f,"integer"),i.integer=f;function p(v){return a.call(v)==="[object Number]"&&0<=v&&v<=2147483647}A(p,"uinteger"),i.uinteger=p;function g(v){return a.call(v)==="[object Function]"}A(g,"func"),i.func=g;function m(v){return v!==null&&typeof v=="object"}A(m,"objectLiteral"),i.objectLiteral=m;function y(v,T){return Array.isArray(v)&&v.every(T)}A(y,"typedArray"),i.typedArray=y})(Ze||(Ze={}))}}),yg=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}A(r,"RAL"),(function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");e=a}A(i,"install"),n.install=i})(r||(r={})),t.default=r}}),ES=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}A(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}A(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}A(n,"number"),t.number=n;function i(l){return l instanceof Error}A(i,"error"),t.error=i;function a(l){return typeof l=="function"}A(a,"func"),t.func=a;function s(l){return Array.isArray(l)}A(s,"array"),t.array=s;function o(l){return s(l)&&l.every(u=>r(u))}A(o,"stringArray"),t.stringArray=o}}),$x=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var a,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=yg(),r;(function(o){const l={dispose(){}};o.None=function(){return l}})(r||(t.Event=r={}));var n=(a=class{add(l,u=null,h){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(h)&&h.push({dispose:A(()=>this.remove(l,u),"dispose")})}remove(l,u=null){if(!this._callbacks)return;let h=!1;for(let d=0,f=this._callbacks.length;d{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,u);const d={dispose:A(()=>{this._callbacks&&(this._callbacks.remove(l,u),d.dispose=s._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(h)&&h.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},A(s,"Emitter"),s);t.Emitter=i,i._noop=function(){}}}),CL=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,u;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=yg(),r=ES(),n=$x(),i;(function(h){h.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),h.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function d(f){const p=f;return p&&(p===h.None||p===h.Cancelled||r.boolean(p.isCancellationRequested)&&!!p.onCancellationRequested)}A(d,"is"),h.is=d})(i||(t.CancellationToken=i={}));var a=Object.freeze(function(h,d){const f=(0,e.default)().timer.setTimeout(h.bind(d),0);return{dispose(){f.dispose()}}}),s=(l=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},A(l,"MutableToken"),l),o=(u=class{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}},A(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),sbe=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge,ee,Re,Ie,Be;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var e=ES(),r;(function(ce){ce.ParseError=-32700,ce.InvalidRequest=-32600,ce.MethodNotFound=-32601,ce.InvalidParams=-32602,ce.InternalError=-32603,ce.jsonrpcReservedErrorRangeStart=-32099,ce.serverErrorStart=-32099,ce.MessageWriteError=-32099,ce.MessageReadError=-32098,ce.PendingResponseRejected=-32097,ce.ConnectionInactive=-32096,ce.ServerNotInitialized=-32002,ce.UnknownErrorCode=-32001,ce.jsonrpcReservedErrorRangeEnd=-32e3,ce.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(D=class extends Error{constructor(oe,be,fe){super(be),this.code=e.number(oe)?oe:r.UnknownErrorCode,this.data=fe,Object.setPrototypeOf(this,D.prototype)}toJson(){const oe={code:this.code,message:this.message};return this.data!==void 0&&(oe.data=this.data),oe}},A(D,"ResponseError"),D);t.ResponseError=n;var i=(R=class{constructor(oe){this.kind=oe}static is(oe){return oe===R.auto||oe===R.byName||oe===R.byPosition}toString(){return this.kind}},A(R,"ParameterStructures"),R);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=(I=class{constructor(oe,be){this.method=oe,this.numberOfParams=be}get parameterStructures(){return i.auto}},A(I,"AbstractMessageSignature"),I);t.AbstractMessageSignature=a;var s=($=class extends a{constructor(oe){super(oe,0)}},A($,"RequestType0"),$);t.RequestType0=s;var o=(O=class extends a{constructor(oe,be=i.auto){super(oe,1),this._parameterStructures=be}get parameterStructures(){return this._parameterStructures}},A(O,"RequestType"),O);t.RequestType=o;var l=(N=class extends a{constructor(oe,be=i.auto){super(oe,1),this._parameterStructures=be}get parameterStructures(){return this._parameterStructures}},A(N,"RequestType1"),N);t.RequestType1=l;var u=(F=class extends a{constructor(oe){super(oe,2)}},A(F,"RequestType2"),F);t.RequestType2=u;var h=(z=class extends a{constructor(oe){super(oe,3)}},A(z,"RequestType3"),z);t.RequestType3=h;var d=(V=class extends a{constructor(oe){super(oe,4)}},A(V,"RequestType4"),V);t.RequestType4=d;var f=(B=class extends a{constructor(oe){super(oe,5)}},A(B,"RequestType5"),B);t.RequestType5=f;var p=(G=class extends a{constructor(oe){super(oe,6)}},A(G,"RequestType6"),G);t.RequestType6=p;var g=(H=class extends a{constructor(oe){super(oe,7)}},A(H,"RequestType7"),H);t.RequestType7=g;var m=(q=class extends a{constructor(oe){super(oe,8)}},A(q,"RequestType8"),q);t.RequestType8=m;var y=(Z=class extends a{constructor(oe){super(oe,9)}},A(Z,"RequestType9"),Z);t.RequestType9=y;var v=(Y=class extends a{constructor(oe,be=i.auto){super(oe,1),this._parameterStructures=be}get parameterStructures(){return this._parameterStructures}},A(Y,"NotificationType"),Y);t.NotificationType=v;var T=(ie=class extends a{constructor(oe){super(oe,0)}},A(ie,"NotificationType0"),ie);t.NotificationType0=T;var b=(K=class extends a{constructor(oe,be=i.auto){super(oe,1),this._parameterStructures=be}get parameterStructures(){return this._parameterStructures}},A(K,"NotificationType1"),K);t.NotificationType1=b;var w=(Q=class extends a{constructor(oe){super(oe,2)}},A(Q,"NotificationType2"),Q);t.NotificationType2=w;var C=(te=class extends a{constructor(oe){super(oe,3)}},A(te,"NotificationType3"),te);t.NotificationType3=C;var S=(J=class extends a{constructor(oe){super(oe,4)}},A(J,"NotificationType4"),J);t.NotificationType4=S;var k=(ge=class extends a{constructor(oe){super(oe,5)}},A(ge,"NotificationType5"),ge);t.NotificationType5=k;var E=(ee=class extends a{constructor(oe){super(oe,6)}},A(ee,"NotificationType6"),ee);t.NotificationType6=E;var _=(Re=class extends a{constructor(oe){super(oe,7)}},A(Re,"NotificationType7"),Re);t.NotificationType7=_;var M=(Ie=class extends a{constructor(oe){super(oe,8)}},A(Ie,"NotificationType8"),Ie);t.NotificationType8=M;var L=(Be=class extends a{constructor(oe){super(oe,9)}},A(Be,"NotificationType9"),Be);t.NotificationType9=L;var P;(function(ce){function oe(Pe){const ve=Pe;return ve&&e.string(ve.method)&&(e.string(ve.id)||e.number(ve.id))}A(oe,"isRequest"),ce.isRequest=oe;function be(Pe){const ve=Pe;return ve&&e.string(ve.method)&&Pe.id===void 0}A(be,"isNotification"),ce.isNotification=be;function fe(Pe){const ve=Pe;return ve&&(ve.result!==void 0||!!ve.error)&&(e.string(ve.id)||e.number(ve.id)||ve.id===null)}A(fe,"isResponse"),ce.isResponse=fe})(P||(t.Message=P={}))}}),obe=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var a,s;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(r||(t.Touch=r={}));var n=(a=class{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}has(l){return this._map.has(l)}get(l,u=r.None){const h=this._map.get(l);if(h)return u!==r.None&&this.touch(h,u),h.value}set(l,u,h=r.None){let d=this._map.get(l);if(d)d.value=u,h!==r.None&&this.touch(d,h);else{switch(d={key:l,value:u,next:void 0,previous:void 0},h){case r.None:this.addItemLast(d);break;case r.First:this.addItemFirst(d);break;case r.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(l,d),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const u=this._map.get(l);if(u)return this._map.delete(l),this.removeItem(u),this._size--,u.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,u){const h=this._state;let d=this._head;for(;d;){if(u?l.bind(u)(d.value,d.key,this):l(d.value,d.key,this),this._state!==h)throw new Error("LinkedMap got modified during iteration.");d=d.next}}keys(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:A(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.key,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}values(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:A(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.value,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}entries(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:A(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:[u.key,u.value],done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let u=this._head,h=this.size;for(;u&&h>l;)this._map.delete(u.key),u=u.next,h--;this._head=u,this._size=h,u&&(u.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const u=l.next,h=l.previous;if(!u||!h)throw new Error("Invalid list");u.previous=h,h.next=u}l.next=void 0,l.previous=void 0,this._state++}touch(l,u){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(u!==r.First&&u!==r.Last)){if(u===r.First){if(l===this._head)return;const h=l.next,d=l.previous;l===this._tail?(d.next=void 0,this._tail=d):(h.previous=d,d.next=h),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(u===r.Last){if(l===this._tail)return;const h=l.next,d=l.previous;l===this._head?(h.previous=void 0,this._head=h):(h.previous=d,d.next=h),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((u,h)=>{l.push([h,u])}),l}fromJSON(l){this.clear();for(const[u,h]of l)this.set(u,h)}},A(a,"LinkedMap"),a);t.LinkedMap=n;var i=(s=class extends n{constructor(l,u=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,u),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,u=r.AsNew){return super.get(l,u)}peek(l){return super.get(l,r.None)}set(l,u){return super.set(l,u,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},A(s,"LRUCache"),s);t.LRUCache=i}}),Iyt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function n(i){return{dispose:i}}A(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),Nyt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var o,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=CL(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(o=class{constructor(){this.buffers=new Map}enableCancellation(f){if(f.id===null)return;const p=new SharedArrayBuffer(4),g=new Int32Array(p,0,1);g[0]=r.Continue,this.buffers.set(f.id,p),f.$cancellationData=p}async sendCancellation(f,p){const g=this.buffers.get(p);if(g===void 0)return;const m=new Int32Array(g,0,1);Atomics.store(m,0,r.Cancelled)}cleanup(f){this.buffers.delete(f)}dispose(){this.buffers.clear()}},A(o,"SharedArraySenderStrategy"),o);t.SharedArraySenderStrategy=n;var i=(l=class{constructor(f){this.data=new Int32Array(f,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},A(l,"SharedArrayBufferCancellationToken"),l),a=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},A(u,"SharedArrayBufferCancellationTokenSource"),u),s=(h=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new a(p)}},A(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=s}}),lbe=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var e=yg(),r=(n=class{constructor(a=1){if(a<=0)throw new Error("Capacity must be greater than 0");this._capacity=a,this._active=0,this._waiting=[]}lock(a){return new Promise((s,o)=>{this._waiting.push({thunk:a,resolve:s,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const a=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const s=a.thunk();s instanceof Promise?s.then(o=>{this._active--,a.resolve(o),this.runNext()},o=>{this._active--,a.reject(o),this.runNext()}):(this._active--,a.resolve(s),this.runNext())}catch(s){this._active--,a.reject(s),this.runNext()}}},A(n,"Semaphore"),n);t.Semaphore=r}}),Dyt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=yg(),r=ES(),n=$x(),i=lbe(),a;(function(d){function f(p){let g=p;return g&&r.func(g.listen)&&r.func(g.dispose)&&r.func(g.onError)&&r.func(g.onClose)&&r.func(g.onPartialMessage)}A(f,"is"),d.is=f})(a||(t.MessageReader=a={}));var s=(u=class{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f){this.errorEmitter.fire(this.asError(f))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(f){this.partialMessageEmitter.fire(f)}asError(f){return f instanceof Error?f:new Error(`Reader received error. Reason: ${r.string(f.message)?f.message:"unknown"}`)}},A(u,"AbstractMessageReader"),u);t.AbstractMessageReader=s;var o;(function(d){function f(p){let g,m;const y=new Map;let v;const T=new Map;if(p===void 0||typeof p=="string")g=p??"utf-8";else{if(g=p.charset??"utf-8",p.contentDecoder!==void 0&&(m=p.contentDecoder,y.set(m.name,m)),p.contentDecoders!==void 0)for(const b of p.contentDecoders)y.set(b.name,b);if(p.contentTypeDecoder!==void 0&&(v=p.contentTypeDecoder,T.set(v.name,v)),p.contentTypeDecoders!==void 0)for(const b of p.contentTypeDecoders)T.set(b.name,b)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,T.set(v.name,v)),{charset:g,contentDecoder:m,contentDecoders:y,contentTypeDecoder:v,contentTypeDecoders:T}}A(f,"fromOptions"),d.fromOptions=f})(o||(o={}));var l=(h=class extends s{constructor(f,p){super(),this.readable=f,this.options=o.fromOptions(p),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(f){this._partialMessageTimeout=f}get partialMessageTimeout(){return this._partialMessageTimeout}listen(f){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=f;const p=this.readable.onData(g=>{this.onData(g)});return this.readable.onError(g=>this.fireError(g)),this.readable.onClose(()=>this.fireClose()),p}onData(f){try{for(this.buffer.append(f);;){if(this.nextMessageLength===-1){const g=this.buffer.tryReadHeaders(!0);if(!g)return;const m=g.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. -${JSON.stringify(Object.fromEntries(g))}`));return}const y=parseInt(m);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=y}const p=this.buffer.tryReadBody(this.nextMessageLength);if(p===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const g=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(p):p,m=await this.options.contentTypeDecoder.decode(g,this.options);this.callback(m)}).catch(g=>{this.fireError(g)})}}catch(p){this.fireError(p)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,p)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:p}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},A(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),Oyt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=yg(),r=ES(),n=lbe(),i=$x(),a="Content-Length: ",s=`\r -`,o;(function(p){function g(m){let y=m;return y&&r.func(y.dispose)&&r.func(y.onClose)&&r.func(y.onError)&&r.func(y.write)}A(g,"is"),p.is=g})(o||(t.MessageWriter=o={}));var l=(d=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,m,y){this.errorEmitter.fire([this.asError(g),m,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${r.string(g.message)?g.message:"unknown"}`)}},A(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var u;(function(p){function g(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}A(g,"fromOptions"),p.fromOptions=g})(u||(u={}));var h=(f=class extends l{constructor(g,m){super(),this.writable=g,this.options=u.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(a,y.byteLength.toString(),s),v.push(s),this.doWrite(g,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(g,m,y){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,g),Promise.reject(v)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},A(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),$yt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var a;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r +`&&l++}o&&s.length>0&&a.push(s.length),this._lineOffsets=a}return this._lineOffsets}positionAt(a){a=Math.max(Math.min(a,this._content.length),0);let s=this.getLineOffsets(),o=0,l=s.length;if(l===0)return mn.create(0,a);for(;oa?l=h:o=h+1}let u=o-1;return mn.create(u,a-s[u])}offsetAt(a){let s=this.getLineOffsets();if(a.line>=s.length)return this._content.length;if(a.line<0)return 0;let o=s[a.line],l=a.line+1"u"}A(o,"undefined"),i.undefined=o;function l(v){return v===!0||v===!1}A(l,"boolean"),i.boolean=l;function u(v){return a.call(v)==="[object String]"}A(u,"string"),i.string=u;function h(v){return a.call(v)==="[object Number]"}A(h,"number"),i.number=h;function d(v,T,b){return a.call(v)==="[object Number]"&&T<=v&&v<=b}A(d,"numberRange"),i.numberRange=d;function f(v){return a.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}A(f,"integer"),i.integer=f;function p(v){return a.call(v)==="[object Number]"&&0<=v&&v<=2147483647}A(p,"uinteger"),i.uinteger=p;function g(v){return a.call(v)==="[object Function]"}A(g,"func"),i.func=g;function m(v){return v!==null&&typeof v=="object"}A(m,"objectLiteral"),i.objectLiteral=m;function y(v,T){return Array.isArray(v)&&v.every(T)}A(y,"typedArray"),i.typedArray=y})(Ze||(Ze={}))}}),yg=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}A(r,"RAL"),(function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");e=a}A(i,"install"),n.install=i})(r||(r={})),t.default=r}}),ES=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}A(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}A(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}A(n,"number"),t.number=n;function i(l){return l instanceof Error}A(i,"error"),t.error=i;function a(l){return typeof l=="function"}A(a,"func"),t.func=a;function s(l){return Array.isArray(l)}A(s,"array"),t.array=s;function o(l){return s(l)&&l.every(u=>r(u))}A(o,"stringArray"),t.stringArray=o}}),$x=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var a,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=yg(),r;(function(o){const l={dispose(){}};o.None=function(){return l}})(r||(t.Event=r={}));var n=(a=class{add(l,u=null,h){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(h)&&h.push({dispose:A(()=>this.remove(l,u),"dispose")})}remove(l,u=null){if(!this._callbacks)return;let h=!1;for(let d=0,f=this._callbacks.length;d{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,u);const d={dispose:A(()=>{this._callbacks&&(this._callbacks.remove(l,u),d.dispose=s._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(h)&&h.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},A(s,"Emitter"),s);t.Emitter=i,i._noop=function(){}}}),CL=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,u;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=yg(),r=ES(),n=$x(),i;(function(h){h.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),h.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function d(f){const p=f;return p&&(p===h.None||p===h.Cancelled||r.boolean(p.isCancellationRequested)&&!!p.onCancellationRequested)}A(d,"is"),h.is=d})(i||(t.CancellationToken=i={}));var a=Object.freeze(function(h,d){const f=(0,e.default)().timer.setTimeout(h.bind(d),0);return{dispose(){f.dispose()}}}),s=(l=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},A(l,"MutableToken"),l),o=(u=class{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}},A(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),obe=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge,ee,Re,Ie,Be;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var e=ES(),r;(function(ce){ce.ParseError=-32700,ce.InvalidRequest=-32600,ce.MethodNotFound=-32601,ce.InvalidParams=-32602,ce.InternalError=-32603,ce.jsonrpcReservedErrorRangeStart=-32099,ce.serverErrorStart=-32099,ce.MessageWriteError=-32099,ce.MessageReadError=-32098,ce.PendingResponseRejected=-32097,ce.ConnectionInactive=-32096,ce.ServerNotInitialized=-32002,ce.UnknownErrorCode=-32001,ce.jsonrpcReservedErrorRangeEnd=-32e3,ce.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(D=class extends Error{constructor(oe,be,fe){super(be),this.code=e.number(oe)?oe:r.UnknownErrorCode,this.data=fe,Object.setPrototypeOf(this,D.prototype)}toJson(){const oe={code:this.code,message:this.message};return this.data!==void 0&&(oe.data=this.data),oe}},A(D,"ResponseError"),D);t.ResponseError=n;var i=(R=class{constructor(oe){this.kind=oe}static is(oe){return oe===R.auto||oe===R.byName||oe===R.byPosition}toString(){return this.kind}},A(R,"ParameterStructures"),R);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=(I=class{constructor(oe,be){this.method=oe,this.numberOfParams=be}get parameterStructures(){return i.auto}},A(I,"AbstractMessageSignature"),I);t.AbstractMessageSignature=a;var s=($=class extends a{constructor(oe){super(oe,0)}},A($,"RequestType0"),$);t.RequestType0=s;var o=(O=class extends a{constructor(oe,be=i.auto){super(oe,1),this._parameterStructures=be}get parameterStructures(){return this._parameterStructures}},A(O,"RequestType"),O);t.RequestType=o;var l=(N=class extends a{constructor(oe,be=i.auto){super(oe,1),this._parameterStructures=be}get parameterStructures(){return this._parameterStructures}},A(N,"RequestType1"),N);t.RequestType1=l;var u=(F=class extends a{constructor(oe){super(oe,2)}},A(F,"RequestType2"),F);t.RequestType2=u;var h=(z=class extends a{constructor(oe){super(oe,3)}},A(z,"RequestType3"),z);t.RequestType3=h;var d=(V=class extends a{constructor(oe){super(oe,4)}},A(V,"RequestType4"),V);t.RequestType4=d;var f=(B=class extends a{constructor(oe){super(oe,5)}},A(B,"RequestType5"),B);t.RequestType5=f;var p=(G=class extends a{constructor(oe){super(oe,6)}},A(G,"RequestType6"),G);t.RequestType6=p;var g=(H=class extends a{constructor(oe){super(oe,7)}},A(H,"RequestType7"),H);t.RequestType7=g;var m=(q=class extends a{constructor(oe){super(oe,8)}},A(q,"RequestType8"),q);t.RequestType8=m;var y=(Z=class extends a{constructor(oe){super(oe,9)}},A(Z,"RequestType9"),Z);t.RequestType9=y;var v=(Y=class extends a{constructor(oe,be=i.auto){super(oe,1),this._parameterStructures=be}get parameterStructures(){return this._parameterStructures}},A(Y,"NotificationType"),Y);t.NotificationType=v;var T=(ie=class extends a{constructor(oe){super(oe,0)}},A(ie,"NotificationType0"),ie);t.NotificationType0=T;var b=(K=class extends a{constructor(oe,be=i.auto){super(oe,1),this._parameterStructures=be}get parameterStructures(){return this._parameterStructures}},A(K,"NotificationType1"),K);t.NotificationType1=b;var w=(Q=class extends a{constructor(oe){super(oe,2)}},A(Q,"NotificationType2"),Q);t.NotificationType2=w;var C=(te=class extends a{constructor(oe){super(oe,3)}},A(te,"NotificationType3"),te);t.NotificationType3=C;var S=(J=class extends a{constructor(oe){super(oe,4)}},A(J,"NotificationType4"),J);t.NotificationType4=S;var k=(ge=class extends a{constructor(oe){super(oe,5)}},A(ge,"NotificationType5"),ge);t.NotificationType5=k;var E=(ee=class extends a{constructor(oe){super(oe,6)}},A(ee,"NotificationType6"),ee);t.NotificationType6=E;var _=(Re=class extends a{constructor(oe){super(oe,7)}},A(Re,"NotificationType7"),Re);t.NotificationType7=_;var M=(Ie=class extends a{constructor(oe){super(oe,8)}},A(Ie,"NotificationType8"),Ie);t.NotificationType8=M;var L=(Be=class extends a{constructor(oe){super(oe,9)}},A(Be,"NotificationType9"),Be);t.NotificationType9=L;var P;(function(ce){function oe(Pe){const ve=Pe;return ve&&e.string(ve.method)&&(e.string(ve.id)||e.number(ve.id))}A(oe,"isRequest"),ce.isRequest=oe;function be(Pe){const ve=Pe;return ve&&e.string(ve.method)&&Pe.id===void 0}A(be,"isNotification"),ce.isNotification=be;function fe(Pe){const ve=Pe;return ve&&(ve.result!==void 0||!!ve.error)&&(e.string(ve.id)||e.number(ve.id)||ve.id===null)}A(fe,"isResponse"),ce.isResponse=fe})(P||(t.Message=P={}))}}),lbe=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var a,s;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(r||(t.Touch=r={}));var n=(a=class{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}has(l){return this._map.has(l)}get(l,u=r.None){const h=this._map.get(l);if(h)return u!==r.None&&this.touch(h,u),h.value}set(l,u,h=r.None){let d=this._map.get(l);if(d)d.value=u,h!==r.None&&this.touch(d,h);else{switch(d={key:l,value:u,next:void 0,previous:void 0},h){case r.None:this.addItemLast(d);break;case r.First:this.addItemFirst(d);break;case r.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(l,d),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const u=this._map.get(l);if(u)return this._map.delete(l),this.removeItem(u),this._size--,u.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,u){const h=this._state;let d=this._head;for(;d;){if(u?l.bind(u)(d.value,d.key,this):l(d.value,d.key,this),this._state!==h)throw new Error("LinkedMap got modified during iteration.");d=d.next}}keys(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:A(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.key,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}values(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:A(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.value,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}entries(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:A(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:[u.key,u.value],done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let u=this._head,h=this.size;for(;u&&h>l;)this._map.delete(u.key),u=u.next,h--;this._head=u,this._size=h,u&&(u.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const u=l.next,h=l.previous;if(!u||!h)throw new Error("Invalid list");u.previous=h,h.next=u}l.next=void 0,l.previous=void 0,this._state++}touch(l,u){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(u!==r.First&&u!==r.Last)){if(u===r.First){if(l===this._head)return;const h=l.next,d=l.previous;l===this._tail?(d.next=void 0,this._tail=d):(h.previous=d,d.next=h),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(u===r.Last){if(l===this._tail)return;const h=l.next,d=l.previous;l===this._head?(h.previous=void 0,this._head=h):(h.previous=d,d.next=h),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((u,h)=>{l.push([h,u])}),l}fromJSON(l){this.clear();for(const[u,h]of l)this.set(u,h)}},A(a,"LinkedMap"),a);t.LinkedMap=n;var i=(s=class extends n{constructor(l,u=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,u),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,u=r.AsNew){return super.get(l,u)}peek(l){return super.get(l,r.None)}set(l,u){return super.set(l,u,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},A(s,"LRUCache"),s);t.LRUCache=i}}),Oyt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function n(i){return{dispose:i}}A(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),$yt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var o,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=CL(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(o=class{constructor(){this.buffers=new Map}enableCancellation(f){if(f.id===null)return;const p=new SharedArrayBuffer(4),g=new Int32Array(p,0,1);g[0]=r.Continue,this.buffers.set(f.id,p),f.$cancellationData=p}async sendCancellation(f,p){const g=this.buffers.get(p);if(g===void 0)return;const m=new Int32Array(g,0,1);Atomics.store(m,0,r.Cancelled)}cleanup(f){this.buffers.delete(f)}dispose(){this.buffers.clear()}},A(o,"SharedArraySenderStrategy"),o);t.SharedArraySenderStrategy=n;var i=(l=class{constructor(f){this.data=new Int32Array(f,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},A(l,"SharedArrayBufferCancellationToken"),l),a=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},A(u,"SharedArrayBufferCancellationTokenSource"),u),s=(h=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new a(p)}},A(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=s}}),cbe=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var e=yg(),r=(n=class{constructor(a=1){if(a<=0)throw new Error("Capacity must be greater than 0");this._capacity=a,this._active=0,this._waiting=[]}lock(a){return new Promise((s,o)=>{this._waiting.push({thunk:a,resolve:s,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const a=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const s=a.thunk();s instanceof Promise?s.then(o=>{this._active--,a.resolve(o),this.runNext()},o=>{this._active--,a.reject(o),this.runNext()}):(this._active--,a.resolve(s),this.runNext())}catch(s){this._active--,a.reject(s),this.runNext()}}},A(n,"Semaphore"),n);t.Semaphore=r}}),Pyt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=yg(),r=ES(),n=$x(),i=cbe(),a;(function(d){function f(p){let g=p;return g&&r.func(g.listen)&&r.func(g.dispose)&&r.func(g.onError)&&r.func(g.onClose)&&r.func(g.onPartialMessage)}A(f,"is"),d.is=f})(a||(t.MessageReader=a={}));var s=(u=class{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f){this.errorEmitter.fire(this.asError(f))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(f){this.partialMessageEmitter.fire(f)}asError(f){return f instanceof Error?f:new Error(`Reader received error. Reason: ${r.string(f.message)?f.message:"unknown"}`)}},A(u,"AbstractMessageReader"),u);t.AbstractMessageReader=s;var o;(function(d){function f(p){let g,m;const y=new Map;let v;const T=new Map;if(p===void 0||typeof p=="string")g=p??"utf-8";else{if(g=p.charset??"utf-8",p.contentDecoder!==void 0&&(m=p.contentDecoder,y.set(m.name,m)),p.contentDecoders!==void 0)for(const b of p.contentDecoders)y.set(b.name,b);if(p.contentTypeDecoder!==void 0&&(v=p.contentTypeDecoder,T.set(v.name,v)),p.contentTypeDecoders!==void 0)for(const b of p.contentTypeDecoders)T.set(b.name,b)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,T.set(v.name,v)),{charset:g,contentDecoder:m,contentDecoders:y,contentTypeDecoder:v,contentTypeDecoders:T}}A(f,"fromOptions"),d.fromOptions=f})(o||(o={}));var l=(h=class extends s{constructor(f,p){super(),this.readable=f,this.options=o.fromOptions(p),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(f){this._partialMessageTimeout=f}get partialMessageTimeout(){return this._partialMessageTimeout}listen(f){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=f;const p=this.readable.onData(g=>{this.onData(g)});return this.readable.onError(g=>this.fireError(g)),this.readable.onClose(()=>this.fireClose()),p}onData(f){try{for(this.buffer.append(f);;){if(this.nextMessageLength===-1){const g=this.buffer.tryReadHeaders(!0);if(!g)return;const m=g.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(g))}`));return}const y=parseInt(m);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=y}const p=this.buffer.tryReadBody(this.nextMessageLength);if(p===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const g=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(p):p,m=await this.options.contentTypeDecoder.decode(g,this.options);this.callback(m)}).catch(g=>{this.fireError(g)})}}catch(p){this.fireError(p)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,p)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:p}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},A(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),Byt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=yg(),r=ES(),n=cbe(),i=$x(),a="Content-Length: ",s=`\r +`,o;(function(p){function g(m){let y=m;return y&&r.func(y.dispose)&&r.func(y.onClose)&&r.func(y.onError)&&r.func(y.write)}A(g,"is"),p.is=g})(o||(t.MessageWriter=o={}));var l=(d=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,m,y){this.errorEmitter.fire([this.asError(g),m,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${r.string(g.message)?g.message:"unknown"}`)}},A(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var u;(function(p){function g(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}A(g,"fromOptions"),p.fromOptions=g})(u||(u={}));var h=(f=class extends l{constructor(g,m){super(),this.writable=g,this.options=u.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(a,y.byteLength.toString(),s),v.push(s),this.doWrite(g,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(g,m,y){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,g),Promise.reject(v)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},A(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),Fyt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var a;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r `,i=(a=class{constructor(o="utf-8"){this._encoding=o,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(o){const l=typeof o=="string"?this.fromString(o,this._encoding):o;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(o=!1){if(this._chunks.length===0)return;let l=0,u=0,h=0,d=0;e:for(;uthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},A(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),Pyt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var D,R;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=yg(),r=ES(),n=sbe(),i=obe(),a=$x(),s=CL(),o;(function(I){I.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(I){function $(O){return typeof O=="string"||typeof O=="number"}A($,"is"),I.is=$})(l||(t.ProgressToken=l={}));var u;(function(I){I.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(D=class{constructor(){}},A(D,"ProgressType"),D);t.ProgressType=h;var d;(function(I){function $(O){return r.func(O)}A($,"is"),I.is=$})(d||(d={})),t.NullLogger=Object.freeze({error:A(()=>{},"error"),warn:A(()=>{},"warn"),info:A(()=>{},"info"),log:A(()=>{},"log")});var f;(function(I){I[I.Off=0]="Off",I[I.Messages=1]="Messages",I[I.Compact=2]="Compact",I[I.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(I){I.Off="off",I.Messages="messages",I.Compact="compact",I.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(I){function $(N){if(!r.string(N))return I.Off;switch(N=N.toLowerCase(),N){case"off":return I.Off;case"messages":return I.Messages;case"compact":return I.Compact;case"verbose":return I.Verbose;default:return I.Off}}A($,"fromString"),I.fromString=$;function O(N){switch(N){case I.Off:return"off";case I.Messages:return"messages";case I.Compact:return"compact";case I.Verbose:return"verbose";default:return"off"}}A(O,"toString"),I.toString=O})(f||(t.Trace=f={}));var g;(function(I){I.Text="text",I.JSON="json"})(g||(t.TraceFormat=g={})),(function(I){function $(O){return r.string(O)?(O=O.toLowerCase(),O==="json"?I.JSON:I.Text):I.Text}A($,"fromString"),I.fromString=$})(g||(t.TraceFormat=g={}));var m;(function(I){I.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(I){I.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(I){I[I.Closed=1]="Closed",I[I.Disposed=2]="Disposed",I[I.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var T=(R=class extends Error{constructor($,O){super(O),this.code=$,Object.setPrototypeOf(this,R.prototype)}},A(R,"ConnectionError"),R);t.ConnectionError=T;var b;(function(I){function $(O){const N=O;return N&&r.func(N.cancelUndispatched)}A($,"is"),I.is=$})(b||(t.ConnectionStrategy=b={}));var w;(function(I){function $(O){const N=O;return N&&(N.kind===void 0||N.kind==="id")&&r.func(N.createCancellationTokenSource)&&(N.dispose===void 0||r.func(N.dispose))}A($,"is"),I.is=$})(w||(t.IdCancellationReceiverStrategy=w={}));var C;(function(I){function $(O){const N=O;return N&&N.kind==="request"&&r.func(N.createCancellationTokenSource)&&(N.dispose===void 0||r.func(N.dispose))}A($,"is"),I.is=$})(C||(t.RequestCancellationReceiverStrategy=C={}));var S;(function(I){I.Message=Object.freeze({createCancellationTokenSource(O){return new s.CancellationTokenSource}});function $(O){return w.is(O)||C.is(O)}A($,"is"),I.is=$})(S||(t.CancellationReceiverStrategy=S={}));var k;(function(I){I.Message=Object.freeze({sendCancellation(O,N){return O.sendNotification(o.type,{id:N})},cleanup(O){}});function $(O){const N=O;return N&&r.func(N.sendCancellation)&&r.func(N.cleanup)}A($,"is"),I.is=$})(k||(t.CancellationSenderStrategy=k={}));var E;(function(I){I.Message=Object.freeze({receiver:S.Message,sender:k.Message});function $(O){const N=O;return N&&S.is(N.receiver)&&k.is(N.sender)}A($,"is"),I.is=$})(E||(t.CancellationStrategy=E={}));var _;(function(I){function $(O){const N=O;return N&&r.func(N.handleMessage)}A($,"is"),I.is=$})(_||(t.MessageStrategy=_={}));var M;(function(I){function $(O){const N=O;return N&&(E.is(N.cancellationStrategy)||b.is(N.connectionStrategy)||_.is(N.messageStrategy))}A($,"is"),I.is=$})(M||(t.ConnectionOptions=M={}));var L;(function(I){I[I.New=1]="New",I[I.Listening=2]="Listening",I[I.Closed=3]="Closed",I[I.Disposed=4]="Disposed"})(L||(L={}));function P(I,$,O,N){const F=O!==void 0?O:t.NullLogger;let z=0,V=0,B=0;const G="2.0";let H;const q=new Map;let Z;const Y=new Map,ie=new Map;let K,Q=new i.LinkedMap,te=new Map,J=new Set,ge=new Map,ee=f.Off,Re=g.Text,Ie,Be=L.New;const ce=new a.Emitter,oe=new a.Emitter,be=new a.Emitter,fe=new a.Emitter,Pe=new a.Emitter,ve=N&&N.cancellationStrategy?N.cancellationStrategy:E.Message;function Ce(Se){if(Se===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Se.toString()}A(Ce,"createRequestQueueKey");function Ve(Se){return Se===null?"res-unknown-"+(++B).toString():"res-"+Se.toString()}A(Ve,"createResponseQueueKey");function se(){return"not-"+(++V).toString()}A(se,"createNotificationQueueKey");function de(Se,Ue){n.Message.isRequest(Ue)?Se.set(Ce(Ue.id),Ue):n.Message.isResponse(Ue)?Se.set(Ve(Ue.id),Ue):Se.set(se(),Ue)}A(de,"addMessageToQueue");function Te(Se){}A(Te,"cancelUndispatched");function ae(){return Be===L.Listening}A(ae,"isListening");function he(){return Be===L.Closed}A(he,"isClosed");function W(){return Be===L.Disposed}A(W,"isDisposed");function ne(){(Be===L.New||Be===L.Listening)&&(Be=L.Closed,oe.fire(void 0))}A(ne,"closeHandler");function j(Se){ce.fire([Se,void 0,void 0])}A(j,"readErrorHandler");function ue(Se){ce.fire(Se)}A(ue,"writeErrorHandler"),I.onClose(ne),I.onError(j),$.onClose(ne),$.onError(ue);function X(){K||Q.size===0||(K=(0,e.default)().timer.setImmediate(()=>{K=void 0,xe()}))}A(X,"triggerMessageQueue");function Oe(Se){n.Message.isRequest(Se)?_e(Se):n.Message.isNotification(Se)?Me(Se):n.Message.isResponse(Se)?$e(Se):He(Se)}A(Oe,"handleMessage");function xe(){if(Q.size===0)return;const Se=Q.shift();try{const Ue=N==null?void 0:N.messageStrategy;_.is(Ue)?Ue.handleMessage(Se,Oe):Oe(Se)}finally{X()}}A(xe,"processMessageQueue");const Ge=A(Se=>{try{if(n.Message.isNotification(Se)&&Se.method===o.type.method){const Ue=Se.params.id,tt=Ce(Ue),kt=Q.get(tt);if(n.Message.isRequest(kt)){const sr=N==null?void 0:N.connectionStrategy,Qt=sr&&sr.cancelUndispatched?sr.cancelUndispatched(kt,Te):void 0;if(Qt&&(Qt.error!==void 0||Qt.result!==void 0)){Q.delete(tt),ge.delete(Ue),Qt.id=kt.id,at(Qt,Se.method,Date.now()),$.write(Qt).catch(()=>F.error("Sending response for canceled message failed."));return}}const Nt=ge.get(Ue);if(Nt!==void 0){Nt.cancel(),pt(Se);return}else J.add(Ue)}de(Q,Se)}finally{X()}},"callback");function _e(Se){if(W())return;function Ue(nr,Rr,Zt){const gr={jsonrpc:G,id:Se.id};nr instanceof n.ResponseError?gr.error=nr.toJson():gr.result=nr===void 0?null:nr,at(gr,Rr,Zt),$.write(gr).catch(()=>F.error("Sending response failed."))}A(Ue,"reply");function tt(nr,Rr,Zt){const gr={jsonrpc:G,id:Se.id,error:nr.toJson()};at(gr,Rr,Zt),$.write(gr).catch(()=>F.error("Sending response failed."))}A(tt,"replyError");function kt(nr,Rr,Zt){nr===void 0&&(nr=null);const gr={jsonrpc:G,id:Se.id,result:nr};at(gr,Rr,Zt),$.write(gr).catch(()=>F.error("Sending response failed."))}A(kt,"replySuccess"),Ee(Se);const Nt=q.get(Se.method);let sr,Qt;Nt&&(sr=Nt.type,Qt=Nt.handler);const vr=Date.now();if(Qt||H){const nr=Se.id??String(Date.now()),Rr=w.is(ve.receiver)?ve.receiver.createCancellationTokenSource(nr):ve.receiver.createCancellationTokenSource(Se);Se.id!==null&&J.has(Se.id)&&Rr.cancel(),Se.id!==null&&ge.set(nr,Rr);try{let Zt;if(Qt)if(Se.params===void 0){if(sr!==void 0&&sr.numberOfParams!==0){tt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Se.method} defines ${sr.numberOfParams} params but received none.`),Se.method,vr);return}Zt=Qt(Rr.token)}else if(Array.isArray(Se.params)){if(sr!==void 0&&sr.parameterStructures===n.ParameterStructures.byName){tt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by name but received parameters by position`),Se.method,vr);return}Zt=Qt(...Se.params,Rr.token)}else{if(sr!==void 0&&sr.parameterStructures===n.ParameterStructures.byPosition){tt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by position but received parameters by name`),Se.method,vr);return}Zt=Qt(Se.params,Rr.token)}else H&&(Zt=H(Se.method,Se.params,Rr.token));const gr=Zt;Zt?gr.then?gr.then(Dr=>{ge.delete(nr),Ue(Dr,Se.method,vr)},Dr=>{ge.delete(nr),Dr instanceof n.ResponseError?tt(Dr,Se.method,vr):Dr&&r.string(Dr.message)?tt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${Dr.message}`),Se.method,vr):tt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,vr)}):(ge.delete(nr),Ue(Zt,Se.method,vr)):(ge.delete(nr),kt(Zt,Se.method,vr))}catch(Zt){ge.delete(nr),Zt instanceof n.ResponseError?Ue(Zt,Se.method,vr):Zt&&r.string(Zt.message)?tt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${Zt.message}`),Se.method,vr):tt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,vr)}}else tt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Se.method}`),Se.method,vr)}A(_e,"handleRequest");function $e(Se){if(!W())if(Se.id===null)Se.error?F.error(`Received response message without id: Error is: +${y}`);const T=y.substr(0,v),b=y.substr(v+1).trim();p.set(o?T.toLowerCase():T,b)}return p}tryReadBody(o){if(!(this._totalLengththis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},A(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),zyt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var D,R;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=yg(),r=ES(),n=obe(),i=lbe(),a=$x(),s=CL(),o;(function(I){I.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(I){function $(O){return typeof O=="string"||typeof O=="number"}A($,"is"),I.is=$})(l||(t.ProgressToken=l={}));var u;(function(I){I.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(D=class{constructor(){}},A(D,"ProgressType"),D);t.ProgressType=h;var d;(function(I){function $(O){return r.func(O)}A($,"is"),I.is=$})(d||(d={})),t.NullLogger=Object.freeze({error:A(()=>{},"error"),warn:A(()=>{},"warn"),info:A(()=>{},"info"),log:A(()=>{},"log")});var f;(function(I){I[I.Off=0]="Off",I[I.Messages=1]="Messages",I[I.Compact=2]="Compact",I[I.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(I){I.Off="off",I.Messages="messages",I.Compact="compact",I.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(I){function $(N){if(!r.string(N))return I.Off;switch(N=N.toLowerCase(),N){case"off":return I.Off;case"messages":return I.Messages;case"compact":return I.Compact;case"verbose":return I.Verbose;default:return I.Off}}A($,"fromString"),I.fromString=$;function O(N){switch(N){case I.Off:return"off";case I.Messages:return"messages";case I.Compact:return"compact";case I.Verbose:return"verbose";default:return"off"}}A(O,"toString"),I.toString=O})(f||(t.Trace=f={}));var g;(function(I){I.Text="text",I.JSON="json"})(g||(t.TraceFormat=g={})),(function(I){function $(O){return r.string(O)?(O=O.toLowerCase(),O==="json"?I.JSON:I.Text):I.Text}A($,"fromString"),I.fromString=$})(g||(t.TraceFormat=g={}));var m;(function(I){I.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(I){I.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(I){I[I.Closed=1]="Closed",I[I.Disposed=2]="Disposed",I[I.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var T=(R=class extends Error{constructor($,O){super(O),this.code=$,Object.setPrototypeOf(this,R.prototype)}},A(R,"ConnectionError"),R);t.ConnectionError=T;var b;(function(I){function $(O){const N=O;return N&&r.func(N.cancelUndispatched)}A($,"is"),I.is=$})(b||(t.ConnectionStrategy=b={}));var w;(function(I){function $(O){const N=O;return N&&(N.kind===void 0||N.kind==="id")&&r.func(N.createCancellationTokenSource)&&(N.dispose===void 0||r.func(N.dispose))}A($,"is"),I.is=$})(w||(t.IdCancellationReceiverStrategy=w={}));var C;(function(I){function $(O){const N=O;return N&&N.kind==="request"&&r.func(N.createCancellationTokenSource)&&(N.dispose===void 0||r.func(N.dispose))}A($,"is"),I.is=$})(C||(t.RequestCancellationReceiverStrategy=C={}));var S;(function(I){I.Message=Object.freeze({createCancellationTokenSource(O){return new s.CancellationTokenSource}});function $(O){return w.is(O)||C.is(O)}A($,"is"),I.is=$})(S||(t.CancellationReceiverStrategy=S={}));var k;(function(I){I.Message=Object.freeze({sendCancellation(O,N){return O.sendNotification(o.type,{id:N})},cleanup(O){}});function $(O){const N=O;return N&&r.func(N.sendCancellation)&&r.func(N.cleanup)}A($,"is"),I.is=$})(k||(t.CancellationSenderStrategy=k={}));var E;(function(I){I.Message=Object.freeze({receiver:S.Message,sender:k.Message});function $(O){const N=O;return N&&S.is(N.receiver)&&k.is(N.sender)}A($,"is"),I.is=$})(E||(t.CancellationStrategy=E={}));var _;(function(I){function $(O){const N=O;return N&&r.func(N.handleMessage)}A($,"is"),I.is=$})(_||(t.MessageStrategy=_={}));var M;(function(I){function $(O){const N=O;return N&&(E.is(N.cancellationStrategy)||b.is(N.connectionStrategy)||_.is(N.messageStrategy))}A($,"is"),I.is=$})(M||(t.ConnectionOptions=M={}));var L;(function(I){I[I.New=1]="New",I[I.Listening=2]="Listening",I[I.Closed=3]="Closed",I[I.Disposed=4]="Disposed"})(L||(L={}));function P(I,$,O,N){const F=O!==void 0?O:t.NullLogger;let z=0,V=0,B=0;const G="2.0";let H;const q=new Map;let Z;const Y=new Map,ie=new Map;let K,Q=new i.LinkedMap,te=new Map,J=new Set,ge=new Map,ee=f.Off,Re=g.Text,Ie,Be=L.New;const ce=new a.Emitter,oe=new a.Emitter,be=new a.Emitter,fe=new a.Emitter,Pe=new a.Emitter,ve=N&&N.cancellationStrategy?N.cancellationStrategy:E.Message;function Ce(Se){if(Se===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Se.toString()}A(Ce,"createRequestQueueKey");function Ve(Se){return Se===null?"res-unknown-"+(++B).toString():"res-"+Se.toString()}A(Ve,"createResponseQueueKey");function se(){return"not-"+(++V).toString()}A(se,"createNotificationQueueKey");function de(Se,Ue){n.Message.isRequest(Ue)?Se.set(Ce(Ue.id),Ue):n.Message.isResponse(Ue)?Se.set(Ve(Ue.id),Ue):Se.set(se(),Ue)}A(de,"addMessageToQueue");function Te(Se){}A(Te,"cancelUndispatched");function ae(){return Be===L.Listening}A(ae,"isListening");function he(){return Be===L.Closed}A(he,"isClosed");function W(){return Be===L.Disposed}A(W,"isDisposed");function ne(){(Be===L.New||Be===L.Listening)&&(Be=L.Closed,oe.fire(void 0))}A(ne,"closeHandler");function j(Se){ce.fire([Se,void 0,void 0])}A(j,"readErrorHandler");function ue(Se){ce.fire(Se)}A(ue,"writeErrorHandler"),I.onClose(ne),I.onError(j),$.onClose(ne),$.onError(ue);function X(){K||Q.size===0||(K=(0,e.default)().timer.setImmediate(()=>{K=void 0,xe()}))}A(X,"triggerMessageQueue");function Oe(Se){n.Message.isRequest(Se)?_e(Se):n.Message.isNotification(Se)?Me(Se):n.Message.isResponse(Se)?$e(Se):He(Se)}A(Oe,"handleMessage");function xe(){if(Q.size===0)return;const Se=Q.shift();try{const Ue=N==null?void 0:N.messageStrategy;_.is(Ue)?Ue.handleMessage(Se,Oe):Oe(Se)}finally{X()}}A(xe,"processMessageQueue");const Ge=A(Se=>{try{if(n.Message.isNotification(Se)&&Se.method===o.type.method){const Ue=Se.params.id,tt=Ce(Ue),kt=Q.get(tt);if(n.Message.isRequest(kt)){const sr=N==null?void 0:N.connectionStrategy,Qt=sr&&sr.cancelUndispatched?sr.cancelUndispatched(kt,Te):void 0;if(Qt&&(Qt.error!==void 0||Qt.result!==void 0)){Q.delete(tt),ge.delete(Ue),Qt.id=kt.id,at(Qt,Se.method,Date.now()),$.write(Qt).catch(()=>F.error("Sending response for canceled message failed."));return}}const Nt=ge.get(Ue);if(Nt!==void 0){Nt.cancel(),pt(Se);return}else J.add(Ue)}de(Q,Se)}finally{X()}},"callback");function _e(Se){if(W())return;function Ue(nr,Rr,Zt){const gr={jsonrpc:G,id:Se.id};nr instanceof n.ResponseError?gr.error=nr.toJson():gr.result=nr===void 0?null:nr,at(gr,Rr,Zt),$.write(gr).catch(()=>F.error("Sending response failed."))}A(Ue,"reply");function tt(nr,Rr,Zt){const gr={jsonrpc:G,id:Se.id,error:nr.toJson()};at(gr,Rr,Zt),$.write(gr).catch(()=>F.error("Sending response failed."))}A(tt,"replyError");function kt(nr,Rr,Zt){nr===void 0&&(nr=null);const gr={jsonrpc:G,id:Se.id,result:nr};at(gr,Rr,Zt),$.write(gr).catch(()=>F.error("Sending response failed."))}A(kt,"replySuccess"),Ee(Se);const Nt=q.get(Se.method);let sr,Qt;Nt&&(sr=Nt.type,Qt=Nt.handler);const vr=Date.now();if(Qt||H){const nr=Se.id??String(Date.now()),Rr=w.is(ve.receiver)?ve.receiver.createCancellationTokenSource(nr):ve.receiver.createCancellationTokenSource(Se);Se.id!==null&&J.has(Se.id)&&Rr.cancel(),Se.id!==null&&ge.set(nr,Rr);try{let Zt;if(Qt)if(Se.params===void 0){if(sr!==void 0&&sr.numberOfParams!==0){tt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Se.method} defines ${sr.numberOfParams} params but received none.`),Se.method,vr);return}Zt=Qt(Rr.token)}else if(Array.isArray(Se.params)){if(sr!==void 0&&sr.parameterStructures===n.ParameterStructures.byName){tt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by name but received parameters by position`),Se.method,vr);return}Zt=Qt(...Se.params,Rr.token)}else{if(sr!==void 0&&sr.parameterStructures===n.ParameterStructures.byPosition){tt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by position but received parameters by name`),Se.method,vr);return}Zt=Qt(Se.params,Rr.token)}else H&&(Zt=H(Se.method,Se.params,Rr.token));const gr=Zt;Zt?gr.then?gr.then(Dr=>{ge.delete(nr),Ue(Dr,Se.method,vr)},Dr=>{ge.delete(nr),Dr instanceof n.ResponseError?tt(Dr,Se.method,vr):Dr&&r.string(Dr.message)?tt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${Dr.message}`),Se.method,vr):tt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,vr)}):(ge.delete(nr),Ue(Zt,Se.method,vr)):(ge.delete(nr),kt(Zt,Se.method,vr))}catch(Zt){ge.delete(nr),Zt instanceof n.ResponseError?Ue(Zt,Se.method,vr):Zt&&r.string(Zt.message)?tt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${Zt.message}`),Se.method,vr):tt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,vr)}}else tt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Se.method}`),Se.method,vr)}A(_e,"handleRequest");function $e(Se){if(!W())if(Se.id===null)Se.error?F.error(`Received response message without id: Error is: ${JSON.stringify(Se.error,void 0,4)}`):F.error("Received response message without id. No further error information provided.");else{const Ue=Se.id,tt=te.get(Ue);if(ht(Se,tt),tt!==void 0){te.delete(Ue);try{if(Se.error){const kt=Se.error;tt.reject(new n.ResponseError(kt.code,kt.message,kt.data))}else if(Se.result!==void 0)tt.resolve(Se.result);else throw new Error("Should never happen.")}catch(kt){kt.message?F.error(`Response handler '${tt.method}' failed with message: ${kt.message}`):F.error(`Response handler '${tt.method}' failed unexpectedly.`)}}}}A($e,"handleResponse");function Me(Se){if(W())return;let Ue,tt;if(Se.method===o.type.method){const kt=Se.params.id;J.delete(kt),pt(Se);return}else{const kt=Y.get(Se.method);kt&&(tt=kt.handler,Ue=kt.type)}if(tt||Z)try{if(pt(Se),tt)if(Se.params===void 0)Ue!==void 0&&Ue.numberOfParams!==0&&Ue.parameterStructures!==n.ParameterStructures.byName&&F.error(`Notification ${Se.method} defines ${Ue.numberOfParams} params but received none.`),tt();else if(Array.isArray(Se.params)){const kt=Se.params;Se.method===u.type.method&&kt.length===2&&l.is(kt[0])?tt({token:kt[0],value:kt[1]}):(Ue!==void 0&&(Ue.parameterStructures===n.ParameterStructures.byName&&F.error(`Notification ${Se.method} defines parameters by name but received parameters by position`),Ue.numberOfParams!==Se.params.length&&F.error(`Notification ${Se.method} defines ${Ue.numberOfParams} params but received ${kt.length} arguments`)),tt(...kt))}else Ue!==void 0&&Ue.parameterStructures===n.ParameterStructures.byPosition&&F.error(`Notification ${Se.method} defines parameters by position but received parameters by name`),tt(Se.params);else Z&&Z(Se.method,Se.params)}catch(kt){kt.message?F.error(`Notification handler '${Se.method}' failed with message: ${kt.message}`):F.error(`Notification handler '${Se.method}' failed unexpectedly.`)}else be.fire(Se)}A(Me,"handleNotification");function He(Se){if(!Se){F.error("Received empty message.");return}F.error(`Received message which is neither a response nor a notification message: ${JSON.stringify(Se,null,4)}`);const Ue=Se;if(r.string(Ue.id)||r.number(Ue.id)){const tt=Ue.id,kt=te.get(tt);kt&&kt.reject(new Error("The received response has neither a result nor an error property."))}}A(He,"handleInvalidMessage");function De(Se){if(Se!=null)switch(ee){case f.Verbose:return JSON.stringify(Se,null,4);case f.Compact:return JSON.stringify(Se);default:return}}A(De,"stringifyTrace");function Ke(Se){if(!(ee===f.Off||!Ie))if(Re===g.Text){let Ue;(ee===f.Verbose||ee===f.Compact)&&Se.params&&(Ue=`Params: ${De(Se.params)} @@ -1427,19 +1429,19 @@ ${JSON.stringify(Se,null,4)}`);const Ue=Se;if(r.string(Ue.id)||r.number(Ue.id)){ `:Se.error===void 0&&(tt=`No result returned. -`)),Ue){const kt=Se.error?` Request failed: ${Se.error.message} (${Se.error.code}).`:"";Ie.log(`Received response '${Ue.method} - (${Se.id})' in ${Date.now()-Ue.timerStart}ms.${kt}`,tt)}else Ie.log(`Received response ${Se.id} without active response promise.`,tt)}else rt("receive-response",Se)}A(ht,"traceReceivedResponse");function rt(Se,Ue){if(!Ie||ee===f.Off)return;const tt={isLSPMessage:!0,type:Se,message:Ue,timestamp:Date.now()};Ie.log(tt)}A(rt,"logLSPMessage");function Et(){if(he())throw new T(v.Closed,"Connection is closed.");if(W())throw new T(v.Disposed,"Connection is disposed.")}A(Et,"throwIfClosedOrDisposed");function vt(){if(ae())throw new T(v.AlreadyListening,"Connection is already listening")}A(vt,"throwIfListening");function ot(){if(!ae())throw new Error("Call listen() first.")}A(ot,"throwIfNotListening");function pe(Se){return Se===void 0?null:Se}A(pe,"undefinedToNull");function Ct(Se){if(Se!==null)return Se}A(Ct,"nullToUndefined");function lt(Se){return Se!=null&&!Array.isArray(Se)&&typeof Se=="object"}A(lt,"isNamedParam");function st(Se,Ue){switch(Se){case n.ParameterStructures.auto:return lt(Ue)?Ct(Ue):[pe(Ue)];case n.ParameterStructures.byName:if(!lt(Ue))throw new Error("Received parameters by name but param is not an object literal.");return Ct(Ue);case n.ParameterStructures.byPosition:return[pe(Ue)];default:throw new Error(`Unknown parameter structure ${Se.toString()}`)}}A(st,"computeSingleParam");function mt(Se,Ue){let tt;const kt=Se.numberOfParams;switch(kt){case 0:tt=void 0;break;case 1:tt=st(Se.parameterStructures,Ue[0]);break;default:tt=[];for(let Nt=0;Nt{Et();let tt,kt;if(r.string(Se)){tt=Se;const sr=Ue[0];let Qt=0,vr=n.ParameterStructures.auto;n.ParameterStructures.is(sr)&&(Qt=1,vr=sr);let nr=Ue.length;const Rr=nr-Qt;switch(Rr){case 0:kt=void 0;break;case 1:kt=st(vr,Ue[Qt]);break;default:if(vr===n.ParameterStructures.byName)throw new Error(`Received ${Rr} parameters for 'by Name' notification parameter structure.`);kt=Ue.slice(Qt,nr).map(Zt=>pe(Zt));break}}else{const sr=Ue;tt=Se.method,kt=mt(Se,sr)}const Nt={jsonrpc:G,method:tt,params:kt};return Ae(Nt),$.write(Nt).catch(sr=>{throw F.error("Sending notification failed."),sr})},"sendNotification"),onNotification:A((Se,Ue)=>{Et();let tt;return r.func(Se)?Z=Se:Ue&&(r.string(Se)?(tt=Se,Y.set(Se,{type:void 0,handler:Ue})):(tt=Se.method,Y.set(Se.method,{type:Se,handler:Ue}))),{dispose:A(()=>{tt!==void 0?Y.delete(tt):Z=void 0},"dispose")}},"onNotification"),onProgress:A((Se,Ue,tt)=>{if(ie.has(Ue))throw new Error(`Progress handler for token ${Ue} already registered`);return ie.set(Ue,tt),{dispose:A(()=>{ie.delete(Ue)},"dispose")}},"onProgress"),sendProgress:A((Se,Ue,tt)=>_r.sendNotification(u.type,{token:Ue,value:tt}),"sendProgress"),onUnhandledProgress:fe.event,sendRequest:A((Se,...Ue)=>{Et(),ot();let tt,kt,Nt;if(r.string(Se)){tt=Se;const nr=Ue[0],Rr=Ue[Ue.length-1];let Zt=0,gr=n.ParameterStructures.auto;n.ParameterStructures.is(nr)&&(Zt=1,gr=nr);let Dr=Ue.length;s.CancellationToken.is(Rr)&&(Dr=Dr-1,Nt=Rr);const Qe=Dr-Zt;switch(Qe){case 0:kt=void 0;break;case 1:kt=st(gr,Ue[Zt]);break;default:if(gr===n.ParameterStructures.byName)throw new Error(`Received ${Qe} parameters for 'by Name' request parameter structure.`);kt=Ue.slice(Zt,Dr).map(ct=>pe(ct));break}}else{const nr=Ue;tt=Se.method,kt=mt(Se,nr);const Rr=Se.numberOfParams;Nt=s.CancellationToken.is(nr[Rr])?nr[Rr]:void 0}const sr=z++;let Qt;Nt&&(Qt=Nt.onCancellationRequested(()=>{const nr=ve.sender.sendCancellation(_r,sr);return nr===void 0?(F.log(`Received no promise from cancellation strategy when cancelling id ${sr}`),Promise.resolve()):nr.catch(()=>{F.log(`Sending cancellation messages for id ${sr} failed`)})}));const vr={jsonrpc:G,id:sr,method:tt,params:kt};return Ke(vr),typeof ve.sender.enableCancellation=="function"&&ve.sender.enableCancellation(vr),new Promise(async(nr,Rr)=>{const Zt=A(Qe=>{nr(Qe),ve.sender.cleanup(sr),Qt==null||Qt.dispose()},"resolveWithCleanup"),gr=A(Qe=>{Rr(Qe),ve.sender.cleanup(sr),Qt==null||Qt.dispose()},"rejectWithCleanup"),Dr={method:tt,timerStart:Date.now(),resolve:Zt,reject:gr};try{await $.write(vr),te.set(sr,Dr)}catch(Qe){throw F.error("Sending request failed."),Dr.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,Qe.message?Qe.message:"Unknown reason")),Qe}})},"sendRequest"),onRequest:A((Se,Ue)=>{Et();let tt=null;return d.is(Se)?(tt=void 0,H=Se):r.string(Se)?(tt=null,Ue!==void 0&&(tt=Se,q.set(Se,{handler:Ue,type:void 0}))):Ue!==void 0&&(tt=Se.method,q.set(Se.method,{type:Se,handler:Ue})),{dispose:A(()=>{tt!==null&&(tt!==void 0?q.delete(tt):H=void 0)},"dispose")}},"onRequest"),hasPendingResponse:A(()=>te.size>0,"hasPendingResponse"),trace:A(async(Se,Ue,tt)=>{let kt=!1,Nt=g.Text;tt!==void 0&&(r.boolean(tt)?kt=tt:(kt=tt.sendNotification||!1,Nt=tt.traceFormat||g.Text)),ee=Se,Re=Nt,ee===f.Off?Ie=void 0:Ie=Ue,kt&&!he()&&!W()&&await _r.sendNotification(m.type,{value:f.toString(Se)})},"trace"),onError:ce.event,onClose:oe.event,onUnhandledNotification:be.event,onDispose:Pe.event,end:A(()=>{$.end()},"end"),dispose:A(()=>{if(W())return;Be=L.Disposed,Pe.fire(void 0);const Se=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const Ue of te.values())Ue.reject(Se);te=new Map,ge=new Map,J=new Set,Q=new i.LinkedMap,r.func($.dispose)&&$.dispose(),r.func(I.dispose)&&I.dispose()},"dispose"),listen:A(()=>{Et(),vt(),Be=L.Listening,I.listen(Ge)},"listen"),inspect:A(()=>{(0,e.default)().console.log("inspect")},"inspect")};return _r.onNotification(y.type,Se=>{if(ee===f.Off||!Ie)return;const Ue=ee===f.Verbose||ee===f.Compact;Ie.log(Se.message,Ue?Se.verbose:void 0)}),_r.onNotification(u.type,Se=>{const Ue=ie.get(Se.token);Ue?Ue(Se.value):fe.fire(Se)}),_r}A(P,"createMessageConnection"),t.createMessageConnection=P}}),S9=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;var e=sbe();Object.defineProperty(t,"Message",{enumerable:!0,get:A(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:A(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:A(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:A(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:A(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:A(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:A(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:A(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:A(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:A(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:A(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:A(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:A(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:A(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:A(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:A(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:A(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:A(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:A(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:A(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:A(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:A(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:A(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:A(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:A(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:A(function(){return e.ParameterStructures},"get")});var r=obe();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:A(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:A(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:A(function(){return r.Touch},"get")});var n=Iyt();Object.defineProperty(t,"Disposable",{enumerable:!0,get:A(function(){return n.Disposable},"get")});var i=$x();Object.defineProperty(t,"Event",{enumerable:!0,get:A(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:A(function(){return i.Emitter},"get")});var a=CL();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:A(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:A(function(){return a.CancellationToken},"get")});var s=Nyt();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:A(function(){return s.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:A(function(){return s.SharedArrayReceiverStrategy},"get")});var o=Dyt();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:A(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:A(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:A(function(){return o.ReadableStreamMessageReader},"get")});var l=Oyt();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:A(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:A(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:A(function(){return l.WriteableStreamMessageWriter},"get")});var u=$yt();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:A(function(){return u.AbstractMessageBuffer},"get")});var h=Pyt();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:A(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:A(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:A(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:A(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:A(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:A(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:A(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:A(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:A(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:A(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:A(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:A(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:A(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:A(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:A(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:A(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:A(function(){return h.MessageStrategy},"get")});var d=yg();t.RAL=d.default}}),Byt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,h;Object.defineProperty(t,"__esModule",{value:!0});var e=S9(),r=(l=class extends e.AbstractMessageBuffer{constructor(f="utf-8"){super(f),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return l.emptyBuffer}fromString(f,p){return new TextEncoder().encode(f)}toString(f,p){return p==="ascii"?this.asciiDecoder.decode(f):new TextDecoder(p).decode(f)}asNative(f,p){return p===void 0?f:f.slice(0,p)}allocNative(f){return new Uint8Array(f)}},A(l,"MessageBuffer"),l);r.emptyBuffer=new Uint8Array(0);var n=(u=class{constructor(f){this.socket=f,this._onData=new e.Emitter,this._messageListener=p=>{p.data.arrayBuffer().then(m=>{this._onData.fire(new Uint8Array(m))},()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}onData(f){return this._onData.event(f)}},A(u,"ReadableStreamWrapper"),u),i=(h=class{constructor(f){this.socket=f}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}write(f,p){if(typeof f=="string"){if(p!==void 0&&p!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${p}`);this.socket.send(f)}else this.socket.send(f);return Promise.resolve()}end(){this.socket.close()}},A(h,"WritableStreamWrapper"),h),a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:A(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:A((d,f)=>{if(f.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${f.charset}`);return Promise.resolve(a.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:A((d,f)=>{if(!(d instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(d)))},"decode")})}),stream:Object.freeze({asReadableStream:A(d=>new n(d),"asReadableStream"),asWritableStream:A(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:A(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:A(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:A(()=>clearInterval(g),"dispose")}}})});function o(){return s}A(o,"RIL"),(function(d){function f(){e.RAL.install(s)}A(f,"install"),d.install=f})(o||(o={})),t.default=o}}),Px=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(t){var l,u;var e=t&&t.__createBinding||(Object.create?(function(h,d,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:A(function(){return d[f]},"get")}),Object.defineProperty(h,p,g)}):(function(h,d,f,p){p===void 0&&(p=f),h[p]=d[f]})),r=t&&t.__exportStar||function(h,d){for(var f in h)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&e(d,h,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=Byt();n.default.install();var i=S9();r(S9(),t);var a=(l=class extends i.AbstractMessageReader{constructor(d){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},d.addEventListener("error",f=>this.fireError(f)),d.onmessage=this._messageListener}listen(d){return this._onData.event(d)}},A(l,"BrowserMessageReader"),l);t.BrowserMessageReader=a;var s=(u=class extends i.AbstractMessageWriter{constructor(d){super(),this.port=d,this.errorCount=0,d.addEventListener("error",f=>this.fireError(f))}write(d){try{return this.port.postMessage(d),Promise.resolve()}catch(f){return this.handleError(f,d),Promise.reject(f)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){}},A(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=s;function o(h,d,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(h,d,f,p)}A(o,"createMessageConnection"),t.createMessageConnection=o}}),Lte=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=Px()}}),mi=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,h,d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=Px(),r;(function(p){p.clientToServer="clientToServer",p.serverToClient="serverToClient",p.both="both"})(r||(t.MessageDirection=r={}));var n=(l=class{constructor(g){this.method=g}},A(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},A(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var a=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},A(h,"ProtocolRequestType"),h);t.ProtocolRequestType=a;var s=(d=class extends e.NotificationType0{constructor(g){super(g)}},A(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=s;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},A(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),SW=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(h){return h===!0||h===!1}A(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}A(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}A(n,"number"),t.number=n;function i(h){return h instanceof Error}A(i,"error"),t.error=i;function a(h){return typeof h=="function"}A(a,"func"),t.func=a;function s(h){return Array.isArray(h)}A(s,"array"),t.array=s;function o(h){return s(h)&&h.every(d=>r(d))}A(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}A(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}A(u,"objectLiteral"),t.objectLiteral=u}}),Fyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),zyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),Vyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;var e=mi(),r;(function(i){i.method="workspace/workspaceFolders",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(r||(t.WorkspaceFoldersRequest=r={}));var n;(function(i){i.method="workspace/didChangeWorkspaceFolders",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolNotificationType(i.method)})(n||(t.DidChangeWorkspaceFoldersNotification=n={}))}}),Gyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;var e=mi(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),Wyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;var e=mi(),r;(function(i){i.method="textDocument/documentColor",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.DocumentColorRequest=r={}));var n;(function(i){i.method="textDocument/colorPresentation",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.ColorPresentationRequest=n={}))}}),Hyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;var e=mi(),r;(function(i){i.method="textDocument/foldingRange",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.FoldingRangeRequest=r={}));var n;(function(i){i.method="workspace/foldingRange/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.FoldingRangeRefreshRequest=n={}))}}),qyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),Uyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),Yyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;var e=Px(),r=mi(),n;(function(s){s.type=new e.ProgressType;function o(l){return l===s.type}A(o,"is"),s.is=o})(n||(t.WorkDoneProgress=n={}));var i;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=r.MessageDirection.serverToClient,s.type=new r.ProtocolRequestType(s.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var a;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolNotificationType(s.method)})(a||(t.WorkDoneProgressCancelNotification=a={}))}}),Xyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;var e=mi(),r;(function(a){a.method="textDocument/prepareCallHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(a){a.method="callHierarchy/incomingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var i;(function(a){a.method="callHierarchy/outgoingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.CallHierarchyOutgoingCallsRequest=i={}))}}),jyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;var e=mi(),r;(function(l){l.Relative="relative"})(r||(t.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new e.RegistrationType(l.method)})(n||(t.SemanticTokensRegistrationType=n={}));var i;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(t.SemanticTokensRequest=i={}));var a;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensDeltaRequest=a={}));var s;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(s||(t.SemanticTokensRangeRequest=s={}));var o;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(o||(t.SemanticTokensRefreshRequest=o={}))}}),Kyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;var e=mi(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),Zyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),Qyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;var e=mi(),r;(function(u){u.file="file",u.folder="folder"})(r||(t.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(n||(t.WillCreateFilesRequest=n={}));var i;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(i||(t.DidCreateFilesNotification=i={}));var a;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(a||(t.WillRenameFilesRequest=a={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(s||(t.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidDeleteFilesNotification=o={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),Jyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;var e=mi(),r;(function(a){a.document="document",a.project="project",a.group="group",a.scheme="scheme",a.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(a){a.$import="import",a.$export="export",a.local="local"})(n||(t.MonikerKind=n={}));var i;(function(a){a.method="textDocument/moniker",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.MonikerRequest=i={}))}}),e1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=mi(),r;(function(a){a.method="textDocument/prepareTypeHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(a){a.method="typeHierarchy/supertypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var i;(function(a){a.method="typeHierarchy/subtypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.TypeHierarchySubtypesRequest=i={}))}}),t1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;var e=mi(),r;(function(i){i.method="textDocument/inlineValue",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.InlineValueRequest=r={}));var n;(function(i){i.method="workspace/inlineValue/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.InlineValueRefreshRequest=n={}))}}),r1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;var e=mi(),r;(function(a){a.method="textDocument/inlayHint",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.InlayHintRequest=r={}));var n;(function(a){a.method="inlayHint/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.InlayHintResolveRequest=n={}));var i;(function(a){a.method="workspace/inlayHint/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(i||(t.InlayHintRefreshRequest=i={}))}}),n1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;var e=Px(),r=SW(),n=mi(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}A(h,"is"),u.is=h})(i||(t.DiagnosticServerCancellationData=i={}));var a;(function(u){u.Full="full",u.Unchanged="unchanged"})(a||(t.DocumentDiagnosticReportKind=a={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(s||(t.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.WorkspaceDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(l||(t.DiagnosticRefreshRequest=l={}))}}),i1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;var e=(SS(),kW(wL)),r=SW(),n=mi(),i;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}A(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var a;(function(g){function m(T,b){const w={executionOrder:T};return(b===!0||b===!1)&&(w.success=b),w}A(m,"create"),g.create=m;function y(T){const b=T;return r.objectLiteral(b)&&e.uinteger.is(b.executionOrder)&&(b.success===void 0||r.boolean(b.success))}A(y,"is"),g.is=y;function v(T,b){return T===b?!0:T==null||b===null||b===void 0?!1:T.executionOrder===b.executionOrder&&T.success===b.success}A(v,"equals"),g.equals=v})(a||(t.ExecutionSummary=a={}));var s;(function(g){function m(b,w){return{kind:b,document:w}}A(m,"create"),g.create=m;function y(b){const w=b;return r.objectLiteral(w)&&i.is(w.kind)&&e.DocumentUri.is(w.document)&&(w.metadata===void 0||r.objectLiteral(w.metadata))}A(y,"is"),g.is=y;function v(b,w){const C=new Set;return b.document!==w.document&&C.add("document"),b.kind!==w.kind&&C.add("kind"),b.executionSummary!==w.executionSummary&&C.add("executionSummary"),(b.metadata!==void 0||w.metadata!==void 0)&&!T(b.metadata,w.metadata)&&C.add("metadata"),(b.executionSummary!==void 0||w.executionSummary!==void 0)&&!a.equals(b.executionSummary,w.executionSummary)&&C.add("executionSummary"),C}A(v,"diff"),g.diff=v;function T(b,w){if(b===w)return!0;if(b==null||w===null||w===void 0||typeof b!=typeof w||typeof b!="object")return!1;const C=Array.isArray(b),S=Array.isArray(w);if(C!==S)return!1;if(C&&S){if(b.length!==w.length)return!1;for(let k=0;k0}A(Ct,"hasId"),pe.hasId=Ct})(N||(t.StaticRegistrationOptions=N={}));var F;(function(pe){function Ct(lt){const st=lt;return st&&(st.documentSelector===null||P.is(st.documentSelector))}A(Ct,"is"),pe.is=Ct})(F||(t.TextDocumentRegistrationOptions=F={}));var z;(function(pe){function Ct(st){const mt=st;return n.objectLiteral(mt)&&(mt.workDoneProgress===void 0||n.boolean(mt.workDoneProgress))}A(Ct,"is"),pe.is=Ct;function lt(st){const mt=st;return mt&&n.boolean(mt.workDoneProgress)}A(lt,"hasWorkDoneProgress"),pe.hasWorkDoneProgress=lt})(z||(t.WorkDoneProgressOptions=z={}));var V;(function(pe){pe.method="initialize",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(V||(t.InitializeRequest=V={}));var B;(function(pe){pe.unknownProtocolVersion=1})(B||(t.InitializeErrorCodes=B={}));var G;(function(pe){pe.method="initialized",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(G||(t.InitializedNotification=G={}));var H;(function(pe){pe.method="shutdown",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType0(pe.method)})(H||(t.ShutdownRequest=H={}));var q;(function(pe){pe.method="exit",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType0(pe.method)})(q||(t.ExitNotification=q={}));var Z;(function(pe){pe.method="workspace/didChangeConfiguration",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(Z||(t.DidChangeConfigurationNotification=Z={}));var Y;(function(pe){pe.Error=1,pe.Warning=2,pe.Info=3,pe.Log=4,pe.Debug=5})(Y||(t.MessageType=Y={}));var ie;(function(pe){pe.method="window/showMessage",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolNotificationType(pe.method)})(ie||(t.ShowMessageNotification=ie={}));var K;(function(pe){pe.method="window/showMessageRequest",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolRequestType(pe.method)})(K||(t.ShowMessageRequest=K={}));var Q;(function(pe){pe.method="window/logMessage",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolNotificationType(pe.method)})(Q||(t.LogMessageNotification=Q={}));var te;(function(pe){pe.method="telemetry/event",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolNotificationType(pe.method)})(te||(t.TelemetryEventNotification=te={}));var J;(function(pe){pe.None=0,pe.Full=1,pe.Incremental=2})(J||(t.TextDocumentSyncKind=J={}));var ge;(function(pe){pe.method="textDocument/didOpen",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(ge||(t.DidOpenTextDocumentNotification=ge={}));var ee;(function(pe){function Ct(st){let mt=st;return mt!=null&&typeof mt.text=="string"&&mt.range!==void 0&&(mt.rangeLength===void 0||typeof mt.rangeLength=="number")}A(Ct,"isIncremental"),pe.isIncremental=Ct;function lt(st){let mt=st;return mt!=null&&typeof mt.text=="string"&&mt.range===void 0&&mt.rangeLength===void 0}A(lt,"isFull"),pe.isFull=lt})(ee||(t.TextDocumentContentChangeEvent=ee={}));var Re;(function(pe){pe.method="textDocument/didChange",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(Re||(t.DidChangeTextDocumentNotification=Re={}));var Ie;(function(pe){pe.method="textDocument/didClose",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(Ie||(t.DidCloseTextDocumentNotification=Ie={}));var Be;(function(pe){pe.method="textDocument/didSave",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(Be||(t.DidSaveTextDocumentNotification=Be={}));var ce;(function(pe){pe.Manual=1,pe.AfterDelay=2,pe.FocusOut=3})(ce||(t.TextDocumentSaveReason=ce={}));var oe;(function(pe){pe.method="textDocument/willSave",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(oe||(t.WillSaveTextDocumentNotification=oe={}));var be;(function(pe){pe.method="textDocument/willSaveWaitUntil",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(be||(t.WillSaveTextDocumentWaitUntilRequest=be={}));var fe;(function(pe){pe.method="workspace/didChangeWatchedFiles",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(fe||(t.DidChangeWatchedFilesNotification=fe={}));var Pe;(function(pe){pe.Created=1,pe.Changed=2,pe.Deleted=3})(Pe||(t.FileChangeType=Pe={}));var ve;(function(pe){function Ct(lt){const st=lt;return n.objectLiteral(st)&&(r.URI.is(st.baseUri)||r.WorkspaceFolder.is(st.baseUri))&&n.string(st.pattern)}A(Ct,"is"),pe.is=Ct})(ve||(t.RelativePattern=ve={}));var Ce;(function(pe){pe.Create=1,pe.Change=2,pe.Delete=4})(Ce||(t.WatchKind=Ce={}));var Ve;(function(pe){pe.method="textDocument/publishDiagnostics",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolNotificationType(pe.method)})(Ve||(t.PublishDiagnosticsNotification=Ve={}));var se;(function(pe){pe.Invoked=1,pe.TriggerCharacter=2,pe.TriggerForIncompleteCompletions=3})(se||(t.CompletionTriggerKind=se={}));var de;(function(pe){pe.method="textDocument/completion",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(de||(t.CompletionRequest=de={}));var Te;(function(pe){pe.method="completionItem/resolve",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Te||(t.CompletionResolveRequest=Te={}));var ae;(function(pe){pe.method="textDocument/hover",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(ae||(t.HoverRequest=ae={}));var he;(function(pe){pe.Invoked=1,pe.TriggerCharacter=2,pe.ContentChange=3})(he||(t.SignatureHelpTriggerKind=he={}));var W;(function(pe){pe.method="textDocument/signatureHelp",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(W||(t.SignatureHelpRequest=W={}));var ne;(function(pe){pe.method="textDocument/definition",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(ne||(t.DefinitionRequest=ne={}));var j;(function(pe){pe.method="textDocument/references",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(j||(t.ReferencesRequest=j={}));var ue;(function(pe){pe.method="textDocument/documentHighlight",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(ue||(t.DocumentHighlightRequest=ue={}));var X;(function(pe){pe.method="textDocument/documentSymbol",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(X||(t.DocumentSymbolRequest=X={}));var Oe;(function(pe){pe.method="textDocument/codeAction",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Oe||(t.CodeActionRequest=Oe={}));var xe;(function(pe){pe.method="codeAction/resolve",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(xe||(t.CodeActionResolveRequest=xe={}));var Ge;(function(pe){pe.method="workspace/symbol",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Ge||(t.WorkspaceSymbolRequest=Ge={}));var _e;(function(pe){pe.method="workspaceSymbol/resolve",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(_e||(t.WorkspaceSymbolResolveRequest=_e={}));var $e;(function(pe){pe.method="textDocument/codeLens",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})($e||(t.CodeLensRequest=$e={}));var Me;(function(pe){pe.method="codeLens/resolve",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Me||(t.CodeLensResolveRequest=Me={}));var He;(function(pe){pe.method="workspace/codeLens/refresh",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolRequestType0(pe.method)})(He||(t.CodeLensRefreshRequest=He={}));var De;(function(pe){pe.method="textDocument/documentLink",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(De||(t.DocumentLinkRequest=De={}));var Ke;(function(pe){pe.method="documentLink/resolve",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Ke||(t.DocumentLinkResolveRequest=Ke={}));var Ae;(function(pe){pe.method="textDocument/formatting",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Ae||(t.DocumentFormattingRequest=Ae={}));var at;(function(pe){pe.method="textDocument/rangeFormatting",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(at||(t.DocumentRangeFormattingRequest=at={}));var Ee;(function(pe){pe.method="textDocument/rangesFormatting",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Ee||(t.DocumentRangesFormattingRequest=Ee={}));var pt;(function(pe){pe.method="textDocument/onTypeFormatting",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(pt||(t.DocumentOnTypeFormattingRequest=pt={}));var ht;(function(pe){pe.Identifier=1})(ht||(t.PrepareSupportDefaultBehavior=ht={}));var rt;(function(pe){pe.method="textDocument/rename",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(rt||(t.RenameRequest=rt={}));var Et;(function(pe){pe.method="textDocument/prepareRename",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Et||(t.PrepareRenameRequest=Et={}));var vt;(function(pe){pe.method="workspace/executeCommand",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(vt||(t.ExecuteCommandRequest=vt={}));var ot;(function(pe){pe.method="workspace/applyEdit",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolRequestType("workspace/applyEdit")})(ot||(t.ApplyWorkspaceEditRequest=ot={}))}}),o1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var e=Px();function r(n,i,a,s){return e.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,e.createMessageConnection)(n,i,a,s)}A(r,"createProtocolConnection"),t.createProtocolConnection=r}}),l1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:A(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(Px(),t),r((SS(),kW(wL)),t),r(mi(),t),r(s1t(),t);var n=o1t();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:A(function(){return n.createProtocolConnection},"get")});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}}),c1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:A(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=Lte();r(Lte(),t),r(l1t(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}A(i,"createProtocolConnection"),t.createProtocolConnection=i}}),cbe={};Df(cbe,{AbstractAstReflection:()=>_W,AbstractCstNode:()=>Lq,AbstractLangiumParser:()=>Iq,AbstractParserErrorMessageProvider:()=>K3e,AbstractThreadedAsyncParser:()=>N4t,AstUtils:()=>RW,BiMap:()=>d6,Cancellation:()=>zn,CompositeCstNodeImpl:()=>b7,ContextCache:()=>E7,CstNodeBuilder:()=>Y3e,CstUtils:()=>EW,DEFAULT_TOKENIZE_OPTIONS:()=>Kq,DONE_RESULT:()=>Is,DatatypeSymbol:()=>l6,DefaultAstNodeDescriptionProvider:()=>E5e,DefaultAstNodeLocator:()=>_5e,DefaultAsyncParser:()=>U5e,DefaultCommentProvider:()=>q5e,DefaultConfigurationProvider:()=>R5e,DefaultDocumentBuilder:()=>L5e,DefaultDocumentValidator:()=>S5e,DefaultHydrator:()=>X5e,DefaultIndexManager:()=>M5e,DefaultJsonSerializer:()=>T5e,DefaultLangiumDocumentFactory:()=>d5e,DefaultLangiumDocuments:()=>f5e,DefaultLangiumProfiler:()=>B4t,DefaultLexer:()=>Zq,DefaultLexerErrorMessageProvider:()=>N5e,DefaultLinker:()=>p5e,DefaultNameProvider:()=>g5e,DefaultReferenceDescriptionProvider:()=>A5e,DefaultReferences:()=>m5e,DefaultScopeComputation:()=>y5e,DefaultScopeProvider:()=>x5e,DefaultServiceRegistry:()=>w5e,DefaultTokenBuilder:()=>w7,DefaultValueConverter:()=>Fq,DefaultWorkspaceLock:()=>Y5e,DefaultWorkspaceManager:()=>I5e,Deferred:()=>Mh,Disposable:()=>p0,DisposableCache:()=>S7,DocumentCache:()=>b5e,DocumentState:()=>Gr,DocumentValidator:()=>ul,EMPTY_SCOPE:()=>R4t,EMPTY_STREAM:()=>Xb,EmptyFileSystem:()=>ns,EmptyFileSystemProvider:()=>Z5e,ErrorWithLocation:()=>IL,GrammarAST:()=>dbe,GrammarUtils:()=>aH,IndentationAwareLexer:()=>O4t,IndentationAwareTokenBuilder:()=>K5e,JSDocDocumentationProvider:()=>H5e,LangiumCompletionParser:()=>Z3e,LangiumParser:()=>j3e,LangiumParserErrorMessageProvider:()=>Nq,LeafCstNodeImpl:()=>o6,LexingMode:()=>n0,MapScope:()=>_4t,Module:()=>aB,MultiMap:()=>Ih,MultiMapScope:()=>v5e,OperationCancelled:()=>Vc,ParserWorker:()=>D4t,ProfilingTask:()=>J5e,Reduction:()=>hk,RefResolving:()=>mp,RegExpUtils:()=>oH,RootCstNodeImpl:()=>Mq,SimpleCache:()=>qq,StreamImpl:()=>zc,StreamScope:()=>tB,TextDocument:()=>u6,TreeStreamImpl:()=>jb,URI:()=>Bo,UriTrie:()=>Wq,UriUtils:()=>Fs,VALIDATE_EACH_NODE:()=>k5e,ValidationCategory:()=>f6,ValidationRegistry:()=>C5e,ValueConverter:()=>Nc,WorkspaceCache:()=>Uq,assertCondition:()=>sH,assertUnreachable:()=>Of,createCompletionParser:()=>$q,createDefaultCoreModule:()=>La,createDefaultSharedCoreModule:()=>Ma,createGrammarConfig:()=>SH,createLangiumParser:()=>Pq,createParser:()=>x7,delayNextTick:()=>C7,diagnosticData:()=>r0,eagerLoad:()=>iU,getDiagnosticRange:()=>Xq,indentationBuilderDefaultOptions:()=>oB,inject:()=>tn,interruptAndCheck:()=>va,isAstNode:()=>Hi,isAstNodeDescription:()=>AW,isAstNodeWithComment:()=>Yq,isCompositeCstNode:()=>Ch,isIMultiModeLexerDefinition:()=>R7,isJSDoc:()=>Jq,isLeafCstNode:()=>vg,isLinkingError:()=>_p,isMultiReference:()=>Yc,isNamed:()=>Hq,isOperationCancelled:()=>Pg,isReference:()=>Bs,isRootCstNode:()=>kL,isTokenTypeArray:()=>_7,isTokenTypeDictionary:()=>p6,loadGrammarFromJson:()=>Ia,parseJSDoc:()=>Qq,prepareLangiumParser:()=>Bq,setInterruptionPeriod:()=>zq,startCancelableOperation:()=>k7,stream:()=>Sn,toDiagnosticData:()=>jq,toDiagnosticSeverity:()=>lC});var EW={};Df(EW,{DefaultNameRegexp:()=>eH,RangeComparison:()=>$c,compareRange:()=>QW,findCommentNode:()=>tH,findDeclarationNodeAtOffset:()=>Mbe,findLeafNodeAtOffset:()=>ML,findLeafNodeBeforeOffset:()=>rH,flattenCst:()=>Lbe,getDatatypeNode:()=>Rbe,getInteriorNodes:()=>Dbe,getNextNode:()=>Ibe,getPreviousNode:()=>iH,getStartlineNode:()=>Nbe,inRange:()=>JW,isChildNode:()=>ZW,isCommentNode:()=>q_,streamCst:()=>Jb,toDocumentSegment:()=>ex,tokenToRange:()=>dk});function Hi(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}A(Hi,"isAstNode");function Bs(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}A(Bs,"isReference");function Yc(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}A(Yc,"isMultiReference");function AW(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}A(AW,"isAstNodeDescription");function _p(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}A(_p,"isLinkingError");var Ky,_W=(Ky=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Hi(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}},A(Ky,"AbstractAstReflection"),Ky);function Ch(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}A(Ch,"isCompositeCstNode");function vg(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}A(vg,"isLeafCstNode");function kL(t){return Ch(t)&&typeof t.fullText=="string"}A(kL,"isRootCstNode");var lo,zc=(lo=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:A(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new lo(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return Is})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=ube(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new lo(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?Is:{done:!1,value:e(i)}})}filter(e){return new lo(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Is})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new lo(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(uk(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return Is})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new lo(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(uk(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return Is})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new lo(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Is:this.nextFn(r.state)))}distinct(e){return new lo(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return Is})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}},A(lo,"StreamImpl"),lo);function ube(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}A(ube,"toString");function uk(t){return!!t&&typeof t[Symbol.iterator]=="function"}A(uk,"isIterable");var Xb=new zc(()=>{},()=>Is),Is=Object.freeze({done:!0,value:void 0});function Sn(...t){if(t.length===1){const e=t[0];if(e instanceof zc)return e;if(uk(e))return new zc(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new zc(()=>({index:0}),r=>r.index1?new zc(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return Is})}iterator(){const e={state:this.startFn(),next:A(()=>this.nextFn(e.state),"next"),prune:A(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},A(Zy,"TreeStreamImpl"),Zy),hk;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}A(e,"sum"),t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}A(r,"product"),t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}A(n,"min"),t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}A(i,"max"),t.max=i})(hk||(hk={}));var RW={};Df(RW,{assignMandatoryProperties:()=>LW,copyAstNode:()=>M_,findRootNode:()=>Cy,getContainerOfType:()=>bg,getDocument:()=>tc,getReferenceNodes:()=>R_,hasContainerOfType:()=>hbe,linkContentToContainer:()=>Kb,streamAllContents:()=>Uh,streamAst:()=>rc,streamContents:()=>AS,streamReferences:()=>Zb});function Kb(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Hi(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&Kb(i,e))}):Hi(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&Kb(n,e)))}A(Kb,"linkContentToContainer");function bg(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}A(bg,"getContainerOfType");function hbe(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}A(hbe,"hasContainerOfType");function tc(t){const r=Cy(t).$document;if(!r)throw new Error("AST node has no document.");return r}A(tc,"getDocument");function Cy(t){for(;t.$container;)t=t.$container;return t}A(Cy,"findRootNode");function R_(t){return Bs(t)?t.ref?[t.ref]:[]:Yc(t)?t.items.map(e=>e.ref):[]}A(R_,"getReferenceNodes");function AS(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new zc(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexAS(r,e))}A(Uh,"streamAllContents");function rc(t,e){if(t){if(e!=null&&e.range&&!L_(t,e.range))return new jb(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new jb(t,r=>AS(r,e),{includeRoot:!0})}A(rc,"streamAst");function L_(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?JW(r,e):!1}A(L_,"isAstNodeInRange");function Zb(t){return new zc(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexao,AbstractParserRule:()=>Xw,AbstractRule:()=>Zm,AbstractType:()=>_o,Action:()=>gd,Alternatives:()=>jw,ArrayLiteral:()=>I_,ArrayType:()=>N_,Assignment:()=>md,BooleanLiteral:()=>D_,CharacterRange:()=>yd,Condition:()=>vd,Conjunction:()=>Kw,CrossReference:()=>bd,Disjunction:()=>Zw,EndOfFile:()=>O_,Grammar:()=>Gu,GrammarImport:()=>$_,Group:()=>Rp,InferredType:()=>P_,InfixRule:()=>_c,InfixRuleOperatorList:()=>Qw,InfixRuleOperators:()=>B_,Interface:()=>Qm,Keyword:()=>Jm,LangiumGrammarAstReflection:()=>KW,LangiumGrammarTerminals:()=>u1t,NamedArgument:()=>ey,NegatedToken:()=>Lp,Negation:()=>F_,NumberLiteral:()=>z_,Parameter:()=>ty,ParameterReference:()=>V_,ParserRule:()=>Il,ReferenceType:()=>Jw,RegexToken:()=>Mp,ReturnType:()=>G_,RuleCall:()=>Ip,SimpleType:()=>ry,StringLiteral:()=>W_,TerminalAlternatives:()=>Np,TerminalElement:()=>so,TerminalGroup:()=>Dp,TerminalRule:()=>Wu,TerminalRuleCall:()=>Op,Type:()=>eC,TypeAttribute:()=>$p,TypeDefinition:()=>Pp,UnionType:()=>H_,UnorderedGroup:()=>tC,UntilToken:()=>Bp,ValueLiteral:()=>Fp,Wildcard:()=>ny,isAbstractElement:()=>SL,isAbstractParserRule:()=>xg,isAbstractRule:()=>fbe,isAbstractType:()=>pbe,isAction:()=>pf,isAlternatives:()=>EL,isArrayLiteral:()=>gbe,isArrayType:()=>IW,isAssignment:()=>kh,isBooleanLiteral:()=>NW,isCharacterRange:()=>DW,isCondition:()=>mbe,isConjunction:()=>OW,isCrossReference:()=>Tg,isDisjunction:()=>$W,isEndOfFile:()=>PW,isGrammar:()=>ybe,isGrammarImport:()=>vbe,isGroup:()=>wg,isInferredType:()=>_S,isInfixRule:()=>Qb,isInfixRuleOperatorList:()=>bbe,isInfixRuleOperators:()=>xbe,isInterface:()=>BW,isKeyword:()=>Sh,isNamedArgument:()=>Tbe,isNegatedToken:()=>FW,isNegation:()=>zW,isNumberLiteral:()=>wbe,isParameter:()=>Cbe,isParameterReference:()=>VW,isParserRule:()=>Ys,isReferenceType:()=>GW,isRegexToken:()=>WW,isReturnType:()=>HW,isRuleCall:()=>Eh,isSimpleType:()=>AL,isStringLiteral:()=>kbe,isTerminalAlternatives:()=>qW,isTerminalElement:()=>Sbe,isTerminalGroup:()=>UW,isTerminalRule:()=>Sl,isTerminalRuleCall:()=>_L,isType:()=>RL,isTypeAttribute:()=>Ebe,isTypeDefinition:()=>Abe,isUnionType:()=>YW,isUnorderedGroup:()=>LL,isUntilToken:()=>XW,isValueLiteral:()=>_be,isWildcard:()=>jW,reflection:()=>pr});var u1t={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},ao={$type:"AbstractElement",cardinality:"cardinality"};function SL(t){return pr.isInstance(t,ao.$type)}A(SL,"isAbstractElement");var Xw={$type:"AbstractParserRule"};function xg(t){return pr.isInstance(t,Xw.$type)}A(xg,"isAbstractParserRule");var Zm={$type:"AbstractRule"};function fbe(t){return pr.isInstance(t,Zm.$type)}A(fbe,"isAbstractRule");var _o={$type:"AbstractType"};function pbe(t){return pr.isInstance(t,_o.$type)}A(pbe,"isAbstractType");var gd={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function pf(t){return pr.isInstance(t,gd.$type)}A(pf,"isAction");var jw={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function EL(t){return pr.isInstance(t,jw.$type)}A(EL,"isAlternatives");var I_={$type:"ArrayLiteral",elements:"elements"};function gbe(t){return pr.isInstance(t,I_.$type)}A(gbe,"isArrayLiteral");var N_={$type:"ArrayType",elementType:"elementType"};function IW(t){return pr.isInstance(t,N_.$type)}A(IW,"isArrayType");var md={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function kh(t){return pr.isInstance(t,md.$type)}A(kh,"isAssignment");var D_={$type:"BooleanLiteral",true:"true"};function NW(t){return pr.isInstance(t,D_.$type)}A(NW,"isBooleanLiteral");var yd={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function DW(t){return pr.isInstance(t,yd.$type)}A(DW,"isCharacterRange");var vd={$type:"Condition"};function mbe(t){return pr.isInstance(t,vd.$type)}A(mbe,"isCondition");var Kw={$type:"Conjunction",left:"left",right:"right"};function OW(t){return pr.isInstance(t,Kw.$type)}A(OW,"isConjunction");var bd={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Tg(t){return pr.isInstance(t,bd.$type)}A(Tg,"isCrossReference");var Zw={$type:"Disjunction",left:"left",right:"right"};function $W(t){return pr.isInstance(t,Zw.$type)}A($W,"isDisjunction");var O_={$type:"EndOfFile",cardinality:"cardinality"};function PW(t){return pr.isInstance(t,O_.$type)}A(PW,"isEndOfFile");var Gu={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function ybe(t){return pr.isInstance(t,Gu.$type)}A(ybe,"isGrammar");var $_={$type:"GrammarImport",path:"path"};function vbe(t){return pr.isInstance(t,$_.$type)}A(vbe,"isGrammarImport");var Rp={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function wg(t){return pr.isInstance(t,Rp.$type)}A(wg,"isGroup");var P_={$type:"InferredType",name:"name"};function _S(t){return pr.isInstance(t,P_.$type)}A(_S,"isInferredType");var _c={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Qb(t){return pr.isInstance(t,_c.$type)}A(Qb,"isInfixRule");var Qw={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function bbe(t){return pr.isInstance(t,Qw.$type)}A(bbe,"isInfixRuleOperatorList");var B_={$type:"InfixRuleOperators",precedences:"precedences"};function xbe(t){return pr.isInstance(t,B_.$type)}A(xbe,"isInfixRuleOperators");var Qm={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function BW(t){return pr.isInstance(t,Qm.$type)}A(BW,"isInterface");var Jm={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Sh(t){return pr.isInstance(t,Jm.$type)}A(Sh,"isKeyword");var ey={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function Tbe(t){return pr.isInstance(t,ey.$type)}A(Tbe,"isNamedArgument");var Lp={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function FW(t){return pr.isInstance(t,Lp.$type)}A(FW,"isNegatedToken");var F_={$type:"Negation",value:"value"};function zW(t){return pr.isInstance(t,F_.$type)}A(zW,"isNegation");var z_={$type:"NumberLiteral",value:"value"};function wbe(t){return pr.isInstance(t,z_.$type)}A(wbe,"isNumberLiteral");var ty={$type:"Parameter",name:"name"};function Cbe(t){return pr.isInstance(t,ty.$type)}A(Cbe,"isParameter");var V_={$type:"ParameterReference",parameter:"parameter"};function VW(t){return pr.isInstance(t,V_.$type)}A(VW,"isParameterReference");var Il={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Ys(t){return pr.isInstance(t,Il.$type)}A(Ys,"isParserRule");var Jw={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function GW(t){return pr.isInstance(t,Jw.$type)}A(GW,"isReferenceType");var Mp={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function WW(t){return pr.isInstance(t,Mp.$type)}A(WW,"isRegexToken");var G_={$type:"ReturnType",name:"name"};function HW(t){return pr.isInstance(t,G_.$type)}A(HW,"isReturnType");var Ip={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Eh(t){return pr.isInstance(t,Ip.$type)}A(Eh,"isRuleCall");var ry={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function AL(t){return pr.isInstance(t,ry.$type)}A(AL,"isSimpleType");var W_={$type:"StringLiteral",value:"value"};function kbe(t){return pr.isInstance(t,W_.$type)}A(kbe,"isStringLiteral");var Np={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function qW(t){return pr.isInstance(t,Np.$type)}A(qW,"isTerminalAlternatives");var so={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Sbe(t){return pr.isInstance(t,so.$type)}A(Sbe,"isTerminalElement");var Dp={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function UW(t){return pr.isInstance(t,Dp.$type)}A(UW,"isTerminalGroup");var Wu={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Sl(t){return pr.isInstance(t,Wu.$type)}A(Sl,"isTerminalRule");var Op={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function _L(t){return pr.isInstance(t,Op.$type)}A(_L,"isTerminalRuleCall");var eC={$type:"Type",name:"name",type:"type"};function RL(t){return pr.isInstance(t,eC.$type)}A(RL,"isType");var $p={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function Ebe(t){return pr.isInstance(t,$p.$type)}A(Ebe,"isTypeAttribute");var Pp={$type:"TypeDefinition"};function Abe(t){return pr.isInstance(t,Pp.$type)}A(Abe,"isTypeDefinition");var H_={$type:"UnionType",types:"types"};function YW(t){return pr.isInstance(t,H_.$type)}A(YW,"isUnionType");var tC={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function LL(t){return pr.isInstance(t,tC.$type)}A(LL,"isUnorderedGroup");var Bp={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function XW(t){return pr.isInstance(t,Bp.$type)}A(XW,"isUntilToken");var Fp={$type:"ValueLiteral"};function _be(t){return pr.isInstance(t,Fp.$type)}A(_be,"isValueLiteral");var ny={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function jW(t){return pr.isInstance(t,ny.$type)}A(jW,"isWildcard");var Qy,KW=(Qy=class extends _W{constructor(){super(...arguments),this.types={AbstractElement:{name:ao.$type,properties:{cardinality:{name:ao.cardinality}},superTypes:[]},AbstractParserRule:{name:Xw.$type,properties:{},superTypes:[Zm.$type,_o.$type]},AbstractRule:{name:Zm.$type,properties:{},superTypes:[]},AbstractType:{name:_o.$type,properties:{},superTypes:[]},Action:{name:gd.$type,properties:{cardinality:{name:gd.cardinality},feature:{name:gd.feature},inferredType:{name:gd.inferredType},operator:{name:gd.operator},type:{name:gd.type,referenceType:_o.$type}},superTypes:[ao.$type]},Alternatives:{name:jw.$type,properties:{cardinality:{name:jw.cardinality},elements:{name:jw.elements,defaultValue:[]}},superTypes:[ao.$type]},ArrayLiteral:{name:I_.$type,properties:{elements:{name:I_.elements,defaultValue:[]}},superTypes:[Fp.$type]},ArrayType:{name:N_.$type,properties:{elementType:{name:N_.elementType}},superTypes:[Pp.$type]},Assignment:{name:md.$type,properties:{cardinality:{name:md.cardinality},feature:{name:md.feature},operator:{name:md.operator},predicate:{name:md.predicate},terminal:{name:md.terminal}},superTypes:[ao.$type]},BooleanLiteral:{name:D_.$type,properties:{true:{name:D_.true,defaultValue:!1}},superTypes:[vd.$type,Fp.$type]},CharacterRange:{name:yd.$type,properties:{cardinality:{name:yd.cardinality},left:{name:yd.left},lookahead:{name:yd.lookahead},parenthesized:{name:yd.parenthesized,defaultValue:!1},right:{name:yd.right}},superTypes:[so.$type]},Condition:{name:vd.$type,properties:{},superTypes:[]},Conjunction:{name:Kw.$type,properties:{left:{name:Kw.left},right:{name:Kw.right}},superTypes:[vd.$type]},CrossReference:{name:bd.$type,properties:{cardinality:{name:bd.cardinality},deprecatedSyntax:{name:bd.deprecatedSyntax,defaultValue:!1},isMulti:{name:bd.isMulti,defaultValue:!1},terminal:{name:bd.terminal},type:{name:bd.type,referenceType:_o.$type}},superTypes:[ao.$type]},Disjunction:{name:Zw.$type,properties:{left:{name:Zw.left},right:{name:Zw.right}},superTypes:[vd.$type]},EndOfFile:{name:O_.$type,properties:{cardinality:{name:O_.cardinality}},superTypes:[ao.$type]},Grammar:{name:Gu.$type,properties:{imports:{name:Gu.imports,defaultValue:[]},interfaces:{name:Gu.interfaces,defaultValue:[]},isDeclared:{name:Gu.isDeclared,defaultValue:!1},name:{name:Gu.name},rules:{name:Gu.rules,defaultValue:[]},types:{name:Gu.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:$_.$type,properties:{path:{name:$_.path}},superTypes:[]},Group:{name:Rp.$type,properties:{cardinality:{name:Rp.cardinality},elements:{name:Rp.elements,defaultValue:[]},guardCondition:{name:Rp.guardCondition},predicate:{name:Rp.predicate}},superTypes:[ao.$type]},InferredType:{name:P_.$type,properties:{name:{name:P_.name}},superTypes:[_o.$type]},InfixRule:{name:_c.$type,properties:{call:{name:_c.call},dataType:{name:_c.dataType},inferredType:{name:_c.inferredType},name:{name:_c.name},operators:{name:_c.operators},parameters:{name:_c.parameters,defaultValue:[]},returnType:{name:_c.returnType,referenceType:_o.$type}},superTypes:[Xw.$type]},InfixRuleOperatorList:{name:Qw.$type,properties:{associativity:{name:Qw.associativity},operators:{name:Qw.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:B_.$type,properties:{precedences:{name:B_.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Qm.$type,properties:{attributes:{name:Qm.attributes,defaultValue:[]},name:{name:Qm.name},superTypes:{name:Qm.superTypes,defaultValue:[],referenceType:_o.$type}},superTypes:[_o.$type]},Keyword:{name:Jm.$type,properties:{cardinality:{name:Jm.cardinality},predicate:{name:Jm.predicate},value:{name:Jm.value}},superTypes:[ao.$type]},NamedArgument:{name:ey.$type,properties:{calledByName:{name:ey.calledByName,defaultValue:!1},parameter:{name:ey.parameter,referenceType:ty.$type},value:{name:ey.value}},superTypes:[]},NegatedToken:{name:Lp.$type,properties:{cardinality:{name:Lp.cardinality},lookahead:{name:Lp.lookahead},parenthesized:{name:Lp.parenthesized,defaultValue:!1},terminal:{name:Lp.terminal}},superTypes:[so.$type]},Negation:{name:F_.$type,properties:{value:{name:F_.value}},superTypes:[vd.$type]},NumberLiteral:{name:z_.$type,properties:{value:{name:z_.value}},superTypes:[Fp.$type]},Parameter:{name:ty.$type,properties:{name:{name:ty.name}},superTypes:[]},ParameterReference:{name:V_.$type,properties:{parameter:{name:V_.parameter,referenceType:ty.$type}},superTypes:[vd.$type]},ParserRule:{name:Il.$type,properties:{dataType:{name:Il.dataType},definition:{name:Il.definition},entry:{name:Il.entry,defaultValue:!1},fragment:{name:Il.fragment,defaultValue:!1},inferredType:{name:Il.inferredType},name:{name:Il.name},parameters:{name:Il.parameters,defaultValue:[]},returnType:{name:Il.returnType,referenceType:_o.$type}},superTypes:[Xw.$type]},ReferenceType:{name:Jw.$type,properties:{isMulti:{name:Jw.isMulti,defaultValue:!1},referenceType:{name:Jw.referenceType}},superTypes:[Pp.$type]},RegexToken:{name:Mp.$type,properties:{cardinality:{name:Mp.cardinality},lookahead:{name:Mp.lookahead},parenthesized:{name:Mp.parenthesized,defaultValue:!1},regex:{name:Mp.regex}},superTypes:[so.$type]},ReturnType:{name:G_.$type,properties:{name:{name:G_.name}},superTypes:[]},RuleCall:{name:Ip.$type,properties:{arguments:{name:Ip.arguments,defaultValue:[]},cardinality:{name:Ip.cardinality},predicate:{name:Ip.predicate},rule:{name:Ip.rule,referenceType:Zm.$type}},superTypes:[ao.$type]},SimpleType:{name:ry.$type,properties:{primitiveType:{name:ry.primitiveType},stringType:{name:ry.stringType},typeRef:{name:ry.typeRef,referenceType:_o.$type}},superTypes:[Pp.$type]},StringLiteral:{name:W_.$type,properties:{value:{name:W_.value}},superTypes:[Fp.$type]},TerminalAlternatives:{name:Np.$type,properties:{cardinality:{name:Np.cardinality},elements:{name:Np.elements,defaultValue:[]},lookahead:{name:Np.lookahead},parenthesized:{name:Np.parenthesized,defaultValue:!1}},superTypes:[so.$type]},TerminalElement:{name:so.$type,properties:{cardinality:{name:so.cardinality},lookahead:{name:so.lookahead},parenthesized:{name:so.parenthesized,defaultValue:!1}},superTypes:[ao.$type]},TerminalGroup:{name:Dp.$type,properties:{cardinality:{name:Dp.cardinality},elements:{name:Dp.elements,defaultValue:[]},lookahead:{name:Dp.lookahead},parenthesized:{name:Dp.parenthesized,defaultValue:!1}},superTypes:[so.$type]},TerminalRule:{name:Wu.$type,properties:{definition:{name:Wu.definition},fragment:{name:Wu.fragment,defaultValue:!1},hidden:{name:Wu.hidden,defaultValue:!1},name:{name:Wu.name},type:{name:Wu.type}},superTypes:[Zm.$type]},TerminalRuleCall:{name:Op.$type,properties:{cardinality:{name:Op.cardinality},lookahead:{name:Op.lookahead},parenthesized:{name:Op.parenthesized,defaultValue:!1},rule:{name:Op.rule,referenceType:Wu.$type}},superTypes:[so.$type]},Type:{name:eC.$type,properties:{name:{name:eC.name},type:{name:eC.type}},superTypes:[_o.$type]},TypeAttribute:{name:$p.$type,properties:{defaultValue:{name:$p.defaultValue},isOptional:{name:$p.isOptional,defaultValue:!1},name:{name:$p.name},type:{name:$p.type}},superTypes:[]},TypeDefinition:{name:Pp.$type,properties:{},superTypes:[]},UnionType:{name:H_.$type,properties:{types:{name:H_.types,defaultValue:[]}},superTypes:[Pp.$type]},UnorderedGroup:{name:tC.$type,properties:{cardinality:{name:tC.cardinality},elements:{name:tC.elements,defaultValue:[]}},superTypes:[ao.$type]},UntilToken:{name:Bp.$type,properties:{cardinality:{name:Bp.cardinality},lookahead:{name:Bp.lookahead},parenthesized:{name:Bp.parenthesized,defaultValue:!1},terminal:{name:Bp.terminal}},superTypes:[so.$type]},ValueLiteral:{name:Fp.$type,properties:{},superTypes:[]},Wildcard:{name:ny.$type,properties:{cardinality:{name:ny.cardinality},lookahead:{name:ny.lookahead},parenthesized:{name:ny.parenthesized,defaultValue:!1}},superTypes:[so.$type]}}}},A(Qy,"LangiumGrammarAstReflection"),Qy),pr=new KW;function Rbe(t){let e=t,r=!1;for(;e;){const n=bg(e.grammarSource,Ys);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}A(Rbe,"getDatatypeNode");function Jb(t){return new jb(t,e=>Ch(e)?e.content:[],{includeRoot:!0})}A(Jb,"streamCst");function Lbe(t){return Jb(t).filter(vg)}A(Lbe,"flattenCst");function ZW(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}A(ZW,"isChildNode");function dk(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}A(dk,"tokenToRange");function ex(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}A(ex,"toDocumentSegment");var $c;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})($c||($c={}));function QW(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return $c.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.line$c.After}A(JW,"inRange");var eH=/^[\w\p{L}]$/u;function Mbe(t,e,r=eH){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return ML(t,e)}}A(Mbe,"findDeclarationNodeAtOffset");function tH(t,e){if(t){const r=iH(t,!0);if(r&&q_(r,e))return r;if(kL(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(q_(a,e))return a}}}}A(tH,"findCommentNode");function q_(t,e){return vg(t)&&e.includes(t.tokenType.name)}A(q_,"isCommentNode");function ML(t,e){if(vg(t))return t;if(Ch(t)){const r=nH(t,e,!1);if(r)return ML(r,e)}}A(ML,"findLeafNodeAtOffset");function rH(t,e){if(vg(t))return t;if(Ch(t)){const r=nH(t,e,!0);if(r)return rH(r,e)}}A(rH,"findLeafNodeBeforeOffset");function nH(t,e,r){let n=0,i=t.content.length-1,a;for(;n<=i;){const s=Math.floor((n+i)/2),o=t.content[s];if(o.offset<=e&&o.end>e)return o;o.end<=e?(a=r?o:void 0,n=s+1):i=s-1}return a}A(nH,"binarySearch");function iH(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}A(iH,"getPreviousNode");function Ibe(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nvH,findNameAssignment:()=>FL,findNodeForKeyword:()=>yH,findNodeForProperty:()=>$L,findNodesForKeyword:()=>Wbe,findNodesForKeywordInternal:()=>BL,findNodesForProperty:()=>mH,getActionAtElement:()=>xH,getActionType:()=>wH,getAllReachableRules:()=>OL,getAllRulesUsedForCrossReferences:()=>Gbe,getCrossReferenceTerminal:()=>pH,getEntryRule:()=>hH,getExplicitRuleType:()=>LS,getHiddenRules:()=>dH,getRuleType:()=>CH,getRuleTypeName:()=>Xbe,getTypeName:()=>q0,isArrayCardinality:()=>qbe,isArrayOperator:()=>Ube,isCommentTerminal:()=>gH,isDataType:()=>Ybe,isDataTypeRule:()=>RS,isOptionalCardinality:()=>Hbe,terminalRegex:()=>MS});var Jy,IL=(Jy=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},A(Jy,"ErrorWithLocation"),Jy);function Of(t,e="Error: Got unexpected value."){throw new Error(e)}A(Of,"assertUnreachable");function sH(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}A(sH,"assertCondition");var oH={};Df(oH,{NEWLINE_REGEXP:()=>Bbe,escapeRegExp:()=>Bx,getTerminalParts:()=>zbe,isMultilineComment:()=>lH,isWhitespace:()=>DL,partialMatches:()=>cH,partialRegExp:()=>uH,whitespaceCharacters:()=>Vbe});function Tr(t){return t.charCodeAt(0)}A(Tr,"cc");function R3(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}A(R3,"insertToSet");function Em(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}A(Em,"addFlag");function fp(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}A(fp,"ASSERT_EXISTS");function $be(){throw Error("Internal Error - Should never get here!")}A($be,"ASSERT_NEVER_REACH_HERE");function A9(t){return t.type==="Character"}A(A9,"isCharacter");var U_=[];for(let t=Tr("0");t<=Tr("9");t++)U_.push(t);var Y_=[Tr("_")].concat(U_);for(let t=Tr("a");t<=Tr("z");t++)Y_.push(t);for(let t=Tr("A");t<=Tr("Z");t++)Y_.push(t);var Mte=[Tr(" "),Tr("\f"),Tr(` -`),Tr("\r"),Tr(" "),Tr("\v"),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr("\u2028"),Tr("\u2029"),Tr(" "),Tr(" "),Tr(" "),Tr("\uFEFF")],h1t=/[0-9a-fA-F]/,a4=/[0-9]/,d1t=/[1-9]/,e1,Pbe=(e1=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Em(n,"global");break;case"i":Em(n,"ignoreCase");break;case"m":Em(n,"multiLine");break;case"u":Em(n,"unicode");break;case"y":Em(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}fp(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return $be()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;fp(r);break}if(!(e===!0&&r===void 0)&&fp(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),fp(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Tr(` -`),Tr("\r"),Tr("\u2028"),Tr("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=U_;break;case"D":e=U_,r=!0;break;case"s":e=Mte;break;case"S":e=Mte,r=!0;break;case"w":e=Y_;break;case"W":e=Y_,r=!0;break}if(fp(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Tr("\f");break;case"n":e=Tr(` +`)),Ue){const kt=Se.error?` Request failed: ${Se.error.message} (${Se.error.code}).`:"";Ie.log(`Received response '${Ue.method} - (${Se.id})' in ${Date.now()-Ue.timerStart}ms.${kt}`,tt)}else Ie.log(`Received response ${Se.id} without active response promise.`,tt)}else rt("receive-response",Se)}A(ht,"traceReceivedResponse");function rt(Se,Ue){if(!Ie||ee===f.Off)return;const tt={isLSPMessage:!0,type:Se,message:Ue,timestamp:Date.now()};Ie.log(tt)}A(rt,"logLSPMessage");function Et(){if(he())throw new T(v.Closed,"Connection is closed.");if(W())throw new T(v.Disposed,"Connection is disposed.")}A(Et,"throwIfClosedOrDisposed");function vt(){if(ae())throw new T(v.AlreadyListening,"Connection is already listening")}A(vt,"throwIfListening");function ot(){if(!ae())throw new Error("Call listen() first.")}A(ot,"throwIfNotListening");function pe(Se){return Se===void 0?null:Se}A(pe,"undefinedToNull");function Ct(Se){if(Se!==null)return Se}A(Ct,"nullToUndefined");function lt(Se){return Se!=null&&!Array.isArray(Se)&&typeof Se=="object"}A(lt,"isNamedParam");function st(Se,Ue){switch(Se){case n.ParameterStructures.auto:return lt(Ue)?Ct(Ue):[pe(Ue)];case n.ParameterStructures.byName:if(!lt(Ue))throw new Error("Received parameters by name but param is not an object literal.");return Ct(Ue);case n.ParameterStructures.byPosition:return[pe(Ue)];default:throw new Error(`Unknown parameter structure ${Se.toString()}`)}}A(st,"computeSingleParam");function mt(Se,Ue){let tt;const kt=Se.numberOfParams;switch(kt){case 0:tt=void 0;break;case 1:tt=st(Se.parameterStructures,Ue[0]);break;default:tt=[];for(let Nt=0;Nt{Et();let tt,kt;if(r.string(Se)){tt=Se;const sr=Ue[0];let Qt=0,vr=n.ParameterStructures.auto;n.ParameterStructures.is(sr)&&(Qt=1,vr=sr);let nr=Ue.length;const Rr=nr-Qt;switch(Rr){case 0:kt=void 0;break;case 1:kt=st(vr,Ue[Qt]);break;default:if(vr===n.ParameterStructures.byName)throw new Error(`Received ${Rr} parameters for 'by Name' notification parameter structure.`);kt=Ue.slice(Qt,nr).map(Zt=>pe(Zt));break}}else{const sr=Ue;tt=Se.method,kt=mt(Se,sr)}const Nt={jsonrpc:G,method:tt,params:kt};return Ae(Nt),$.write(Nt).catch(sr=>{throw F.error("Sending notification failed."),sr})},"sendNotification"),onNotification:A((Se,Ue)=>{Et();let tt;return r.func(Se)?Z=Se:Ue&&(r.string(Se)?(tt=Se,Y.set(Se,{type:void 0,handler:Ue})):(tt=Se.method,Y.set(Se.method,{type:Se,handler:Ue}))),{dispose:A(()=>{tt!==void 0?Y.delete(tt):Z=void 0},"dispose")}},"onNotification"),onProgress:A((Se,Ue,tt)=>{if(ie.has(Ue))throw new Error(`Progress handler for token ${Ue} already registered`);return ie.set(Ue,tt),{dispose:A(()=>{ie.delete(Ue)},"dispose")}},"onProgress"),sendProgress:A((Se,Ue,tt)=>_r.sendNotification(u.type,{token:Ue,value:tt}),"sendProgress"),onUnhandledProgress:fe.event,sendRequest:A((Se,...Ue)=>{Et(),ot();let tt,kt,Nt;if(r.string(Se)){tt=Se;const nr=Ue[0],Rr=Ue[Ue.length-1];let Zt=0,gr=n.ParameterStructures.auto;n.ParameterStructures.is(nr)&&(Zt=1,gr=nr);let Dr=Ue.length;s.CancellationToken.is(Rr)&&(Dr=Dr-1,Nt=Rr);const Qe=Dr-Zt;switch(Qe){case 0:kt=void 0;break;case 1:kt=st(gr,Ue[Zt]);break;default:if(gr===n.ParameterStructures.byName)throw new Error(`Received ${Qe} parameters for 'by Name' request parameter structure.`);kt=Ue.slice(Zt,Dr).map(ct=>pe(ct));break}}else{const nr=Ue;tt=Se.method,kt=mt(Se,nr);const Rr=Se.numberOfParams;Nt=s.CancellationToken.is(nr[Rr])?nr[Rr]:void 0}const sr=z++;let Qt;Nt&&(Qt=Nt.onCancellationRequested(()=>{const nr=ve.sender.sendCancellation(_r,sr);return nr===void 0?(F.log(`Received no promise from cancellation strategy when cancelling id ${sr}`),Promise.resolve()):nr.catch(()=>{F.log(`Sending cancellation messages for id ${sr} failed`)})}));const vr={jsonrpc:G,id:sr,method:tt,params:kt};return Ke(vr),typeof ve.sender.enableCancellation=="function"&&ve.sender.enableCancellation(vr),new Promise(async(nr,Rr)=>{const Zt=A(Qe=>{nr(Qe),ve.sender.cleanup(sr),Qt==null||Qt.dispose()},"resolveWithCleanup"),gr=A(Qe=>{Rr(Qe),ve.sender.cleanup(sr),Qt==null||Qt.dispose()},"rejectWithCleanup"),Dr={method:tt,timerStart:Date.now(),resolve:Zt,reject:gr};try{await $.write(vr),te.set(sr,Dr)}catch(Qe){throw F.error("Sending request failed."),Dr.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,Qe.message?Qe.message:"Unknown reason")),Qe}})},"sendRequest"),onRequest:A((Se,Ue)=>{Et();let tt=null;return d.is(Se)?(tt=void 0,H=Se):r.string(Se)?(tt=null,Ue!==void 0&&(tt=Se,q.set(Se,{handler:Ue,type:void 0}))):Ue!==void 0&&(tt=Se.method,q.set(Se.method,{type:Se,handler:Ue})),{dispose:A(()=>{tt!==null&&(tt!==void 0?q.delete(tt):H=void 0)},"dispose")}},"onRequest"),hasPendingResponse:A(()=>te.size>0,"hasPendingResponse"),trace:A(async(Se,Ue,tt)=>{let kt=!1,Nt=g.Text;tt!==void 0&&(r.boolean(tt)?kt=tt:(kt=tt.sendNotification||!1,Nt=tt.traceFormat||g.Text)),ee=Se,Re=Nt,ee===f.Off?Ie=void 0:Ie=Ue,kt&&!he()&&!W()&&await _r.sendNotification(m.type,{value:f.toString(Se)})},"trace"),onError:ce.event,onClose:oe.event,onUnhandledNotification:be.event,onDispose:Pe.event,end:A(()=>{$.end()},"end"),dispose:A(()=>{if(W())return;Be=L.Disposed,Pe.fire(void 0);const Se=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const Ue of te.values())Ue.reject(Se);te=new Map,ge=new Map,J=new Set,Q=new i.LinkedMap,r.func($.dispose)&&$.dispose(),r.func(I.dispose)&&I.dispose()},"dispose"),listen:A(()=>{Et(),vt(),Be=L.Listening,I.listen(Ge)},"listen"),inspect:A(()=>{(0,e.default)().console.log("inspect")},"inspect")};return _r.onNotification(y.type,Se=>{if(ee===f.Off||!Ie)return;const Ue=ee===f.Verbose||ee===f.Compact;Ie.log(Se.message,Ue?Se.verbose:void 0)}),_r.onNotification(u.type,Se=>{const Ue=ie.get(Se.token);Ue?Ue(Se.value):fe.fire(Se)}),_r}A(P,"createMessageConnection"),t.createMessageConnection=P}}),S9=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;var e=obe();Object.defineProperty(t,"Message",{enumerable:!0,get:A(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:A(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:A(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:A(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:A(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:A(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:A(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:A(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:A(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:A(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:A(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:A(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:A(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:A(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:A(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:A(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:A(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:A(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:A(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:A(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:A(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:A(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:A(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:A(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:A(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:A(function(){return e.ParameterStructures},"get")});var r=lbe();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:A(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:A(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:A(function(){return r.Touch},"get")});var n=Oyt();Object.defineProperty(t,"Disposable",{enumerable:!0,get:A(function(){return n.Disposable},"get")});var i=$x();Object.defineProperty(t,"Event",{enumerable:!0,get:A(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:A(function(){return i.Emitter},"get")});var a=CL();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:A(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:A(function(){return a.CancellationToken},"get")});var s=$yt();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:A(function(){return s.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:A(function(){return s.SharedArrayReceiverStrategy},"get")});var o=Pyt();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:A(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:A(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:A(function(){return o.ReadableStreamMessageReader},"get")});var l=Byt();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:A(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:A(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:A(function(){return l.WriteableStreamMessageWriter},"get")});var u=Fyt();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:A(function(){return u.AbstractMessageBuffer},"get")});var h=zyt();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:A(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:A(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:A(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:A(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:A(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:A(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:A(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:A(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:A(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:A(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:A(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:A(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:A(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:A(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:A(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:A(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:A(function(){return h.MessageStrategy},"get")});var d=yg();t.RAL=d.default}}),Vyt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,h;Object.defineProperty(t,"__esModule",{value:!0});var e=S9(),r=(l=class extends e.AbstractMessageBuffer{constructor(f="utf-8"){super(f),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return l.emptyBuffer}fromString(f,p){return new TextEncoder().encode(f)}toString(f,p){return p==="ascii"?this.asciiDecoder.decode(f):new TextDecoder(p).decode(f)}asNative(f,p){return p===void 0?f:f.slice(0,p)}allocNative(f){return new Uint8Array(f)}},A(l,"MessageBuffer"),l);r.emptyBuffer=new Uint8Array(0);var n=(u=class{constructor(f){this.socket=f,this._onData=new e.Emitter,this._messageListener=p=>{p.data.arrayBuffer().then(m=>{this._onData.fire(new Uint8Array(m))},()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}onData(f){return this._onData.event(f)}},A(u,"ReadableStreamWrapper"),u),i=(h=class{constructor(f){this.socket=f}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}write(f,p){if(typeof f=="string"){if(p!==void 0&&p!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${p}`);this.socket.send(f)}else this.socket.send(f);return Promise.resolve()}end(){this.socket.close()}},A(h,"WritableStreamWrapper"),h),a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:A(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:A((d,f)=>{if(f.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${f.charset}`);return Promise.resolve(a.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:A((d,f)=>{if(!(d instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(d)))},"decode")})}),stream:Object.freeze({asReadableStream:A(d=>new n(d),"asReadableStream"),asWritableStream:A(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:A(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:A(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:A(()=>clearInterval(g),"dispose")}}})});function o(){return s}A(o,"RIL"),(function(d){function f(){e.RAL.install(s)}A(f,"install"),d.install=f})(o||(o={})),t.default=o}}),Px=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(t){var l,u;var e=t&&t.__createBinding||(Object.create?(function(h,d,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:A(function(){return d[f]},"get")}),Object.defineProperty(h,p,g)}):(function(h,d,f,p){p===void 0&&(p=f),h[p]=d[f]})),r=t&&t.__exportStar||function(h,d){for(var f in h)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&e(d,h,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=Vyt();n.default.install();var i=S9();r(S9(),t);var a=(l=class extends i.AbstractMessageReader{constructor(d){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},d.addEventListener("error",f=>this.fireError(f)),d.onmessage=this._messageListener}listen(d){return this._onData.event(d)}},A(l,"BrowserMessageReader"),l);t.BrowserMessageReader=a;var s=(u=class extends i.AbstractMessageWriter{constructor(d){super(),this.port=d,this.errorCount=0,d.addEventListener("error",f=>this.fireError(f))}write(d){try{return this.port.postMessage(d),Promise.resolve()}catch(f){return this.handleError(f,d),Promise.reject(f)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){}},A(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=s;function o(h,d,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(h,d,f,p)}A(o,"createMessageConnection"),t.createMessageConnection=o}}),Mte=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=Px()}}),mi=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,h,d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=Px(),r;(function(p){p.clientToServer="clientToServer",p.serverToClient="serverToClient",p.both="both"})(r||(t.MessageDirection=r={}));var n=(l=class{constructor(g){this.method=g}},A(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},A(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var a=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},A(h,"ProtocolRequestType"),h);t.ProtocolRequestType=a;var s=(d=class extends e.NotificationType0{constructor(g){super(g)}},A(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=s;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},A(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),SW=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(h){return h===!0||h===!1}A(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}A(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}A(n,"number"),t.number=n;function i(h){return h instanceof Error}A(i,"error"),t.error=i;function a(h){return typeof h=="function"}A(a,"func"),t.func=a;function s(h){return Array.isArray(h)}A(s,"array"),t.array=s;function o(h){return s(h)&&h.every(d=>r(d))}A(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}A(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}A(u,"objectLiteral"),t.objectLiteral=u}}),Gyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),Wyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),Hyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;var e=mi(),r;(function(i){i.method="workspace/workspaceFolders",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(r||(t.WorkspaceFoldersRequest=r={}));var n;(function(i){i.method="workspace/didChangeWorkspaceFolders",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolNotificationType(i.method)})(n||(t.DidChangeWorkspaceFoldersNotification=n={}))}}),qyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;var e=mi(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),Uyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;var e=mi(),r;(function(i){i.method="textDocument/documentColor",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.DocumentColorRequest=r={}));var n;(function(i){i.method="textDocument/colorPresentation",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.ColorPresentationRequest=n={}))}}),Yyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;var e=mi(),r;(function(i){i.method="textDocument/foldingRange",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.FoldingRangeRequest=r={}));var n;(function(i){i.method="workspace/foldingRange/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.FoldingRangeRefreshRequest=n={}))}}),Xyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),jyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),Kyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;var e=Px(),r=mi(),n;(function(s){s.type=new e.ProgressType;function o(l){return l===s.type}A(o,"is"),s.is=o})(n||(t.WorkDoneProgress=n={}));var i;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=r.MessageDirection.serverToClient,s.type=new r.ProtocolRequestType(s.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var a;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolNotificationType(s.method)})(a||(t.WorkDoneProgressCancelNotification=a={}))}}),Zyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;var e=mi(),r;(function(a){a.method="textDocument/prepareCallHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(a){a.method="callHierarchy/incomingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var i;(function(a){a.method="callHierarchy/outgoingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.CallHierarchyOutgoingCallsRequest=i={}))}}),Qyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;var e=mi(),r;(function(l){l.Relative="relative"})(r||(t.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new e.RegistrationType(l.method)})(n||(t.SemanticTokensRegistrationType=n={}));var i;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(t.SemanticTokensRequest=i={}));var a;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensDeltaRequest=a={}));var s;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(s||(t.SemanticTokensRangeRequest=s={}));var o;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(o||(t.SemanticTokensRefreshRequest=o={}))}}),Jyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;var e=mi(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),e1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),t1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;var e=mi(),r;(function(u){u.file="file",u.folder="folder"})(r||(t.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(n||(t.WillCreateFilesRequest=n={}));var i;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(i||(t.DidCreateFilesNotification=i={}));var a;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(a||(t.WillRenameFilesRequest=a={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(s||(t.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidDeleteFilesNotification=o={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),r1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;var e=mi(),r;(function(a){a.document="document",a.project="project",a.group="group",a.scheme="scheme",a.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(a){a.$import="import",a.$export="export",a.local="local"})(n||(t.MonikerKind=n={}));var i;(function(a){a.method="textDocument/moniker",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.MonikerRequest=i={}))}}),n1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=mi(),r;(function(a){a.method="textDocument/prepareTypeHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(a){a.method="typeHierarchy/supertypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var i;(function(a){a.method="typeHierarchy/subtypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.TypeHierarchySubtypesRequest=i={}))}}),i1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;var e=mi(),r;(function(i){i.method="textDocument/inlineValue",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.InlineValueRequest=r={}));var n;(function(i){i.method="workspace/inlineValue/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.InlineValueRefreshRequest=n={}))}}),a1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;var e=mi(),r;(function(a){a.method="textDocument/inlayHint",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.InlayHintRequest=r={}));var n;(function(a){a.method="inlayHint/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.InlayHintResolveRequest=n={}));var i;(function(a){a.method="workspace/inlayHint/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(i||(t.InlayHintRefreshRequest=i={}))}}),s1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;var e=Px(),r=SW(),n=mi(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}A(h,"is"),u.is=h})(i||(t.DiagnosticServerCancellationData=i={}));var a;(function(u){u.Full="full",u.Unchanged="unchanged"})(a||(t.DocumentDiagnosticReportKind=a={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(s||(t.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.WorkspaceDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(l||(t.DiagnosticRefreshRequest=l={}))}}),o1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;var e=(SS(),kW(wL)),r=SW(),n=mi(),i;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}A(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var a;(function(g){function m(T,b){const w={executionOrder:T};return(b===!0||b===!1)&&(w.success=b),w}A(m,"create"),g.create=m;function y(T){const b=T;return r.objectLiteral(b)&&e.uinteger.is(b.executionOrder)&&(b.success===void 0||r.boolean(b.success))}A(y,"is"),g.is=y;function v(T,b){return T===b?!0:T==null||b===null||b===void 0?!1:T.executionOrder===b.executionOrder&&T.success===b.success}A(v,"equals"),g.equals=v})(a||(t.ExecutionSummary=a={}));var s;(function(g){function m(b,w){return{kind:b,document:w}}A(m,"create"),g.create=m;function y(b){const w=b;return r.objectLiteral(w)&&i.is(w.kind)&&e.DocumentUri.is(w.document)&&(w.metadata===void 0||r.objectLiteral(w.metadata))}A(y,"is"),g.is=y;function v(b,w){const C=new Set;return b.document!==w.document&&C.add("document"),b.kind!==w.kind&&C.add("kind"),b.executionSummary!==w.executionSummary&&C.add("executionSummary"),(b.metadata!==void 0||w.metadata!==void 0)&&!T(b.metadata,w.metadata)&&C.add("metadata"),(b.executionSummary!==void 0||w.executionSummary!==void 0)&&!a.equals(b.executionSummary,w.executionSummary)&&C.add("executionSummary"),C}A(v,"diff"),g.diff=v;function T(b,w){if(b===w)return!0;if(b==null||w===null||w===void 0||typeof b!=typeof w||typeof b!="object")return!1;const C=Array.isArray(b),S=Array.isArray(w);if(C!==S)return!1;if(C&&S){if(b.length!==w.length)return!1;for(let k=0;k0}A(Ct,"hasId"),pe.hasId=Ct})(N||(t.StaticRegistrationOptions=N={}));var F;(function(pe){function Ct(lt){const st=lt;return st&&(st.documentSelector===null||P.is(st.documentSelector))}A(Ct,"is"),pe.is=Ct})(F||(t.TextDocumentRegistrationOptions=F={}));var z;(function(pe){function Ct(st){const mt=st;return n.objectLiteral(mt)&&(mt.workDoneProgress===void 0||n.boolean(mt.workDoneProgress))}A(Ct,"is"),pe.is=Ct;function lt(st){const mt=st;return mt&&n.boolean(mt.workDoneProgress)}A(lt,"hasWorkDoneProgress"),pe.hasWorkDoneProgress=lt})(z||(t.WorkDoneProgressOptions=z={}));var V;(function(pe){pe.method="initialize",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(V||(t.InitializeRequest=V={}));var B;(function(pe){pe.unknownProtocolVersion=1})(B||(t.InitializeErrorCodes=B={}));var G;(function(pe){pe.method="initialized",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(G||(t.InitializedNotification=G={}));var H;(function(pe){pe.method="shutdown",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType0(pe.method)})(H||(t.ShutdownRequest=H={}));var q;(function(pe){pe.method="exit",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType0(pe.method)})(q||(t.ExitNotification=q={}));var Z;(function(pe){pe.method="workspace/didChangeConfiguration",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(Z||(t.DidChangeConfigurationNotification=Z={}));var Y;(function(pe){pe.Error=1,pe.Warning=2,pe.Info=3,pe.Log=4,pe.Debug=5})(Y||(t.MessageType=Y={}));var ie;(function(pe){pe.method="window/showMessage",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolNotificationType(pe.method)})(ie||(t.ShowMessageNotification=ie={}));var K;(function(pe){pe.method="window/showMessageRequest",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolRequestType(pe.method)})(K||(t.ShowMessageRequest=K={}));var Q;(function(pe){pe.method="window/logMessage",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolNotificationType(pe.method)})(Q||(t.LogMessageNotification=Q={}));var te;(function(pe){pe.method="telemetry/event",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolNotificationType(pe.method)})(te||(t.TelemetryEventNotification=te={}));var J;(function(pe){pe.None=0,pe.Full=1,pe.Incremental=2})(J||(t.TextDocumentSyncKind=J={}));var ge;(function(pe){pe.method="textDocument/didOpen",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(ge||(t.DidOpenTextDocumentNotification=ge={}));var ee;(function(pe){function Ct(st){let mt=st;return mt!=null&&typeof mt.text=="string"&&mt.range!==void 0&&(mt.rangeLength===void 0||typeof mt.rangeLength=="number")}A(Ct,"isIncremental"),pe.isIncremental=Ct;function lt(st){let mt=st;return mt!=null&&typeof mt.text=="string"&&mt.range===void 0&&mt.rangeLength===void 0}A(lt,"isFull"),pe.isFull=lt})(ee||(t.TextDocumentContentChangeEvent=ee={}));var Re;(function(pe){pe.method="textDocument/didChange",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(Re||(t.DidChangeTextDocumentNotification=Re={}));var Ie;(function(pe){pe.method="textDocument/didClose",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(Ie||(t.DidCloseTextDocumentNotification=Ie={}));var Be;(function(pe){pe.method="textDocument/didSave",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(Be||(t.DidSaveTextDocumentNotification=Be={}));var ce;(function(pe){pe.Manual=1,pe.AfterDelay=2,pe.FocusOut=3})(ce||(t.TextDocumentSaveReason=ce={}));var oe;(function(pe){pe.method="textDocument/willSave",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(oe||(t.WillSaveTextDocumentNotification=oe={}));var be;(function(pe){pe.method="textDocument/willSaveWaitUntil",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(be||(t.WillSaveTextDocumentWaitUntilRequest=be={}));var fe;(function(pe){pe.method="workspace/didChangeWatchedFiles",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(fe||(t.DidChangeWatchedFilesNotification=fe={}));var Pe;(function(pe){pe.Created=1,pe.Changed=2,pe.Deleted=3})(Pe||(t.FileChangeType=Pe={}));var ve;(function(pe){function Ct(lt){const st=lt;return n.objectLiteral(st)&&(r.URI.is(st.baseUri)||r.WorkspaceFolder.is(st.baseUri))&&n.string(st.pattern)}A(Ct,"is"),pe.is=Ct})(ve||(t.RelativePattern=ve={}));var Ce;(function(pe){pe.Create=1,pe.Change=2,pe.Delete=4})(Ce||(t.WatchKind=Ce={}));var Ve;(function(pe){pe.method="textDocument/publishDiagnostics",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolNotificationType(pe.method)})(Ve||(t.PublishDiagnosticsNotification=Ve={}));var se;(function(pe){pe.Invoked=1,pe.TriggerCharacter=2,pe.TriggerForIncompleteCompletions=3})(se||(t.CompletionTriggerKind=se={}));var de;(function(pe){pe.method="textDocument/completion",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(de||(t.CompletionRequest=de={}));var Te;(function(pe){pe.method="completionItem/resolve",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Te||(t.CompletionResolveRequest=Te={}));var ae;(function(pe){pe.method="textDocument/hover",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(ae||(t.HoverRequest=ae={}));var he;(function(pe){pe.Invoked=1,pe.TriggerCharacter=2,pe.ContentChange=3})(he||(t.SignatureHelpTriggerKind=he={}));var W;(function(pe){pe.method="textDocument/signatureHelp",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(W||(t.SignatureHelpRequest=W={}));var ne;(function(pe){pe.method="textDocument/definition",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(ne||(t.DefinitionRequest=ne={}));var j;(function(pe){pe.method="textDocument/references",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(j||(t.ReferencesRequest=j={}));var ue;(function(pe){pe.method="textDocument/documentHighlight",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(ue||(t.DocumentHighlightRequest=ue={}));var X;(function(pe){pe.method="textDocument/documentSymbol",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(X||(t.DocumentSymbolRequest=X={}));var Oe;(function(pe){pe.method="textDocument/codeAction",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Oe||(t.CodeActionRequest=Oe={}));var xe;(function(pe){pe.method="codeAction/resolve",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(xe||(t.CodeActionResolveRequest=xe={}));var Ge;(function(pe){pe.method="workspace/symbol",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Ge||(t.WorkspaceSymbolRequest=Ge={}));var _e;(function(pe){pe.method="workspaceSymbol/resolve",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(_e||(t.WorkspaceSymbolResolveRequest=_e={}));var $e;(function(pe){pe.method="textDocument/codeLens",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})($e||(t.CodeLensRequest=$e={}));var Me;(function(pe){pe.method="codeLens/resolve",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Me||(t.CodeLensResolveRequest=Me={}));var He;(function(pe){pe.method="workspace/codeLens/refresh",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolRequestType0(pe.method)})(He||(t.CodeLensRefreshRequest=He={}));var De;(function(pe){pe.method="textDocument/documentLink",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(De||(t.DocumentLinkRequest=De={}));var Ke;(function(pe){pe.method="documentLink/resolve",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Ke||(t.DocumentLinkResolveRequest=Ke={}));var Ae;(function(pe){pe.method="textDocument/formatting",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Ae||(t.DocumentFormattingRequest=Ae={}));var at;(function(pe){pe.method="textDocument/rangeFormatting",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(at||(t.DocumentRangeFormattingRequest=at={}));var Ee;(function(pe){pe.method="textDocument/rangesFormatting",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Ee||(t.DocumentRangesFormattingRequest=Ee={}));var pt;(function(pe){pe.method="textDocument/onTypeFormatting",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(pt||(t.DocumentOnTypeFormattingRequest=pt={}));var ht;(function(pe){pe.Identifier=1})(ht||(t.PrepareSupportDefaultBehavior=ht={}));var rt;(function(pe){pe.method="textDocument/rename",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(rt||(t.RenameRequest=rt={}));var Et;(function(pe){pe.method="textDocument/prepareRename",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Et||(t.PrepareRenameRequest=Et={}));var vt;(function(pe){pe.method="workspace/executeCommand",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(vt||(t.ExecuteCommandRequest=vt={}));var ot;(function(pe){pe.method="workspace/applyEdit",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolRequestType("workspace/applyEdit")})(ot||(t.ApplyWorkspaceEditRequest=ot={}))}}),u1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var e=Px();function r(n,i,a,s){return e.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,e.createMessageConnection)(n,i,a,s)}A(r,"createProtocolConnection"),t.createProtocolConnection=r}}),h1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:A(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(Px(),t),r((SS(),kW(wL)),t),r(mi(),t),r(c1t(),t);var n=u1t();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:A(function(){return n.createProtocolConnection},"get")});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}}),d1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:A(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=Mte();r(Mte(),t),r(h1t(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}A(i,"createProtocolConnection"),t.createProtocolConnection=i}}),ube={};Df(ube,{AbstractAstReflection:()=>_W,AbstractCstNode:()=>Lq,AbstractLangiumParser:()=>Iq,AbstractParserErrorMessageProvider:()=>Z3e,AbstractThreadedAsyncParser:()=>$4t,AstUtils:()=>RW,BiMap:()=>d6,Cancellation:()=>Vn,CompositeCstNodeImpl:()=>b7,ContextCache:()=>E7,CstNodeBuilder:()=>X3e,CstUtils:()=>EW,DEFAULT_TOKENIZE_OPTIONS:()=>Kq,DONE_RESULT:()=>Is,DatatypeSymbol:()=>l6,DefaultAstNodeDescriptionProvider:()=>A5e,DefaultAstNodeLocator:()=>R5e,DefaultAsyncParser:()=>Y5e,DefaultCommentProvider:()=>U5e,DefaultConfigurationProvider:()=>L5e,DefaultDocumentBuilder:()=>M5e,DefaultDocumentValidator:()=>E5e,DefaultHydrator:()=>j5e,DefaultIndexManager:()=>I5e,DefaultJsonSerializer:()=>w5e,DefaultLangiumDocumentFactory:()=>f5e,DefaultLangiumDocuments:()=>p5e,DefaultLangiumProfiler:()=>V4t,DefaultLexer:()=>Zq,DefaultLexerErrorMessageProvider:()=>D5e,DefaultLinker:()=>g5e,DefaultNameProvider:()=>m5e,DefaultReferenceDescriptionProvider:()=>_5e,DefaultReferences:()=>y5e,DefaultScopeComputation:()=>v5e,DefaultScopeProvider:()=>T5e,DefaultServiceRegistry:()=>C5e,DefaultTokenBuilder:()=>w7,DefaultValueConverter:()=>Fq,DefaultWorkspaceLock:()=>X5e,DefaultWorkspaceManager:()=>N5e,Deferred:()=>Mh,Disposable:()=>p0,DisposableCache:()=>S7,DocumentCache:()=>x5e,DocumentState:()=>Gr,DocumentValidator:()=>ul,EMPTY_SCOPE:()=>I4t,EMPTY_STREAM:()=>Xb,EmptyFileSystem:()=>ns,EmptyFileSystemProvider:()=>Q5e,ErrorWithLocation:()=>IL,GrammarAST:()=>fbe,GrammarUtils:()=>aH,IndentationAwareLexer:()=>B4t,IndentationAwareTokenBuilder:()=>Z5e,JSDocDocumentationProvider:()=>q5e,LangiumCompletionParser:()=>Q3e,LangiumParser:()=>K3e,LangiumParserErrorMessageProvider:()=>Nq,LeafCstNodeImpl:()=>o6,LexingMode:()=>n0,MapScope:()=>M4t,Module:()=>aB,MultiMap:()=>Ih,MultiMapScope:()=>b5e,OperationCancelled:()=>Vc,ParserWorker:()=>P4t,ProfilingTask:()=>eAe,Reduction:()=>hk,RefResolving:()=>mp,RegExpUtils:()=>oH,RootCstNodeImpl:()=>Mq,SimpleCache:()=>qq,StreamImpl:()=>zc,StreamScope:()=>tB,TextDocument:()=>u6,TreeStreamImpl:()=>jb,URI:()=>Bo,UriTrie:()=>Wq,UriUtils:()=>Fs,VALIDATE_EACH_NODE:()=>S5e,ValidationCategory:()=>f6,ValidationRegistry:()=>k5e,ValueConverter:()=>Nc,WorkspaceCache:()=>Uq,assertCondition:()=>sH,assertUnreachable:()=>Of,createCompletionParser:()=>$q,createDefaultCoreModule:()=>La,createDefaultSharedCoreModule:()=>Ma,createGrammarConfig:()=>SH,createLangiumParser:()=>Pq,createParser:()=>x7,delayNextTick:()=>C7,diagnosticData:()=>r0,eagerLoad:()=>iU,getDiagnosticRange:()=>Xq,indentationBuilderDefaultOptions:()=>oB,inject:()=>tn,interruptAndCheck:()=>ba,isAstNode:()=>Hi,isAstNodeDescription:()=>AW,isAstNodeWithComment:()=>Yq,isCompositeCstNode:()=>Ch,isIMultiModeLexerDefinition:()=>R7,isJSDoc:()=>Jq,isLeafCstNode:()=>vg,isLinkingError:()=>_p,isMultiReference:()=>Yc,isNamed:()=>Hq,isOperationCancelled:()=>Pg,isReference:()=>Bs,isRootCstNode:()=>kL,isTokenTypeArray:()=>_7,isTokenTypeDictionary:()=>p6,loadGrammarFromJson:()=>Ia,parseJSDoc:()=>Qq,prepareLangiumParser:()=>Bq,setInterruptionPeriod:()=>zq,startCancelableOperation:()=>k7,stream:()=>Sn,toDiagnosticData:()=>jq,toDiagnosticSeverity:()=>lC});var EW={};Df(EW,{DefaultNameRegexp:()=>eH,RangeComparison:()=>$c,compareRange:()=>QW,findCommentNode:()=>tH,findDeclarationNodeAtOffset:()=>Ibe,findLeafNodeAtOffset:()=>ML,findLeafNodeBeforeOffset:()=>rH,flattenCst:()=>Mbe,getDatatypeNode:()=>Lbe,getInteriorNodes:()=>Obe,getNextNode:()=>Nbe,getPreviousNode:()=>iH,getStartlineNode:()=>Dbe,inRange:()=>JW,isChildNode:()=>ZW,isCommentNode:()=>q_,streamCst:()=>Jb,toDocumentSegment:()=>ex,tokenToRange:()=>dk});function Hi(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}A(Hi,"isAstNode");function Bs(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}A(Bs,"isReference");function Yc(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}A(Yc,"isMultiReference");function AW(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}A(AW,"isAstNodeDescription");function _p(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}A(_p,"isLinkingError");var Ky,_W=(Ky=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Hi(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}},A(Ky,"AbstractAstReflection"),Ky);function Ch(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}A(Ch,"isCompositeCstNode");function vg(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}A(vg,"isLeafCstNode");function kL(t){return Ch(t)&&typeof t.fullText=="string"}A(kL,"isRootCstNode");var lo,zc=(lo=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:A(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new lo(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return Is})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=hbe(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new lo(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?Is:{done:!1,value:e(i)}})}filter(e){return new lo(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Is})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new lo(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(uk(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return Is})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new lo(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(uk(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return Is})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new lo(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Is:this.nextFn(r.state)))}distinct(e){return new lo(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return Is})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}},A(lo,"StreamImpl"),lo);function hbe(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}A(hbe,"toString");function uk(t){return!!t&&typeof t[Symbol.iterator]=="function"}A(uk,"isIterable");var Xb=new zc(()=>{},()=>Is),Is=Object.freeze({done:!0,value:void 0});function Sn(...t){if(t.length===1){const e=t[0];if(e instanceof zc)return e;if(uk(e))return new zc(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new zc(()=>({index:0}),r=>r.index1?new zc(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return Is})}iterator(){const e={state:this.startFn(),next:A(()=>this.nextFn(e.state),"next"),prune:A(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},A(Zy,"TreeStreamImpl"),Zy),hk;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}A(e,"sum"),t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}A(r,"product"),t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}A(n,"min"),t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}A(i,"max"),t.max=i})(hk||(hk={}));var RW={};Df(RW,{assignMandatoryProperties:()=>LW,copyAstNode:()=>M_,findRootNode:()=>Cy,getContainerOfType:()=>bg,getDocument:()=>tc,getReferenceNodes:()=>R_,hasContainerOfType:()=>dbe,linkContentToContainer:()=>Kb,streamAllContents:()=>Uh,streamAst:()=>rc,streamContents:()=>AS,streamReferences:()=>Zb});function Kb(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Hi(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&Kb(i,e))}):Hi(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&Kb(n,e)))}A(Kb,"linkContentToContainer");function bg(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}A(bg,"getContainerOfType");function dbe(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}A(dbe,"hasContainerOfType");function tc(t){const r=Cy(t).$document;if(!r)throw new Error("AST node has no document.");return r}A(tc,"getDocument");function Cy(t){for(;t.$container;)t=t.$container;return t}A(Cy,"findRootNode");function R_(t){return Bs(t)?t.ref?[t.ref]:[]:Yc(t)?t.items.map(e=>e.ref):[]}A(R_,"getReferenceNodes");function AS(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new zc(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexAS(r,e))}A(Uh,"streamAllContents");function rc(t,e){if(t){if(e!=null&&e.range&&!L_(t,e.range))return new jb(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new jb(t,r=>AS(r,e),{includeRoot:!0})}A(rc,"streamAst");function L_(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?JW(r,e):!1}A(L_,"isAstNodeInRange");function Zb(t){return new zc(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexao,AbstractParserRule:()=>Xw,AbstractRule:()=>Zm,AbstractType:()=>_o,Action:()=>gd,Alternatives:()=>jw,ArrayLiteral:()=>I_,ArrayType:()=>N_,Assignment:()=>md,BooleanLiteral:()=>D_,CharacterRange:()=>yd,Condition:()=>vd,Conjunction:()=>Kw,CrossReference:()=>bd,Disjunction:()=>Zw,EndOfFile:()=>O_,Grammar:()=>Gu,GrammarImport:()=>$_,Group:()=>Rp,InferredType:()=>P_,InfixRule:()=>_c,InfixRuleOperatorList:()=>Qw,InfixRuleOperators:()=>B_,Interface:()=>Qm,Keyword:()=>Jm,LangiumGrammarAstReflection:()=>KW,LangiumGrammarTerminals:()=>f1t,NamedArgument:()=>ey,NegatedToken:()=>Lp,Negation:()=>F_,NumberLiteral:()=>z_,Parameter:()=>ty,ParameterReference:()=>V_,ParserRule:()=>Il,ReferenceType:()=>Jw,RegexToken:()=>Mp,ReturnType:()=>G_,RuleCall:()=>Ip,SimpleType:()=>ry,StringLiteral:()=>W_,TerminalAlternatives:()=>Np,TerminalElement:()=>so,TerminalGroup:()=>Dp,TerminalRule:()=>Wu,TerminalRuleCall:()=>Op,Type:()=>eC,TypeAttribute:()=>$p,TypeDefinition:()=>Pp,UnionType:()=>H_,UnorderedGroup:()=>tC,UntilToken:()=>Bp,ValueLiteral:()=>Fp,Wildcard:()=>ny,isAbstractElement:()=>SL,isAbstractParserRule:()=>xg,isAbstractRule:()=>pbe,isAbstractType:()=>gbe,isAction:()=>pf,isAlternatives:()=>EL,isArrayLiteral:()=>mbe,isArrayType:()=>IW,isAssignment:()=>kh,isBooleanLiteral:()=>NW,isCharacterRange:()=>DW,isCondition:()=>ybe,isConjunction:()=>OW,isCrossReference:()=>Tg,isDisjunction:()=>$W,isEndOfFile:()=>PW,isGrammar:()=>vbe,isGrammarImport:()=>bbe,isGroup:()=>wg,isInferredType:()=>_S,isInfixRule:()=>Qb,isInfixRuleOperatorList:()=>xbe,isInfixRuleOperators:()=>Tbe,isInterface:()=>BW,isKeyword:()=>Sh,isNamedArgument:()=>wbe,isNegatedToken:()=>FW,isNegation:()=>zW,isNumberLiteral:()=>Cbe,isParameter:()=>kbe,isParameterReference:()=>VW,isParserRule:()=>Ys,isReferenceType:()=>GW,isRegexToken:()=>WW,isReturnType:()=>HW,isRuleCall:()=>Eh,isSimpleType:()=>AL,isStringLiteral:()=>Sbe,isTerminalAlternatives:()=>qW,isTerminalElement:()=>Ebe,isTerminalGroup:()=>UW,isTerminalRule:()=>Sl,isTerminalRuleCall:()=>_L,isType:()=>RL,isTypeAttribute:()=>Abe,isTypeDefinition:()=>_be,isUnionType:()=>YW,isUnorderedGroup:()=>LL,isUntilToken:()=>XW,isValueLiteral:()=>Rbe,isWildcard:()=>jW,reflection:()=>pr});var f1t={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},ao={$type:"AbstractElement",cardinality:"cardinality"};function SL(t){return pr.isInstance(t,ao.$type)}A(SL,"isAbstractElement");var Xw={$type:"AbstractParserRule"};function xg(t){return pr.isInstance(t,Xw.$type)}A(xg,"isAbstractParserRule");var Zm={$type:"AbstractRule"};function pbe(t){return pr.isInstance(t,Zm.$type)}A(pbe,"isAbstractRule");var _o={$type:"AbstractType"};function gbe(t){return pr.isInstance(t,_o.$type)}A(gbe,"isAbstractType");var gd={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function pf(t){return pr.isInstance(t,gd.$type)}A(pf,"isAction");var jw={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function EL(t){return pr.isInstance(t,jw.$type)}A(EL,"isAlternatives");var I_={$type:"ArrayLiteral",elements:"elements"};function mbe(t){return pr.isInstance(t,I_.$type)}A(mbe,"isArrayLiteral");var N_={$type:"ArrayType",elementType:"elementType"};function IW(t){return pr.isInstance(t,N_.$type)}A(IW,"isArrayType");var md={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function kh(t){return pr.isInstance(t,md.$type)}A(kh,"isAssignment");var D_={$type:"BooleanLiteral",true:"true"};function NW(t){return pr.isInstance(t,D_.$type)}A(NW,"isBooleanLiteral");var yd={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function DW(t){return pr.isInstance(t,yd.$type)}A(DW,"isCharacterRange");var vd={$type:"Condition"};function ybe(t){return pr.isInstance(t,vd.$type)}A(ybe,"isCondition");var Kw={$type:"Conjunction",left:"left",right:"right"};function OW(t){return pr.isInstance(t,Kw.$type)}A(OW,"isConjunction");var bd={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Tg(t){return pr.isInstance(t,bd.$type)}A(Tg,"isCrossReference");var Zw={$type:"Disjunction",left:"left",right:"right"};function $W(t){return pr.isInstance(t,Zw.$type)}A($W,"isDisjunction");var O_={$type:"EndOfFile",cardinality:"cardinality"};function PW(t){return pr.isInstance(t,O_.$type)}A(PW,"isEndOfFile");var Gu={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function vbe(t){return pr.isInstance(t,Gu.$type)}A(vbe,"isGrammar");var $_={$type:"GrammarImport",path:"path"};function bbe(t){return pr.isInstance(t,$_.$type)}A(bbe,"isGrammarImport");var Rp={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function wg(t){return pr.isInstance(t,Rp.$type)}A(wg,"isGroup");var P_={$type:"InferredType",name:"name"};function _S(t){return pr.isInstance(t,P_.$type)}A(_S,"isInferredType");var _c={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Qb(t){return pr.isInstance(t,_c.$type)}A(Qb,"isInfixRule");var Qw={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function xbe(t){return pr.isInstance(t,Qw.$type)}A(xbe,"isInfixRuleOperatorList");var B_={$type:"InfixRuleOperators",precedences:"precedences"};function Tbe(t){return pr.isInstance(t,B_.$type)}A(Tbe,"isInfixRuleOperators");var Qm={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function BW(t){return pr.isInstance(t,Qm.$type)}A(BW,"isInterface");var Jm={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Sh(t){return pr.isInstance(t,Jm.$type)}A(Sh,"isKeyword");var ey={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function wbe(t){return pr.isInstance(t,ey.$type)}A(wbe,"isNamedArgument");var Lp={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function FW(t){return pr.isInstance(t,Lp.$type)}A(FW,"isNegatedToken");var F_={$type:"Negation",value:"value"};function zW(t){return pr.isInstance(t,F_.$type)}A(zW,"isNegation");var z_={$type:"NumberLiteral",value:"value"};function Cbe(t){return pr.isInstance(t,z_.$type)}A(Cbe,"isNumberLiteral");var ty={$type:"Parameter",name:"name"};function kbe(t){return pr.isInstance(t,ty.$type)}A(kbe,"isParameter");var V_={$type:"ParameterReference",parameter:"parameter"};function VW(t){return pr.isInstance(t,V_.$type)}A(VW,"isParameterReference");var Il={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Ys(t){return pr.isInstance(t,Il.$type)}A(Ys,"isParserRule");var Jw={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function GW(t){return pr.isInstance(t,Jw.$type)}A(GW,"isReferenceType");var Mp={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function WW(t){return pr.isInstance(t,Mp.$type)}A(WW,"isRegexToken");var G_={$type:"ReturnType",name:"name"};function HW(t){return pr.isInstance(t,G_.$type)}A(HW,"isReturnType");var Ip={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Eh(t){return pr.isInstance(t,Ip.$type)}A(Eh,"isRuleCall");var ry={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function AL(t){return pr.isInstance(t,ry.$type)}A(AL,"isSimpleType");var W_={$type:"StringLiteral",value:"value"};function Sbe(t){return pr.isInstance(t,W_.$type)}A(Sbe,"isStringLiteral");var Np={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function qW(t){return pr.isInstance(t,Np.$type)}A(qW,"isTerminalAlternatives");var so={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Ebe(t){return pr.isInstance(t,so.$type)}A(Ebe,"isTerminalElement");var Dp={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function UW(t){return pr.isInstance(t,Dp.$type)}A(UW,"isTerminalGroup");var Wu={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Sl(t){return pr.isInstance(t,Wu.$type)}A(Sl,"isTerminalRule");var Op={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function _L(t){return pr.isInstance(t,Op.$type)}A(_L,"isTerminalRuleCall");var eC={$type:"Type",name:"name",type:"type"};function RL(t){return pr.isInstance(t,eC.$type)}A(RL,"isType");var $p={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function Abe(t){return pr.isInstance(t,$p.$type)}A(Abe,"isTypeAttribute");var Pp={$type:"TypeDefinition"};function _be(t){return pr.isInstance(t,Pp.$type)}A(_be,"isTypeDefinition");var H_={$type:"UnionType",types:"types"};function YW(t){return pr.isInstance(t,H_.$type)}A(YW,"isUnionType");var tC={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function LL(t){return pr.isInstance(t,tC.$type)}A(LL,"isUnorderedGroup");var Bp={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function XW(t){return pr.isInstance(t,Bp.$type)}A(XW,"isUntilToken");var Fp={$type:"ValueLiteral"};function Rbe(t){return pr.isInstance(t,Fp.$type)}A(Rbe,"isValueLiteral");var ny={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function jW(t){return pr.isInstance(t,ny.$type)}A(jW,"isWildcard");var Qy,KW=(Qy=class extends _W{constructor(){super(...arguments),this.types={AbstractElement:{name:ao.$type,properties:{cardinality:{name:ao.cardinality}},superTypes:[]},AbstractParserRule:{name:Xw.$type,properties:{},superTypes:[Zm.$type,_o.$type]},AbstractRule:{name:Zm.$type,properties:{},superTypes:[]},AbstractType:{name:_o.$type,properties:{},superTypes:[]},Action:{name:gd.$type,properties:{cardinality:{name:gd.cardinality},feature:{name:gd.feature},inferredType:{name:gd.inferredType},operator:{name:gd.operator},type:{name:gd.type,referenceType:_o.$type}},superTypes:[ao.$type]},Alternatives:{name:jw.$type,properties:{cardinality:{name:jw.cardinality},elements:{name:jw.elements,defaultValue:[]}},superTypes:[ao.$type]},ArrayLiteral:{name:I_.$type,properties:{elements:{name:I_.elements,defaultValue:[]}},superTypes:[Fp.$type]},ArrayType:{name:N_.$type,properties:{elementType:{name:N_.elementType}},superTypes:[Pp.$type]},Assignment:{name:md.$type,properties:{cardinality:{name:md.cardinality},feature:{name:md.feature},operator:{name:md.operator},predicate:{name:md.predicate},terminal:{name:md.terminal}},superTypes:[ao.$type]},BooleanLiteral:{name:D_.$type,properties:{true:{name:D_.true,defaultValue:!1}},superTypes:[vd.$type,Fp.$type]},CharacterRange:{name:yd.$type,properties:{cardinality:{name:yd.cardinality},left:{name:yd.left},lookahead:{name:yd.lookahead},parenthesized:{name:yd.parenthesized,defaultValue:!1},right:{name:yd.right}},superTypes:[so.$type]},Condition:{name:vd.$type,properties:{},superTypes:[]},Conjunction:{name:Kw.$type,properties:{left:{name:Kw.left},right:{name:Kw.right}},superTypes:[vd.$type]},CrossReference:{name:bd.$type,properties:{cardinality:{name:bd.cardinality},deprecatedSyntax:{name:bd.deprecatedSyntax,defaultValue:!1},isMulti:{name:bd.isMulti,defaultValue:!1},terminal:{name:bd.terminal},type:{name:bd.type,referenceType:_o.$type}},superTypes:[ao.$type]},Disjunction:{name:Zw.$type,properties:{left:{name:Zw.left},right:{name:Zw.right}},superTypes:[vd.$type]},EndOfFile:{name:O_.$type,properties:{cardinality:{name:O_.cardinality}},superTypes:[ao.$type]},Grammar:{name:Gu.$type,properties:{imports:{name:Gu.imports,defaultValue:[]},interfaces:{name:Gu.interfaces,defaultValue:[]},isDeclared:{name:Gu.isDeclared,defaultValue:!1},name:{name:Gu.name},rules:{name:Gu.rules,defaultValue:[]},types:{name:Gu.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:$_.$type,properties:{path:{name:$_.path}},superTypes:[]},Group:{name:Rp.$type,properties:{cardinality:{name:Rp.cardinality},elements:{name:Rp.elements,defaultValue:[]},guardCondition:{name:Rp.guardCondition},predicate:{name:Rp.predicate}},superTypes:[ao.$type]},InferredType:{name:P_.$type,properties:{name:{name:P_.name}},superTypes:[_o.$type]},InfixRule:{name:_c.$type,properties:{call:{name:_c.call},dataType:{name:_c.dataType},inferredType:{name:_c.inferredType},name:{name:_c.name},operators:{name:_c.operators},parameters:{name:_c.parameters,defaultValue:[]},returnType:{name:_c.returnType,referenceType:_o.$type}},superTypes:[Xw.$type]},InfixRuleOperatorList:{name:Qw.$type,properties:{associativity:{name:Qw.associativity},operators:{name:Qw.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:B_.$type,properties:{precedences:{name:B_.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Qm.$type,properties:{attributes:{name:Qm.attributes,defaultValue:[]},name:{name:Qm.name},superTypes:{name:Qm.superTypes,defaultValue:[],referenceType:_o.$type}},superTypes:[_o.$type]},Keyword:{name:Jm.$type,properties:{cardinality:{name:Jm.cardinality},predicate:{name:Jm.predicate},value:{name:Jm.value}},superTypes:[ao.$type]},NamedArgument:{name:ey.$type,properties:{calledByName:{name:ey.calledByName,defaultValue:!1},parameter:{name:ey.parameter,referenceType:ty.$type},value:{name:ey.value}},superTypes:[]},NegatedToken:{name:Lp.$type,properties:{cardinality:{name:Lp.cardinality},lookahead:{name:Lp.lookahead},parenthesized:{name:Lp.parenthesized,defaultValue:!1},terminal:{name:Lp.terminal}},superTypes:[so.$type]},Negation:{name:F_.$type,properties:{value:{name:F_.value}},superTypes:[vd.$type]},NumberLiteral:{name:z_.$type,properties:{value:{name:z_.value}},superTypes:[Fp.$type]},Parameter:{name:ty.$type,properties:{name:{name:ty.name}},superTypes:[]},ParameterReference:{name:V_.$type,properties:{parameter:{name:V_.parameter,referenceType:ty.$type}},superTypes:[vd.$type]},ParserRule:{name:Il.$type,properties:{dataType:{name:Il.dataType},definition:{name:Il.definition},entry:{name:Il.entry,defaultValue:!1},fragment:{name:Il.fragment,defaultValue:!1},inferredType:{name:Il.inferredType},name:{name:Il.name},parameters:{name:Il.parameters,defaultValue:[]},returnType:{name:Il.returnType,referenceType:_o.$type}},superTypes:[Xw.$type]},ReferenceType:{name:Jw.$type,properties:{isMulti:{name:Jw.isMulti,defaultValue:!1},referenceType:{name:Jw.referenceType}},superTypes:[Pp.$type]},RegexToken:{name:Mp.$type,properties:{cardinality:{name:Mp.cardinality},lookahead:{name:Mp.lookahead},parenthesized:{name:Mp.parenthesized,defaultValue:!1},regex:{name:Mp.regex}},superTypes:[so.$type]},ReturnType:{name:G_.$type,properties:{name:{name:G_.name}},superTypes:[]},RuleCall:{name:Ip.$type,properties:{arguments:{name:Ip.arguments,defaultValue:[]},cardinality:{name:Ip.cardinality},predicate:{name:Ip.predicate},rule:{name:Ip.rule,referenceType:Zm.$type}},superTypes:[ao.$type]},SimpleType:{name:ry.$type,properties:{primitiveType:{name:ry.primitiveType},stringType:{name:ry.stringType},typeRef:{name:ry.typeRef,referenceType:_o.$type}},superTypes:[Pp.$type]},StringLiteral:{name:W_.$type,properties:{value:{name:W_.value}},superTypes:[Fp.$type]},TerminalAlternatives:{name:Np.$type,properties:{cardinality:{name:Np.cardinality},elements:{name:Np.elements,defaultValue:[]},lookahead:{name:Np.lookahead},parenthesized:{name:Np.parenthesized,defaultValue:!1}},superTypes:[so.$type]},TerminalElement:{name:so.$type,properties:{cardinality:{name:so.cardinality},lookahead:{name:so.lookahead},parenthesized:{name:so.parenthesized,defaultValue:!1}},superTypes:[ao.$type]},TerminalGroup:{name:Dp.$type,properties:{cardinality:{name:Dp.cardinality},elements:{name:Dp.elements,defaultValue:[]},lookahead:{name:Dp.lookahead},parenthesized:{name:Dp.parenthesized,defaultValue:!1}},superTypes:[so.$type]},TerminalRule:{name:Wu.$type,properties:{definition:{name:Wu.definition},fragment:{name:Wu.fragment,defaultValue:!1},hidden:{name:Wu.hidden,defaultValue:!1},name:{name:Wu.name},type:{name:Wu.type}},superTypes:[Zm.$type]},TerminalRuleCall:{name:Op.$type,properties:{cardinality:{name:Op.cardinality},lookahead:{name:Op.lookahead},parenthesized:{name:Op.parenthesized,defaultValue:!1},rule:{name:Op.rule,referenceType:Wu.$type}},superTypes:[so.$type]},Type:{name:eC.$type,properties:{name:{name:eC.name},type:{name:eC.type}},superTypes:[_o.$type]},TypeAttribute:{name:$p.$type,properties:{defaultValue:{name:$p.defaultValue},isOptional:{name:$p.isOptional,defaultValue:!1},name:{name:$p.name},type:{name:$p.type}},superTypes:[]},TypeDefinition:{name:Pp.$type,properties:{},superTypes:[]},UnionType:{name:H_.$type,properties:{types:{name:H_.types,defaultValue:[]}},superTypes:[Pp.$type]},UnorderedGroup:{name:tC.$type,properties:{cardinality:{name:tC.cardinality},elements:{name:tC.elements,defaultValue:[]}},superTypes:[ao.$type]},UntilToken:{name:Bp.$type,properties:{cardinality:{name:Bp.cardinality},lookahead:{name:Bp.lookahead},parenthesized:{name:Bp.parenthesized,defaultValue:!1},terminal:{name:Bp.terminal}},superTypes:[so.$type]},ValueLiteral:{name:Fp.$type,properties:{},superTypes:[]},Wildcard:{name:ny.$type,properties:{cardinality:{name:ny.cardinality},lookahead:{name:ny.lookahead},parenthesized:{name:ny.parenthesized,defaultValue:!1}},superTypes:[so.$type]}}}},A(Qy,"LangiumGrammarAstReflection"),Qy),pr=new KW;function Lbe(t){let e=t,r=!1;for(;e;){const n=bg(e.grammarSource,Ys);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}A(Lbe,"getDatatypeNode");function Jb(t){return new jb(t,e=>Ch(e)?e.content:[],{includeRoot:!0})}A(Jb,"streamCst");function Mbe(t){return Jb(t).filter(vg)}A(Mbe,"flattenCst");function ZW(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}A(ZW,"isChildNode");function dk(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}A(dk,"tokenToRange");function ex(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}A(ex,"toDocumentSegment");var $c;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})($c||($c={}));function QW(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return $c.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.line$c.After}A(JW,"inRange");var eH=/^[\w\p{L}]$/u;function Ibe(t,e,r=eH){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return ML(t,e)}}A(Ibe,"findDeclarationNodeAtOffset");function tH(t,e){if(t){const r=iH(t,!0);if(r&&q_(r,e))return r;if(kL(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(q_(a,e))return a}}}}A(tH,"findCommentNode");function q_(t,e){return vg(t)&&e.includes(t.tokenType.name)}A(q_,"isCommentNode");function ML(t,e){if(vg(t))return t;if(Ch(t)){const r=nH(t,e,!1);if(r)return ML(r,e)}}A(ML,"findLeafNodeAtOffset");function rH(t,e){if(vg(t))return t;if(Ch(t)){const r=nH(t,e,!0);if(r)return rH(r,e)}}A(rH,"findLeafNodeBeforeOffset");function nH(t,e,r){let n=0,i=t.content.length-1,a;for(;n<=i;){const s=Math.floor((n+i)/2),o=t.content[s];if(o.offset<=e&&o.end>e)return o;o.end<=e?(a=r?o:void 0,n=s+1):i=s-1}return a}A(nH,"binarySearch");function iH(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}A(iH,"getPreviousNode");function Nbe(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nvH,findNameAssignment:()=>FL,findNodeForKeyword:()=>yH,findNodeForProperty:()=>$L,findNodesForKeyword:()=>Hbe,findNodesForKeywordInternal:()=>BL,findNodesForProperty:()=>mH,getActionAtElement:()=>xH,getActionType:()=>wH,getAllReachableRules:()=>OL,getAllRulesUsedForCrossReferences:()=>Wbe,getCrossReferenceTerminal:()=>pH,getEntryRule:()=>hH,getExplicitRuleType:()=>LS,getHiddenRules:()=>dH,getRuleType:()=>CH,getRuleTypeName:()=>jbe,getTypeName:()=>q0,isArrayCardinality:()=>Ube,isArrayOperator:()=>Ybe,isCommentTerminal:()=>gH,isDataType:()=>Xbe,isDataTypeRule:()=>RS,isOptionalCardinality:()=>qbe,terminalRegex:()=>MS});var Jy,IL=(Jy=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},A(Jy,"ErrorWithLocation"),Jy);function Of(t,e="Error: Got unexpected value."){throw new Error(e)}A(Of,"assertUnreachable");function sH(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}A(sH,"assertCondition");var oH={};Df(oH,{NEWLINE_REGEXP:()=>Fbe,escapeRegExp:()=>Bx,getTerminalParts:()=>Vbe,isMultilineComment:()=>lH,isWhitespace:()=>DL,partialMatches:()=>cH,partialRegExp:()=>uH,whitespaceCharacters:()=>Gbe});function Tr(t){return t.charCodeAt(0)}A(Tr,"cc");function R3(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}A(R3,"insertToSet");function Em(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}A(Em,"addFlag");function fp(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}A(fp,"ASSERT_EXISTS");function Pbe(){throw Error("Internal Error - Should never get here!")}A(Pbe,"ASSERT_NEVER_REACH_HERE");function A9(t){return t.type==="Character"}A(A9,"isCharacter");var U_=[];for(let t=Tr("0");t<=Tr("9");t++)U_.push(t);var Y_=[Tr("_")].concat(U_);for(let t=Tr("a");t<=Tr("z");t++)Y_.push(t);for(let t=Tr("A");t<=Tr("Z");t++)Y_.push(t);var Ite=[Tr(" "),Tr("\f"),Tr(` +`),Tr("\r"),Tr(" "),Tr("\v"),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr("\u2028"),Tr("\u2029"),Tr(" "),Tr(" "),Tr(" "),Tr("\uFEFF")],p1t=/[0-9a-fA-F]/,a4=/[0-9]/,g1t=/[1-9]/,e1,Bbe=(e1=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Em(n,"global");break;case"i":Em(n,"ignoreCase");break;case"m":Em(n,"multiLine");break;case"u":Em(n,"unicode");break;case"y":Em(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}fp(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return Pbe()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;fp(r);break}if(!(e===!0&&r===void 0)&&fp(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),fp(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Tr(` +`),Tr("\r"),Tr("\u2028"),Tr("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=U_;break;case"D":e=U_,r=!0;break;case"s":e=Ite;break;case"S":e=Ite,r=!0;break;case"w":e=Y_;break;case"W":e=Y_,r=!0;break}if(fp(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Tr("\f");break;case"n":e=Tr(` `);break;case"r":e=Tr("\r");break;case"t":e=Tr(" ");break;case"v":e=Tr("\v");break}if(fp(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:Tr("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:Tr(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:Tr(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,A9(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,A9(i)){if(i.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},A(e1,"RegExpParser"),e1),t1,NL=(t1=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},A(t1,"BaseRegExpVisitor"),t1),Bbe=/\r?\n/gm,Fbe=new Pbe,r1,f1t=(r1=class extends NL{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===` +`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},A(e1,"RegExpParser"),e1),t1,NL=(t1=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},A(t1,"BaseRegExpVisitor"),t1),Fbe=/\r?\n/gm,zbe=new Bbe,r1,m1t=(r1=class extends NL{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===` `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=Bx(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!` -`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},A(r1,"TerminalRegExpVisitor"),r1),e0=new f1t;function zbe(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=Fbe.pattern(t),r=[];for(const n of e.value.value)e0.reset(t),e0.visit(n),r.push({start:e0.startRegexp,end:e0.endRegex});return r}catch{return[]}}A(zbe,"getTerminalParts");function lH(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),e0.reset(t),e0.visit(Fbe.pattern(t)),e0.multiline}catch{return!1}}A(lH,"isMultilineComment");var Vbe=`\f -\r \v              \u2028\u2029   \uFEFF`.split("");function DL(t){const e=typeof t=="string"?new RegExp(t):t;return Vbe.some(r=>e.test(r))}A(DL,"isWhitespace");function Bx(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}A(Bx,"escapeRegExp");function cH(t,e){const r=uH(t),n=e.match(r);return!!n&&n[0].length>0}A(cH,"partialMatches");function uH(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(u){a+=r.substr(n,u),n+=u}A(o,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(A(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return A(i,"process"),new RegExp(i(),t.flags)}A(uH,"partialRegExp");function hH(t){return t.rules.find(e=>Ys(e)&&e.entry)}A(hH,"getEntryRule");function dH(t){return t.rules.filter(e=>Sl(e)&&e.hidden)}A(dH,"getHiddenRules");function OL(t,e){const r=new Set,n=hH(t);if(!n)return new Set(t.rules);const i=[n].concat(dH(t));for(const s of i)fH(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||Sl(s)&&s.hidden)&&a.add(s);return a}A(OL,"getAllReachableRules");function fH(t,e,r){e.add(t.name),Uh(t).forEach(n=>{if(Eh(n)||r&&_L(n)){const i=n.rule.ref;i&&!e.has(i.name)&&fH(i,e,r)}})}A(fH,"ruleDfs");function Gbe(t){const e=new Set;return Uh(t).forEach(r=>{Tg(r)&&(Ys(r.type.ref)&&e.add(r.type.ref),_S(r.type.ref)&&Ys(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}A(Gbe,"getAllRulesUsedForCrossReferences");function pH(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=FL(t.type.ref);return e==null?void 0:e.terminal}}A(pH,"getCrossReferenceTerminal");function gH(t){return t.hidden&&!DL(MS(t))}A(gH,"isCommentTerminal");function mH(t,e){return!t||!e?[]:PL(t,e,t.astNode,!0)}A(mH,"findNodesForProperty");function $L(t,e,r){if(!t||!e)return;const n=PL(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}A($L,"findNodeForProperty");function PL(t,e,r,n){if(!n){const i=bg(t.grammarSource,kh);if(i&&i.feature===e)return[t]}return Ch(t)&&t.astNode===r?t.content.flatMap(i=>PL(i,e,r,!1)):[]}A(PL,"findNodesForPropertyInternal");function Wbe(t,e){return t?BL(t,e,t==null?void 0:t.astNode):[]}A(Wbe,"findNodesForKeyword");function yH(t,e,r){if(!t)return;const n=BL(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}A(yH,"findNodeForKeyword");function BL(t,e,r){if(t.astNode!==r)return[];if(Sh(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=Jb(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?Sh(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}A(BL,"findNodesForKeywordInternal");function vH(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=bg(t.grammarSource,kh);if(n)return n;t=t.container}}A(vH,"findAssignment");function FL(t){let e=t;return _S(e)&&(pf(e.$container)?e=e.$container.$container:xg(e.$container)?e=e.$container:Of(e.$container)),bH(t,e,new Map)}A(FL,"findNameAssignment");function bH(t,e,r){var i;function n(a,s){let o;return bg(a,kh)||(o=bH(s,s,r)),r.set(t,o),o}if(A(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of Uh(e)){if(kh(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Eh(a)&&Ys(a.rule.ref))return n(a,a.rule.ref);if(AL(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}A(bH,"findNameAssignmentInternal");function xH(t){const e=t.$container;if(wg(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(pf(a))return a;{const s=Uh(r[i]).find(pf);if(s)return s}}}if(SL(e))return xH(e)}A(xH,"getActionAtElement");function Hbe(t,e){return t==="?"||t==="*"||wg(e)&&!!e.guardCondition}A(Hbe,"isOptionalCardinality");function qbe(t){return t==="*"||t==="+"}A(qbe,"isArrayCardinality");function Ube(t){return t==="+="}A(Ube,"isArrayOperator");function RS(t){return TH(t,new Set)}A(RS,"isDataTypeRule");function TH(t,e){if(e.has(t))return!0;e.add(t);for(const r of Uh(t))if(Eh(r)){if(!r.rule.ref||Ys(r.rule.ref)&&!TH(r.rule.ref,e)||Qb(r.rule.ref))return!1}else{if(kh(r))return!1;if(pf(r))return!1}return!!t.definition}A(TH,"isDataTypeRuleInternal");function Ybe(t){return X_(t.type,new Set)}A(Ybe,"isDataType");function X_(t,e){if(e.has(t))return!0;if(e.add(t),IW(t))return!1;if(GW(t))return!1;if(YW(t))return t.types.every(r=>X_(r,e));if(AL(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const r=t.typeRef.ref;return RL(r)?X_(r.type,e):!1}else return!1}else return!1}A(X_,"isDataTypeInternal");function LS(t){if(!Sl(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}A(LS,"getExplicitRuleType");function q0(t){if(xg(t))return Ys(t)&&RS(t)?t.name:LS(t)??t.name;if(BW(t)||RL(t)||HW(t))return t.name;if(pf(t)){const e=wH(t);if(e)return e}else if(_S(t))return t.name;throw new Error("Cannot get name of Unknown Type")}A(q0,"getTypeName");function wH(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return q0(t.type.ref)}A(wH,"getActionType");function Xbe(t){var e;return Sl(t)?((e=t.type)==null?void 0:e.name)??"string":Ys(t)&&RS(t)?t.name:LS(t)??t.name}A(Xbe,"getRuleTypeName");function CH(t){var e;return Sl(t)?((e=t.type)==null?void 0:e.name)??"string":LS(t)??t.name}A(CH,"getRuleType");function MS(t){const e={s:!1,i:!1,u:!1},r=Cg(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}A(MS,"terminalRegex");var kH=/[\s\S]/.source;function Cg(t,e){var r;if(qW(t))return jbe(t);if(UW(t))return Kbe(t);if(DW(t))return Jbe(t);if(_L(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Xc(Cg(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(FW(t))return Qbe(t);if(XW(t))return Zbe(t);if(WW(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),a=t.regex.substring(n+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),Xc(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(jW(t))return Xc(kH,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}A(Cg,"abstractElementToRegex");function jbe(t){return Xc(t.elements.map(e=>Cg(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}A(jbe,"terminalAlternativesToRegex");function Kbe(t){return Xc(t.elements.map(e=>Cg(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}A(Kbe,"terminalGroupToRegex");function Zbe(t){return Xc(`${kH}*?${Cg(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}A(Zbe,"untilTokenToRegex");function Qbe(t){return Xc(`(?!${Cg(t.terminal)})${kH}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}A(Qbe,"negateTokenToRegex");function Jbe(t){return t.right?Xc(`[${L3(t.left)}-${L3(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Xc(L3(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}A(Jbe,"characterRangeToRegex");function L3(t){return Bx(t.value)}A(L3,"keywordToRegex");function Xc(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}A(Xc,"withCardinality");function SH(t){const e=[],r=t.Grammar;for(const n of r.rules)Sl(n)&&gH(n)&&lH(MS(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:eH}}A(SH,"createGrammarConfig");var p1t=typeof global=="object"&&global&&global.Object===Object&&global,exe=p1t,g1t=typeof self=="object"&&self&&self.Object===Object&&self,m1t=exe||g1t||Function("return this")(),pu=m1t,y1t=pu.Symbol,Cl=y1t,txe=Object.prototype,v1t=txe.hasOwnProperty,b1t=txe.toString,TT=Cl?Cl.toStringTag:void 0;function rxe(t){var e=v1t.call(t,TT),r=t[TT];try{t[TT]=void 0;var n=!0}catch{}var i=b1t.call(t);return n&&(e?t[TT]=r:delete t[TT]),i}A(rxe,"getRawTag");var x1t=rxe,T1t=Object.prototype,w1t=T1t.toString;function nxe(t){return w1t.call(t)}A(nxe,"objectToString");var C1t=nxe,k1t="[object Null]",S1t="[object Undefined]",Ite=Cl?Cl.toStringTag:void 0;function ixe(t){return t==null?t===void 0?S1t:k1t:Ite&&Ite in Object(t)?x1t(t):C1t(t)}A(ixe,"baseGetTag");var $f=ixe;function axe(t){return t!=null&&typeof t=="object"}A(axe,"isObjectLike");var cc=axe,E1t="[object Symbol]";function sxe(t){return typeof t=="symbol"||cc(t)&&$f(t)==E1t}A(sxe,"isSymbol");var zL=sxe;function oxe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=lvt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}A(kxe,"shortOut");var hvt=kxe;function Sxe(t){return function(){return t}}A(Sxe,"constant");var dvt=Sxe,fvt=(function(){try{var t=Sg(Object,"defineProperty");return t({},"",{}),t}catch{}})(),j_=fvt,pvt=j_?function(t,e){return j_(t,"toString",{configurable:!0,enumerable:!1,value:dvt(e),writable:!0})}:DS,gvt=pvt,mvt=hvt(gvt),yvt=mvt;function Exe(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}A(Nxe,"arrayIncludes");var Dxe=Nxe,xvt=9007199254740991,Tvt=/^(?:0|[1-9]\d*)$/;function Oxe(t,e){var r=typeof t;return e=e??xvt,!!e&&(r=="number"||r!="symbol"&&Tvt.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=Svt}A(Gxe,"isLength");var LH=Gxe;function Wxe(t){return t!=null&&LH(t.length)&&!Yh(t)}A(Wxe,"isArrayLike");var gu=Wxe;function Hxe(t,e,r){if(!kl(r))return!1;var n=typeof e;return(n=="number"?gu(r)&&VL(e,r.length):n=="string"&&e in r)?OS(r[e],t):!1}A(Hxe,"isIterateeCall");var WL=Hxe;function qxe(t){return RH(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&WL(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}A(TTe,"listCacheHas");var W2t=TTe;function wTe(t,e){var r=this.__data__,n=UL(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}A(wTe,"listCacheSet");var H2t=wTe;function Ag(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?OH(o,e-1,r,n,i):DH(i,o):n||(i[i.length]=o)}return i}A(OH,"baseFlatten");var $H=OH;function BTe(t){var e=t==null?0:t.length;return e?$H(t,1):[]}A(BTe,"flatten");var nc=BTe,cbt=iTe(Object.getPrototypeOf,Object),FTe=cbt;function zTe(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++no))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Jxt?new zH:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&WL(e[0],e[1],i)&&(n=1);++r=UTt&&(a=VH,s=!1,e=new zH(e));e:for(;++i-1?i[a?e[s]:s]:void 0}}A(TCe,"createFind");var QTt=TCe,JTt=Math.max;function wCe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:NS(r);return i<0&&(i=JTt(n+i,0)),Rxe(t,mu(e),i)}A(wCe,"findIndex");var ewt=wCe,twt=QTt(ewt),rx=twt;function CCe(t){return t&&t.length?t[0]:void 0}A(CCe,"head");var uc=CCe;function kCe(t,e){var r=-1,n=gu(t)?Array(t.length):[];return Lg(t,function(i,a,s){n[++r]=e(i,a,s)}),n}A(kCe,"baseMap");var rwt=kCe;function SCe(t,e){var r=cn(t)?IS:rwt;return r(t,mu(e))}A(SCe,"map");var ir=SCe;function ECe(t,e){return $H(ir(t,e),1)}A(ECe,"flatMap");var vl=ECe,nwt=Object.prototype,iwt=nwt.hasOwnProperty,awt=WTt(function(t,e,r){iwt.call(t,r)?t[r].push(e):_H(t,r,[e])}),swt=awt,owt=Object.prototype,lwt=owt.hasOwnProperty;function ACe(t,e){return t!=null&&lwt.call(t,e)}A(ACe,"baseHas");var cwt=ACe;function _Ce(t,e){return t!=null&&Uwe(t,e,cwt)}A(_Ce,"has");var mr=_Ce,uwt="[object String]";function RCe(t){return typeof t=="string"||!cn(t)&&cc(t)&&$f(t)==uwt}A(RCe,"isString");var wo=RCe;function LCe(t,e){return IS(e,function(r){return t[r]})}A(LCe,"baseValues");var hwt=LCe;function MCe(t){return t==null?[]:hwt(t,Go(t))}A(MCe,"values");var na=MCe,dwt=Math.max;function ICe(t,e,r,n){t=gu(t)?t:na(t),r=r&&!n?NS(r):0;var i=t.length;return r<0&&(r=dwt(i+r,0)),wo(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&AH(t,e,r)>-1}A(ICe,"includes");var to=ICe,fwt=Math.max;function NCe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:NS(r);return i<0&&(i=fwt(n+i,0)),AH(t,e,i)}A(NCe,"indexOf");var ure=NCe,pwt="[object Map]",gwt="[object Set]",mwt=Object.prototype,ywt=mwt.hasOwnProperty;function DCe(t){if(t==null)return!0;if(gu(t)&&(cn(t)||typeof t=="string"||typeof t.splice=="function"||fk(t)||MH(t)||HL(t)))return!t.length;var e=tx(t);if(e==pwt||e==gwt)return!t.size;if(PS(t))return!sTe(t).length;for(var r in t)if(ywt.call(t,r))return!1;return!0}A(DCe,"isEmpty");var Vn=DCe,vwt="[object RegExp]";function OCe(t){return cc(t)&&$f(t)==vwt}A(OCe,"baseIsRegExp");var bwt=OCe,hre=gf&&gf.isRegExp,xwt=hre?BS(hre):bwt,Ah=xwt;function $Ce(t){return t===void 0}A($Ce,"isUndefined");var _h=$Ce,Twt="Expected a function";function PCe(t){if(typeof t!="function")throw new TypeError(Twt);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}A(PCe,"negate");var wwt=PCe;function BCe(t,e,r,n){if(!kl(t))return t;e=ZL(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i=Lwt){var u=e?null:Rwt(t);if(u)return GH(u);s=!1,i=VH,l=new zH}else l=e?[]:o;e:for(;++n{r.accept(e)})}},A(n1,"AbstractProduction"),n1),i1,Xs=(i1=class extends yu{constructor(e){super([]),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},A(i1,"NonTerminal"),i1),a1,Fx=(a1=class extends yu{constructor(e){super(e.definition),this.orgText="",Wo(this,fc(e,r=>r!==void 0))}},A(a1,"Rule"),a1),s1,Co=(s1=class extends yu{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Wo(this,fc(e,r=>r!==void 0))}},A(s1,"Alternative"),s1),o1,Qa=(o1=class extends yu{constructor(e){super(e.definition),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}},A(o1,"Option"),o1),l1,Xo=(l1=class extends yu{constructor(e){super(e.definition),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}},A(l1,"RepetitionMandatory"),l1),c1,jo=(c1=class extends yu{constructor(e){super(e.definition),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}},A(c1,"RepetitionMandatoryWithSeparator"),c1),u1,ki=(u1=class extends yu{constructor(e){super(e.definition),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}},A(u1,"Repetition"),u1),h1,ko=(h1=class extends yu{constructor(e){super(e.definition),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}},A(h1,"RepetitionWithSeparator"),h1),d1,So=(d1=class extends yu{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Wo(this,fc(e,r=>r!==void 0))}},A(d1,"Alternation"),d1),f1,Jn=(f1=class{constructor(e){this.idx=1,Wo(this,fc(e,r=>r!==void 0))}accept(e){e.visit(this)}},A(f1,"Terminal"),f1);function ZCe(t){return ir(t,aC)}A(ZCe,"serializeGrammar");function aC(t){function e(r){return ir(r,aC)}if(A(e,"convertDefinition"),t instanceof Xs){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return wo(t.label)&&(r.label=t.label),r}else{if(t instanceof Co)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Qa)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Xo)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof jo)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:aC(new Jn({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ko)return{type:"RepetitionWithSeparator",idx:t.idx,separator:aC(new Jn({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ki)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof So)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Jn){const r={type:"Terminal",name:t.terminalType.name,label:jCe(t.terminalType),idx:t.idx};wo(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Ah(n)?n.source:n),r}else{if(t instanceof Fx)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}A(aC,"serializeProduction");var p1,zx=(p1=class{visit(e){const r=e;switch(r.constructor){case Xs:return this.visitNonTerminal(r);case Co:return this.visitAlternative(r);case Qa:return this.visitOption(r);case Xo:return this.visitRepetitionMandatory(r);case jo:return this.visitRepetitionMandatoryWithSeparator(r);case ko:return this.visitRepetitionWithSeparator(r);case ki:return this.visitRepetition(r);case So:return this.visitAlternation(r);case Jn:return this.visitTerminal(r);case Fx:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},A(p1,"GAstVisitor"),p1);function QCe(t){return t instanceof Co||t instanceof Qa||t instanceof ki||t instanceof Xo||t instanceof jo||t instanceof ko||t instanceof Jn||t instanceof Fx}A(QCe,"isSequenceProd");function vk(t,e=[]){return t instanceof Qa||t instanceof ki||t instanceof ko?!0:t instanceof So?UCe(t.definition,n=>vk(n,e)):t instanceof Xs&&to(e,t)?!1:t instanceof yu?(t instanceof Xs&&e.push(t),ic(t.definition,n=>vk(n,e))):!1}A(vk,"isOptionalProd");function JCe(t){return t instanceof So}A(JCe,"isBranchingProd");function Gl(t){if(t instanceof Xs)return"SUBRULE";if(t instanceof Qa)return"OPTION";if(t instanceof So)return"OR";if(t instanceof Xo)return"AT_LEAST_ONE";if(t instanceof jo)return"AT_LEAST_ONE_SEP";if(t instanceof ko)return"MANY_SEP";if(t instanceof ki)return"MANY";if(t instanceof Jn)return"CONSUME";throw Error("non exhaustive match")}A(Gl,"getProductionDslName");var g1,e7=(g1=class{walk(e,r=[]){kr(e.definition,(n,i)=>{const a=Ga(e.definition,i+1);if(n instanceof Xs)this.walkProdRef(n,a,r);else if(n instanceof Jn)this.walkTerminal(n,a,r);else if(n instanceof Co)this.walkFlat(n,a,r);else if(n instanceof Qa)this.walkOption(n,a,r);else if(n instanceof Xo)this.walkAtLeastOne(n,a,r);else if(n instanceof jo)this.walkAtLeastOneSep(n,a,r);else if(n instanceof ko)this.walkManySep(n,a,r);else if(n instanceof ki)this.walkMany(n,a,r);else if(n instanceof So)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new Qa({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=I9(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Qa({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=I9(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);kr(e.definition,a=>{const s=new Co({definition:[a]});this.walk(s,i)})}},A(g1,"RestWalker"),g1);function I9(t,e,r){return[new Qa({definition:[new Jn({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}A(I9,"restForRepetitionWithSeparator");function Vx(t){if(t instanceof Xs)return Vx(t.referencedRule);if(t instanceof Jn)return rke(t);if(QCe(t))return eke(t);if(JCe(t))return tke(t);throw Error("non exhaustive match")}A(Vx,"first");function eke(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=vk(a),e=e.concat(Vx(a)),n=n+1,i=r.length>n;return qH(e)}A(eke,"firstForSequence");function tke(t){const e=ir(t.definition,r=>Vx(r));return qH(nc(e))}A(tke,"firstForBranching");function rke(t){return[t.terminalType]}A(rke,"firstForTerminal");var nke="_~IN~_",m1,Iwt=(m1=class extends e7{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=ake(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new Co({definition:a}),o=Vx(s);this.follows[i]=o}},A(m1,"ResyncFollowsWalker"),m1);function ike(t){const e={};return kr(t,r=>{const n=new Iwt(r).startWalking();Wo(e,n)}),e}A(ike,"computeAllProdsFollows");function ake(t,e){return t.name+e+nke}A(ake,"buildBetweenProdsFollowPrefix");var M3={},Nwt=new Pbe;function VS(t){const e=t.toString();if(M3.hasOwnProperty(e))return M3[e];{const r=Nwt.pattern(e);return M3[e]=r,r}}A(VS,"getRegExpAst");function ske(){M3={}}A(ske,"clearRegExpParserCache");var oke="Complement Sets are not supported for first char optimization",Q_=`Unable to use "first char" lexer optimizations: -`;function lke(t,e=!1){try{const r=VS(t);return J_(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===oke)e&&UH(`${Q_} Unable to optimize: < ${t.toString()} > +`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},A(r1,"TerminalRegExpVisitor"),r1),e0=new m1t;function Vbe(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=zbe.pattern(t),r=[];for(const n of e.value.value)e0.reset(t),e0.visit(n),r.push({start:e0.startRegexp,end:e0.endRegex});return r}catch{return[]}}A(Vbe,"getTerminalParts");function lH(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),e0.reset(t),e0.visit(zbe.pattern(t)),e0.multiline}catch{return!1}}A(lH,"isMultilineComment");var Gbe=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function DL(t){const e=typeof t=="string"?new RegExp(t):t;return Gbe.some(r=>e.test(r))}A(DL,"isWhitespace");function Bx(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}A(Bx,"escapeRegExp");function cH(t,e){const r=uH(t),n=e.match(r);return!!n&&n[0].length>0}A(cH,"partialMatches");function uH(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(u){a+=r.substr(n,u),n+=u}A(o,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(A(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return A(i,"process"),new RegExp(i(),t.flags)}A(uH,"partialRegExp");function hH(t){return t.rules.find(e=>Ys(e)&&e.entry)}A(hH,"getEntryRule");function dH(t){return t.rules.filter(e=>Sl(e)&&e.hidden)}A(dH,"getHiddenRules");function OL(t,e){const r=new Set,n=hH(t);if(!n)return new Set(t.rules);const i=[n].concat(dH(t));for(const s of i)fH(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||Sl(s)&&s.hidden)&&a.add(s);return a}A(OL,"getAllReachableRules");function fH(t,e,r){e.add(t.name),Uh(t).forEach(n=>{if(Eh(n)||r&&_L(n)){const i=n.rule.ref;i&&!e.has(i.name)&&fH(i,e,r)}})}A(fH,"ruleDfs");function Wbe(t){const e=new Set;return Uh(t).forEach(r=>{Tg(r)&&(Ys(r.type.ref)&&e.add(r.type.ref),_S(r.type.ref)&&Ys(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}A(Wbe,"getAllRulesUsedForCrossReferences");function pH(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=FL(t.type.ref);return e==null?void 0:e.terminal}}A(pH,"getCrossReferenceTerminal");function gH(t){return t.hidden&&!DL(MS(t))}A(gH,"isCommentTerminal");function mH(t,e){return!t||!e?[]:PL(t,e,t.astNode,!0)}A(mH,"findNodesForProperty");function $L(t,e,r){if(!t||!e)return;const n=PL(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}A($L,"findNodeForProperty");function PL(t,e,r,n){if(!n){const i=bg(t.grammarSource,kh);if(i&&i.feature===e)return[t]}return Ch(t)&&t.astNode===r?t.content.flatMap(i=>PL(i,e,r,!1)):[]}A(PL,"findNodesForPropertyInternal");function Hbe(t,e){return t?BL(t,e,t==null?void 0:t.astNode):[]}A(Hbe,"findNodesForKeyword");function yH(t,e,r){if(!t)return;const n=BL(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}A(yH,"findNodeForKeyword");function BL(t,e,r){if(t.astNode!==r)return[];if(Sh(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=Jb(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?Sh(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}A(BL,"findNodesForKeywordInternal");function vH(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=bg(t.grammarSource,kh);if(n)return n;t=t.container}}A(vH,"findAssignment");function FL(t){let e=t;return _S(e)&&(pf(e.$container)?e=e.$container.$container:xg(e.$container)?e=e.$container:Of(e.$container)),bH(t,e,new Map)}A(FL,"findNameAssignment");function bH(t,e,r){var i;function n(a,s){let o;return bg(a,kh)||(o=bH(s,s,r)),r.set(t,o),o}if(A(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of Uh(e)){if(kh(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Eh(a)&&Ys(a.rule.ref))return n(a,a.rule.ref);if(AL(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}A(bH,"findNameAssignmentInternal");function xH(t){const e=t.$container;if(wg(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(pf(a))return a;{const s=Uh(r[i]).find(pf);if(s)return s}}}if(SL(e))return xH(e)}A(xH,"getActionAtElement");function qbe(t,e){return t==="?"||t==="*"||wg(e)&&!!e.guardCondition}A(qbe,"isOptionalCardinality");function Ube(t){return t==="*"||t==="+"}A(Ube,"isArrayCardinality");function Ybe(t){return t==="+="}A(Ybe,"isArrayOperator");function RS(t){return TH(t,new Set)}A(RS,"isDataTypeRule");function TH(t,e){if(e.has(t))return!0;e.add(t);for(const r of Uh(t))if(Eh(r)){if(!r.rule.ref||Ys(r.rule.ref)&&!TH(r.rule.ref,e)||Qb(r.rule.ref))return!1}else{if(kh(r))return!1;if(pf(r))return!1}return!!t.definition}A(TH,"isDataTypeRuleInternal");function Xbe(t){return X_(t.type,new Set)}A(Xbe,"isDataType");function X_(t,e){if(e.has(t))return!0;if(e.add(t),IW(t))return!1;if(GW(t))return!1;if(YW(t))return t.types.every(r=>X_(r,e));if(AL(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const r=t.typeRef.ref;return RL(r)?X_(r.type,e):!1}else return!1}else return!1}A(X_,"isDataTypeInternal");function LS(t){if(!Sl(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}A(LS,"getExplicitRuleType");function q0(t){if(xg(t))return Ys(t)&&RS(t)?t.name:LS(t)??t.name;if(BW(t)||RL(t)||HW(t))return t.name;if(pf(t)){const e=wH(t);if(e)return e}else if(_S(t))return t.name;throw new Error("Cannot get name of Unknown Type")}A(q0,"getTypeName");function wH(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return q0(t.type.ref)}A(wH,"getActionType");function jbe(t){var e;return Sl(t)?((e=t.type)==null?void 0:e.name)??"string":Ys(t)&&RS(t)?t.name:LS(t)??t.name}A(jbe,"getRuleTypeName");function CH(t){var e;return Sl(t)?((e=t.type)==null?void 0:e.name)??"string":LS(t)??t.name}A(CH,"getRuleType");function MS(t){const e={s:!1,i:!1,u:!1},r=Cg(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}A(MS,"terminalRegex");var kH=/[\s\S]/.source;function Cg(t,e){var r;if(qW(t))return Kbe(t);if(UW(t))return Zbe(t);if(DW(t))return exe(t);if(_L(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Xc(Cg(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(FW(t))return Jbe(t);if(XW(t))return Qbe(t);if(WW(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),a=t.regex.substring(n+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),Xc(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(jW(t))return Xc(kH,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}A(Cg,"abstractElementToRegex");function Kbe(t){return Xc(t.elements.map(e=>Cg(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}A(Kbe,"terminalAlternativesToRegex");function Zbe(t){return Xc(t.elements.map(e=>Cg(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}A(Zbe,"terminalGroupToRegex");function Qbe(t){return Xc(`${kH}*?${Cg(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}A(Qbe,"untilTokenToRegex");function Jbe(t){return Xc(`(?!${Cg(t.terminal)})${kH}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}A(Jbe,"negateTokenToRegex");function exe(t){return t.right?Xc(`[${L3(t.left)}-${L3(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Xc(L3(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}A(exe,"characterRangeToRegex");function L3(t){return Bx(t.value)}A(L3,"keywordToRegex");function Xc(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}A(Xc,"withCardinality");function SH(t){const e=[],r=t.Grammar;for(const n of r.rules)Sl(n)&&gH(n)&&lH(MS(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:eH}}A(SH,"createGrammarConfig");var y1t=typeof global=="object"&&global&&global.Object===Object&&global,txe=y1t,v1t=typeof self=="object"&&self&&self.Object===Object&&self,b1t=txe||v1t||Function("return this")(),pu=b1t,x1t=pu.Symbol,Cl=x1t,rxe=Object.prototype,T1t=rxe.hasOwnProperty,w1t=rxe.toString,TT=Cl?Cl.toStringTag:void 0;function nxe(t){var e=T1t.call(t,TT),r=t[TT];try{t[TT]=void 0;var n=!0}catch{}var i=w1t.call(t);return n&&(e?t[TT]=r:delete t[TT]),i}A(nxe,"getRawTag");var C1t=nxe,k1t=Object.prototype,S1t=k1t.toString;function ixe(t){return S1t.call(t)}A(ixe,"objectToString");var E1t=ixe,A1t="[object Null]",_1t="[object Undefined]",Nte=Cl?Cl.toStringTag:void 0;function axe(t){return t==null?t===void 0?_1t:A1t:Nte&&Nte in Object(t)?C1t(t):E1t(t)}A(axe,"baseGetTag");var $f=axe;function sxe(t){return t!=null&&typeof t=="object"}A(sxe,"isObjectLike");var cc=sxe,R1t="[object Symbol]";function oxe(t){return typeof t=="symbol"||cc(t)&&$f(t)==R1t}A(oxe,"isSymbol");var zL=oxe;function lxe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=hvt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}A(Sxe,"shortOut");var pvt=Sxe;function Exe(t){return function(){return t}}A(Exe,"constant");var gvt=Exe,mvt=(function(){try{var t=Sg(Object,"defineProperty");return t({},"",{}),t}catch{}})(),j_=mvt,yvt=j_?function(t,e){return j_(t,"toString",{configurable:!0,enumerable:!1,value:gvt(e),writable:!0})}:DS,vvt=yvt,bvt=pvt(vvt),xvt=bvt;function Axe(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}A(Dxe,"arrayIncludes");var Oxe=Dxe,Cvt=9007199254740991,kvt=/^(?:0|[1-9]\d*)$/;function $xe(t,e){var r=typeof t;return e=e??Cvt,!!e&&(r=="number"||r!="symbol"&&kvt.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=_vt}A(Wxe,"isLength");var LH=Wxe;function Hxe(t){return t!=null&&LH(t.length)&&!Yh(t)}A(Hxe,"isArrayLike");var gu=Hxe;function qxe(t,e,r){if(!kl(r))return!1;var n=typeof e;return(n=="number"?gu(r)&&VL(e,r.length):n=="string"&&e in r)?OS(r[e],t):!1}A(qxe,"isIterateeCall");var WL=qxe;function Uxe(t){return RH(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&WL(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}A(wTe,"listCacheHas");var U2t=wTe;function CTe(t,e){var r=this.__data__,n=UL(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}A(CTe,"listCacheSet");var Y2t=CTe;function Ag(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?OH(o,e-1,r,n,i):DH(i,o):n||(i[i.length]=o)}return i}A(OH,"baseFlatten");var $H=OH;function FTe(t){var e=t==null?0:t.length;return e?$H(t,1):[]}A(FTe,"flatten");var nc=FTe,dbt=aTe(Object.getPrototypeOf,Object),zTe=dbt;function VTe(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++no))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&rTt?new zH:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&WL(e[0],e[1],i)&&(n=1);++r=jTt&&(a=VH,s=!1,e=new zH(e));e:for(;++i-1?i[a?e[s]:s]:void 0}}A(wCe,"createFind");var twt=wCe,rwt=Math.max;function CCe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:NS(r);return i<0&&(i=rwt(n+i,0)),Lxe(t,mu(e),i)}A(CCe,"findIndex");var nwt=CCe,iwt=twt(nwt),rx=iwt;function kCe(t){return t&&t.length?t[0]:void 0}A(kCe,"head");var uc=kCe;function SCe(t,e){var r=-1,n=gu(t)?Array(t.length):[];return Lg(t,function(i,a,s){n[++r]=e(i,a,s)}),n}A(SCe,"baseMap");var awt=SCe;function ECe(t,e){var r=cn(t)?IS:awt;return r(t,mu(e))}A(ECe,"map");var ir=ECe;function ACe(t,e){return $H(ir(t,e),1)}A(ACe,"flatMap");var vl=ACe,swt=Object.prototype,owt=swt.hasOwnProperty,lwt=UTt(function(t,e,r){owt.call(t,r)?t[r].push(e):_H(t,r,[e])}),cwt=lwt,uwt=Object.prototype,hwt=uwt.hasOwnProperty;function _Ce(t,e){return t!=null&&hwt.call(t,e)}A(_Ce,"baseHas");var dwt=_Ce;function RCe(t,e){return t!=null&&Ywe(t,e,dwt)}A(RCe,"has");var mr=RCe,fwt="[object String]";function LCe(t){return typeof t=="string"||!cn(t)&&cc(t)&&$f(t)==fwt}A(LCe,"isString");var wo=LCe;function MCe(t,e){return IS(e,function(r){return t[r]})}A(MCe,"baseValues");var pwt=MCe;function ICe(t){return t==null?[]:pwt(t,Go(t))}A(ICe,"values");var na=ICe,gwt=Math.max;function NCe(t,e,r,n){t=gu(t)?t:na(t),r=r&&!n?NS(r):0;var i=t.length;return r<0&&(r=gwt(i+r,0)),wo(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&AH(t,e,r)>-1}A(NCe,"includes");var to=NCe,mwt=Math.max;function DCe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:NS(r);return i<0&&(i=mwt(n+i,0)),AH(t,e,i)}A(DCe,"indexOf");var hre=DCe,ywt="[object Map]",vwt="[object Set]",bwt=Object.prototype,xwt=bwt.hasOwnProperty;function OCe(t){if(t==null)return!0;if(gu(t)&&(cn(t)||typeof t=="string"||typeof t.splice=="function"||fk(t)||MH(t)||HL(t)))return!t.length;var e=tx(t);if(e==ywt||e==vwt)return!t.size;if(PS(t))return!oTe(t).length;for(var r in t)if(xwt.call(t,r))return!1;return!0}A(OCe,"isEmpty");var Gn=OCe,Twt="[object RegExp]";function $Ce(t){return cc(t)&&$f(t)==Twt}A($Ce,"baseIsRegExp");var wwt=$Ce,dre=gf&&gf.isRegExp,Cwt=dre?BS(dre):wwt,Ah=Cwt;function PCe(t){return t===void 0}A(PCe,"isUndefined");var _h=PCe,kwt="Expected a function";function BCe(t){if(typeof t!="function")throw new TypeError(kwt);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}A(BCe,"negate");var Swt=BCe;function FCe(t,e,r,n){if(!kl(t))return t;e=ZL(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i=Nwt){var u=e?null:Iwt(t);if(u)return GH(u);s=!1,i=VH,l=new zH}else l=e?[]:o;e:for(;++n{r.accept(e)})}},A(n1,"AbstractProduction"),n1),i1,Xs=(i1=class extends yu{constructor(e){super([]),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},A(i1,"NonTerminal"),i1),a1,Fx=(a1=class extends yu{constructor(e){super(e.definition),this.orgText="",Wo(this,fc(e,r=>r!==void 0))}},A(a1,"Rule"),a1),s1,Co=(s1=class extends yu{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Wo(this,fc(e,r=>r!==void 0))}},A(s1,"Alternative"),s1),o1,Qa=(o1=class extends yu{constructor(e){super(e.definition),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}},A(o1,"Option"),o1),l1,Xo=(l1=class extends yu{constructor(e){super(e.definition),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}},A(l1,"RepetitionMandatory"),l1),c1,jo=(c1=class extends yu{constructor(e){super(e.definition),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}},A(c1,"RepetitionMandatoryWithSeparator"),c1),u1,ki=(u1=class extends yu{constructor(e){super(e.definition),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}},A(u1,"Repetition"),u1),h1,ko=(h1=class extends yu{constructor(e){super(e.definition),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}},A(h1,"RepetitionWithSeparator"),h1),d1,So=(d1=class extends yu{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Wo(this,fc(e,r=>r!==void 0))}},A(d1,"Alternation"),d1),f1,Jn=(f1=class{constructor(e){this.idx=1,Wo(this,fc(e,r=>r!==void 0))}accept(e){e.visit(this)}},A(f1,"Terminal"),f1);function QCe(t){return ir(t,aC)}A(QCe,"serializeGrammar");function aC(t){function e(r){return ir(r,aC)}if(A(e,"convertDefinition"),t instanceof Xs){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return wo(t.label)&&(r.label=t.label),r}else{if(t instanceof Co)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Qa)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Xo)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof jo)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:aC(new Jn({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ko)return{type:"RepetitionWithSeparator",idx:t.idx,separator:aC(new Jn({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ki)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof So)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Jn){const r={type:"Terminal",name:t.terminalType.name,label:KCe(t.terminalType),idx:t.idx};wo(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Ah(n)?n.source:n),r}else{if(t instanceof Fx)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}A(aC,"serializeProduction");var p1,zx=(p1=class{visit(e){const r=e;switch(r.constructor){case Xs:return this.visitNonTerminal(r);case Co:return this.visitAlternative(r);case Qa:return this.visitOption(r);case Xo:return this.visitRepetitionMandatory(r);case jo:return this.visitRepetitionMandatoryWithSeparator(r);case ko:return this.visitRepetitionWithSeparator(r);case ki:return this.visitRepetition(r);case So:return this.visitAlternation(r);case Jn:return this.visitTerminal(r);case Fx:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},A(p1,"GAstVisitor"),p1);function JCe(t){return t instanceof Co||t instanceof Qa||t instanceof ki||t instanceof Xo||t instanceof jo||t instanceof ko||t instanceof Jn||t instanceof Fx}A(JCe,"isSequenceProd");function vk(t,e=[]){return t instanceof Qa||t instanceof ki||t instanceof ko?!0:t instanceof So?YCe(t.definition,n=>vk(n,e)):t instanceof Xs&&to(e,t)?!1:t instanceof yu?(t instanceof Xs&&e.push(t),ic(t.definition,n=>vk(n,e))):!1}A(vk,"isOptionalProd");function eke(t){return t instanceof So}A(eke,"isBranchingProd");function Gl(t){if(t instanceof Xs)return"SUBRULE";if(t instanceof Qa)return"OPTION";if(t instanceof So)return"OR";if(t instanceof Xo)return"AT_LEAST_ONE";if(t instanceof jo)return"AT_LEAST_ONE_SEP";if(t instanceof ko)return"MANY_SEP";if(t instanceof ki)return"MANY";if(t instanceof Jn)return"CONSUME";throw Error("non exhaustive match")}A(Gl,"getProductionDslName");var g1,e7=(g1=class{walk(e,r=[]){kr(e.definition,(n,i)=>{const a=Ga(e.definition,i+1);if(n instanceof Xs)this.walkProdRef(n,a,r);else if(n instanceof Jn)this.walkTerminal(n,a,r);else if(n instanceof Co)this.walkFlat(n,a,r);else if(n instanceof Qa)this.walkOption(n,a,r);else if(n instanceof Xo)this.walkAtLeastOne(n,a,r);else if(n instanceof jo)this.walkAtLeastOneSep(n,a,r);else if(n instanceof ko)this.walkManySep(n,a,r);else if(n instanceof ki)this.walkMany(n,a,r);else if(n instanceof So)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new Qa({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=I9(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Qa({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=I9(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);kr(e.definition,a=>{const s=new Co({definition:[a]});this.walk(s,i)})}},A(g1,"RestWalker"),g1);function I9(t,e,r){return[new Qa({definition:[new Jn({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}A(I9,"restForRepetitionWithSeparator");function Vx(t){if(t instanceof Xs)return Vx(t.referencedRule);if(t instanceof Jn)return nke(t);if(JCe(t))return tke(t);if(eke(t))return rke(t);throw Error("non exhaustive match")}A(Vx,"first");function tke(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=vk(a),e=e.concat(Vx(a)),n=n+1,i=r.length>n;return qH(e)}A(tke,"firstForSequence");function rke(t){const e=ir(t.definition,r=>Vx(r));return qH(nc(e))}A(rke,"firstForBranching");function nke(t){return[t.terminalType]}A(nke,"firstForTerminal");var ike="_~IN~_",m1,Owt=(m1=class extends e7{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=ske(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new Co({definition:a}),o=Vx(s);this.follows[i]=o}},A(m1,"ResyncFollowsWalker"),m1);function ake(t){const e={};return kr(t,r=>{const n=new Owt(r).startWalking();Wo(e,n)}),e}A(ake,"computeAllProdsFollows");function ske(t,e){return t.name+e+ike}A(ske,"buildBetweenProdsFollowPrefix");var M3={},$wt=new Bbe;function VS(t){const e=t.toString();if(M3.hasOwnProperty(e))return M3[e];{const r=$wt.pattern(e);return M3[e]=r,r}}A(VS,"getRegExpAst");function oke(){M3={}}A(oke,"clearRegExpParserCache");var lke="Complement Sets are not supported for first char optimization",Q_=`Unable to use "first char" lexer optimizations: +`;function cke(t,e=!1){try{const r=VS(t);return J_(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===lke)e&&UH(`${Q_} Unable to optimize: < ${t.toString()} > Complement Sets cannot be automatically optimized. This will disable the lexer's first char optimizations. See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=` @@ -1447,48 +1449,48 @@ ${JSON.stringify(Se,null,4)}`);const Ue=Se;if(r.string(Ue.id)||r.number(Ue.id)){ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Z_(`${Q_} Failed parsing: < ${t.toString()} > Using the @chevrotain/regexp-to-ast library - Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}A(lke,"getOptimizedStartCodesIndices");function J_(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")cw(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)cw(h,e,r);else{for(let h=u.from;h<=u.to&&h=hw){const h=u.from>=hw?u.from:hw,d=u.to,f=Rh(h),p=Rh(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":J_(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&e6(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return na(e)}A(J_,"firstCharOptimizedIndices");function cw(t,e,r){const n=Rh(t);e[n]=n,r===!0&&cke(t,e)}A(cw,"addOptimizedIdxToResult");function cke(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=Rh(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=Rh(i.charCodeAt(0));e[a]=a}}}A(cke,"handleIgnoreCase");function N9(t,e){return rx(t.value,r=>{if(typeof r=="number")return to(e,r);{const n=r;return rx(e,i=>n.from<=i&&i<=n.to)!==void 0}})}A(N9,"findCode");function e6(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?cn(t.value)?ic(t.value,e6):e6(t.value):!1}A(e6,"isWholeOptional");var y1,Dwt=(y1=class extends NL{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){to(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?N9(e,this.targetCharCodes)===void 0&&(this.found=!0):N9(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},A(y1,"CharCodeFinder"),y1);function t7(t,e){if(e instanceof RegExp){const r=VS(e),n=new Dwt(t);return n.visit(r),n.found}else return rx(e,r=>to(t,r.charCodeAt(0)))!==void 0}A(t7,"canMatchCharCode");var Y0="PATTERN",uw="defaultMode",o4="modes";function uke(t,e){e=HH(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` -`],tracer:A((T,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{Mke()});let n;r("Reject Lexer.NA",()=>{n=JL(t,T=>T[Y0]===Gs.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=ir(n,T=>{const b=T[Y0];if(Ah(b)){const w=b.source;return w.length===1&&w!=="^"&&w!=="$"&&w!=="."&&!b.ignoreCase?w:w.length===2&&w[0]==="\\"&&!to(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],w[1])?w[1]:D9(b)}else{if(Yh(b))return i=!0,{exec:b};if(typeof b=="object")return i=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const w=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),C=new RegExp(w);return D9(C)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=ir(n,T=>T.tokenTypeIdx),o=ir(n,T=>{const b=T.GROUP;if(b!==Gs.SKIPPED){if(wo(b))return b;if(_h(b))return!1;throw Error("non exhaustive match")}}),l=ir(n,T=>{const b=T.LONGER_ALT;if(b)return cn(b)?ir(b,C=>ure(n,C)):[ure(n,b)]}),u=ir(n,T=>T.PUSH_MODE),h=ir(n,T=>mr(T,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const T=ZH(e.lineTerminatorCharacters);d=ir(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=ir(n,b=>mr(b,"LINE_BREAKS")?!!b.LINE_BREAKS:KH(b,T)===!1&&t7(T,b.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=ir(n,jH),p=ir(a,Rke),g=Ho(n,(T,b)=>{const w=b.GROUP;return wo(w)&&w!==Gs.SKIPPED&&(T[w]=[]),T},{}),m=ir(a,(T,b)=>({pattern:a[b],longerAlt:l[b],canLineTerminator:d[b],isCustom:f[b],short:p[b],group:o[b],push:u[b],pop:h[b],tokenTypeIdx:s[b],tokenType:n[b]}))});let y=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=Ho(n,(T,b,w)=>{if(typeof b.PATTERN=="string"){const C=b.PATTERN.charCodeAt(0),S=Rh(C);I3(T,S,m[w])}else if(cn(b.START_CHARS_HINT)){let C;kr(b.START_CHARS_HINT,S=>{const k=typeof S=="string"?S.charCodeAt(0):S,E=Rh(k);C!==E&&(C=E,I3(T,E,m[w]))})}else if(Ah(b.PATTERN))if(b.PATTERN.unicode)y=!1,e.ensureOptimizations&&Z_(`${Q_} Unable to analyze < ${b.PATTERN.toString()} > pattern. + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}A(cke,"getOptimizedStartCodesIndices");function J_(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")cw(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)cw(h,e,r);else{for(let h=u.from;h<=u.to&&h=hw){const h=u.from>=hw?u.from:hw,d=u.to,f=Rh(h),p=Rh(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":J_(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&e6(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return na(e)}A(J_,"firstCharOptimizedIndices");function cw(t,e,r){const n=Rh(t);e[n]=n,r===!0&&uke(t,e)}A(cw,"addOptimizedIdxToResult");function uke(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=Rh(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=Rh(i.charCodeAt(0));e[a]=a}}}A(uke,"handleIgnoreCase");function N9(t,e){return rx(t.value,r=>{if(typeof r=="number")return to(e,r);{const n=r;return rx(e,i=>n.from<=i&&i<=n.to)!==void 0}})}A(N9,"findCode");function e6(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?cn(t.value)?ic(t.value,e6):e6(t.value):!1}A(e6,"isWholeOptional");var y1,Pwt=(y1=class extends NL{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){to(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?N9(e,this.targetCharCodes)===void 0&&(this.found=!0):N9(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},A(y1,"CharCodeFinder"),y1);function t7(t,e){if(e instanceof RegExp){const r=VS(e),n=new Pwt(t);return n.visit(r),n.found}else return rx(e,r=>to(t,r.charCodeAt(0)))!==void 0}A(t7,"canMatchCharCode");var Y0="PATTERN",uw="defaultMode",o4="modes";function hke(t,e){e=HH(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:A((T,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{Ike()});let n;r("Reject Lexer.NA",()=>{n=JL(t,T=>T[Y0]===Gs.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=ir(n,T=>{const b=T[Y0];if(Ah(b)){const w=b.source;return w.length===1&&w!=="^"&&w!=="$"&&w!=="."&&!b.ignoreCase?w:w.length===2&&w[0]==="\\"&&!to(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],w[1])?w[1]:D9(b)}else{if(Yh(b))return i=!0,{exec:b};if(typeof b=="object")return i=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const w=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),C=new RegExp(w);return D9(C)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=ir(n,T=>T.tokenTypeIdx),o=ir(n,T=>{const b=T.GROUP;if(b!==Gs.SKIPPED){if(wo(b))return b;if(_h(b))return!1;throw Error("non exhaustive match")}}),l=ir(n,T=>{const b=T.LONGER_ALT;if(b)return cn(b)?ir(b,C=>hre(n,C)):[hre(n,b)]}),u=ir(n,T=>T.PUSH_MODE),h=ir(n,T=>mr(T,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const T=ZH(e.lineTerminatorCharacters);d=ir(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=ir(n,b=>mr(b,"LINE_BREAKS")?!!b.LINE_BREAKS:KH(b,T)===!1&&t7(T,b.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=ir(n,jH),p=ir(a,Lke),g=Ho(n,(T,b)=>{const w=b.GROUP;return wo(w)&&w!==Gs.SKIPPED&&(T[w]=[]),T},{}),m=ir(a,(T,b)=>({pattern:a[b],longerAlt:l[b],canLineTerminator:d[b],isCustom:f[b],short:p[b],group:o[b],push:u[b],pop:h[b],tokenTypeIdx:s[b],tokenType:n[b]}))});let y=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=Ho(n,(T,b,w)=>{if(typeof b.PATTERN=="string"){const C=b.PATTERN.charCodeAt(0),S=Rh(C);I3(T,S,m[w])}else if(cn(b.START_CHARS_HINT)){let C;kr(b.START_CHARS_HINT,S=>{const k=typeof S=="string"?S.charCodeAt(0):S,E=Rh(k);C!==E&&(C=E,I3(T,E,m[w]))})}else if(Ah(b.PATTERN))if(b.PATTERN.unicode)y=!1,e.ensureOptimizations&&Z_(`${Q_} Unable to analyze < ${b.PATTERN.toString()} > pattern. The regexp unicode flag is not currently supported by the regexp-to-ast library. This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const C=lke(b.PATTERN,e.ensureOptimizations);Vn(C)&&(y=!1),kr(C,S=>{I3(T,S,m[w])})}else e.ensureOptimizations&&Z_(`${Q_} TokenType: <${b.name}> is using a custom token pattern without providing parameter. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const C=cke(b.PATTERN,e.ensureOptimizations);Gn(C)&&(y=!1),kr(C,S=>{I3(T,S,m[w])})}else e.ensureOptimizations&&Z_(`${Q_} TokenType: <${b.name}> is using a custom token pattern without providing parameter. This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return T},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}A(uke,"analyzeTokenTypes");function hke(t,e){let r=[];const n=fke(t);r=r.concat(n.errors);const i=pke(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(dke(a)),r=r.concat(xke(a)),r=r.concat(Tke(a,e)),r=r.concat(wke(a)),r}A(hke,"validatePatterns");function dke(t){let e=[];const r=El(t,n=>Ah(n[Y0]));return e=e.concat(gke(r)),e=e.concat(yke(r)),e=e.concat(vke(r)),e=e.concat(bke(r)),e=e.concat(mke(r)),e}A(dke,"validateRegExpPattern");function fke(t){const e=El(t,i=>!mr(i,Y0)),r=ir(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Si.MISSING_PATTERN,tokenTypes:[i]})),n=QL(t,e);return{errors:r,valid:n}}A(fke,"findMissingPatterns");function pke(t){const e=El(t,i=>{const a=i[Y0];return!Ah(a)&&!Yh(a)&&!mr(a,"exec")&&!wo(a)}),r=ir(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Si.INVALID_PATTERN,tokenTypes:[i]})),n=QL(t,e);return{errors:r,valid:n}}A(pke,"findInvalidPatterns");var Owt=/[^\\][$]/;function gke(t){const i=class i extends NL{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}};A(i,"EndAnchorFinder");let e=i;const r=El(t,a=>{const s=a.PATTERN;try{const o=VS(s),l=new e;return l.visit(o),l.found}catch{return Owt.test(s.source)}});return ir(r,a=>({message:`Unexpected RegExp Anchor Error: + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return T},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}A(hke,"analyzeTokenTypes");function dke(t,e){let r=[];const n=pke(t);r=r.concat(n.errors);const i=gke(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(fke(a)),r=r.concat(Tke(a)),r=r.concat(wke(a,e)),r=r.concat(Cke(a)),r}A(dke,"validatePatterns");function fke(t){let e=[];const r=El(t,n=>Ah(n[Y0]));return e=e.concat(mke(r)),e=e.concat(vke(r)),e=e.concat(bke(r)),e=e.concat(xke(r)),e=e.concat(yke(r)),e}A(fke,"validateRegExpPattern");function pke(t){const e=El(t,i=>!mr(i,Y0)),r=ir(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Si.MISSING_PATTERN,tokenTypes:[i]})),n=QL(t,e);return{errors:r,valid:n}}A(pke,"findMissingPatterns");function gke(t){const e=El(t,i=>{const a=i[Y0];return!Ah(a)&&!Yh(a)&&!mr(a,"exec")&&!wo(a)}),r=ir(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Si.INVALID_PATTERN,tokenTypes:[i]})),n=QL(t,e);return{errors:r,valid:n}}A(gke,"findInvalidPatterns");var Bwt=/[^\\][$]/;function mke(t){const i=class i extends NL{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}};A(i,"EndAnchorFinder");let e=i;const r=El(t,a=>{const s=a.PATTERN;try{const o=VS(s),l=new e;return l.visit(o),l.found}catch{return Bwt.test(s.source)}});return ir(r,a=>({message:`Unexpected RegExp Anchor Error: Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain end of input anchor '$' - See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Si.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}A(gke,"findEndOfInputAnchor");function mke(t){const e=El(t,n=>n.PATTERN.test(""));return ir(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Si.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}A(mke,"findEmptyMatchRegExps");var $wt=/[^\\[][\^]|^\^/;function yke(t){const i=class i extends NL{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}};A(i,"StartAnchorFinder");let e=i;const r=El(t,a=>{const s=a.PATTERN;try{const o=VS(s),l=new e;return l.visit(o),l.found}catch{return $wt.test(s.source)}});return ir(r,a=>({message:`Unexpected RegExp Anchor Error: + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Si.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}A(mke,"findEndOfInputAnchor");function yke(t){const e=El(t,n=>n.PATTERN.test(""));return ir(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Si.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}A(yke,"findEmptyMatchRegExps");var Fwt=/[^\\[][\^]|^\^/;function vke(t){const i=class i extends NL{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}};A(i,"StartAnchorFinder");let e=i;const r=El(t,a=>{const s=a.PATTERN;try{const o=VS(s),l=new e;return l.visit(o),l.found}catch{return Fwt.test(s.source)}});return ir(r,a=>({message:`Unexpected RegExp Anchor Error: Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain start of input anchor '^' - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Si.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}A(yke,"findStartOfInputAnchor");function vke(t){const e=El(t,n=>{const i=n[Y0];return i instanceof RegExp&&(i.multiline||i.global)});return ir(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Si.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}A(vke,"findUnsupportedFlags");function bke(t){const e=[];let r=ir(t,a=>Ho(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!to(e,o)&&o.PATTERN!==Gs.NA&&(e.push(o),s.push(o)),s),[]));r=zS(r);const n=El(r,a=>a.length>1);return ir(n,a=>{const s=ir(a,l=>l.name);return{message:`The same RegExp pattern ->${uc(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:Si.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}A(bke,"findDuplicatePatterns");function xke(t){const e=El(t,n=>{if(!mr(n,"GROUP"))return!1;const i=n.GROUP;return i!==Gs.SKIPPED&&i!==Gs.NA&&!wo(i)});return ir(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Si.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}A(xke,"findInvalidGroupType");function Tke(t,e){const r=El(t,i=>i.PUSH_MODE!==void 0&&!to(e,i.PUSH_MODE));return ir(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Si.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}A(Tke,"findModesThatDoNotExist");function wke(t){const e=[],r=Ho(t,(n,i,a)=>{const s=i.PATTERN;return s===Gs.NA||(wo(s)?n.push({str:s,idx:a,tokenType:i}):Ah(s)&&kke(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return kr(t,(n,i)=>{kr(r,({str:a,idx:s,tokenType:o})=>{if(i${o.name}<- can never be matched. + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Si.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}A(vke,"findStartOfInputAnchor");function bke(t){const e=El(t,n=>{const i=n[Y0];return i instanceof RegExp&&(i.multiline||i.global)});return ir(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Si.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}A(bke,"findUnsupportedFlags");function xke(t){const e=[];let r=ir(t,a=>Ho(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!to(e,o)&&o.PATTERN!==Gs.NA&&(e.push(o),s.push(o)),s),[]));r=zS(r);const n=El(r,a=>a.length>1);return ir(n,a=>{const s=ir(a,l=>l.name);return{message:`The same RegExp pattern ->${uc(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:Si.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}A(xke,"findDuplicatePatterns");function Tke(t){const e=El(t,n=>{if(!mr(n,"GROUP"))return!1;const i=n.GROUP;return i!==Gs.SKIPPED&&i!==Gs.NA&&!wo(i)});return ir(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Si.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}A(Tke,"findInvalidGroupType");function wke(t,e){const r=El(t,i=>i.PUSH_MODE!==void 0&&!to(e,i.PUSH_MODE));return ir(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Si.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}A(wke,"findModesThatDoNotExist");function Cke(t){const e=[],r=Ho(t,(n,i,a)=>{const s=i.PATTERN;return s===Gs.NA||(wo(s)?n.push({str:s,idx:a,tokenType:i}):Ah(s)&&Ske(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return kr(t,(n,i)=>{kr(r,({str:a,idx:s,tokenType:o})=>{if(i${o.name}<- can never be matched. Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition. -See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:Si.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}A(wke,"findUnreachablePatterns");function Cke(t,e){if(Ah(e)){if(Ske(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(Yh(e))return e(t,0,[],{});if(mr(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}A(Cke,"tryToMatchStrToPattern");function kke(t){return rx([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}A(kke,"noMetaChar");function Ske(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:Si.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}A(Cke,"findUnreachablePatterns");function kke(t,e){if(Ah(e)){if(Eke(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(Yh(e))return e(t,0,[],{});if(mr(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}A(kke,"tryToMatchStrToPattern");function Ske(t){return rx([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}A(Ske,"noMetaChar");function Eke(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition `,type:Si.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),mr(t,o4)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+o4+`> property in its definition `,type:Si.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),mr(t,o4)&&mr(t,uw)&&!mr(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${uw}: <${t.defaultMode}>which does not exist `,type:Si.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),mr(t,o4)&&kr(t.modes,(i,a)=>{kr(i,(s,o)=>{if(_h(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}> `,type:Si.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(mr(s,"LONGER_ALT")){const l=cn(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];kr(l,u=>{!_h(u)&&!to(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${s.name}> outside of mode <${a}> -`,type:Si.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}A(Eke,"performRuntimeChecks");function Ake(t,e,r){const n=[];let i=!1;const a=zS(nc(na(t.modes))),s=JL(a,l=>l[Y0]===Gs.NA),o=ZH(r);return e&&kr(s,l=>{const u=KH(l,o);if(u!==!1){const d={message:Lke(l,u),type:u.issue,tokenType:l};n.push(d)}else mr(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):t7(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. +`,type:Si.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}A(Ake,"performRuntimeChecks");function _ke(t,e,r){const n=[];let i=!1;const a=zS(nc(na(t.modes))),s=JL(a,l=>l[Y0]===Gs.NA),o=ZH(r);return e&&kr(s,l=>{const u=KH(l,o);if(u!==!1){const d={message:Mke(l,u),type:u.issue,tokenType:l};n.push(d)}else mr(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):t7(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. This Lexer has been defined to track line and column information, But none of the Token Types can be identified as matching a line terminator. See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS - for details.`,type:Si.NO_LINE_BREAKS_FLAGS}),n}A(Ake,"performWarningRuntimeChecks");function _ke(t){const e={},r=Go(t);return kr(r,n=>{const i=t[n];if(cn(i))e[n]=[];else throw Error("non exhaustive match")}),e}A(_ke,"cloneEmptyGroups");function jH(t){const e=t.PATTERN;if(Ah(e))return!1;if(Yh(e))return!0;if(mr(e,"exec"))return!0;if(wo(e))return!1;throw Error("non exhaustive match")}A(jH,"isCustomPattern");function Rke(t){return wo(t)&&t.length===1?t.charCodeAt(0):!1}A(Rke,"isShortPattern");var Pwt={test:A(function(t){const e=t.length;for(let r=this.lastIndex;r{const i=t[n];if(cn(i))e[n]=[];else throw Error("non exhaustive match")}),e}A(Rke,"cloneEmptyGroups");function jH(t){const e=t.PATTERN;if(Ah(e))return!1;if(Yh(e))return!0;if(mr(e,"exec"))return!0;if(wo(e))return!1;throw Error("non exhaustive match")}A(jH,"isCustomPattern");function Lke(t){return wo(t)&&t.length===1?t.charCodeAt(0):!1}A(Lke,"isShortPattern");var zwt={test:A(function(t){const e=t.length;for(let r=this.lastIndex;r Token Type Root cause: ${e.errMsg}. For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Si.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. The problem is in the <${t.name}> Token Type - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}A(Lke,"buildLineBreakIssueMessage");function ZH(t){return ir(t,r=>wo(r)?r.charCodeAt(0):r)}A(ZH,"getCharCodes");function I3(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}A(I3,"addToMapOfArrays");var hw=256,N3=[];function Rh(t){return t255?255+~~(t/255):t}}A(Mke,"initCharCodeToOptimizedIndexMap");function Gx(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}A(Gx,"tokenStructuredMatcher");function bk(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}A(bk,"tokenStructuredMatcherNoCategories");var dre=1,Ike={};function Wx(t){const e=Nke(t);Dke(e),$ke(e),Oke(e),kr(e,r=>{r.isParent=r.categoryMatches.length>0})}A(Wx,"augmentTokenTypes");function Nke(t){let e=es(t),r=t,n=!0;for(;n;){r=zS(nc(ir(r,a=>a.CATEGORIES)));const i=QL(r,e);e=e.concat(i),Vn(i)?n=!1:r=i}return e}A(Nke,"expandCategories");function Dke(t){kr(t,e=>{JH(e)||(Ike[dre]=e,e.tokenTypeIdx=dre++),O9(e)&&!cn(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),O9(e)||(e.CATEGORIES=[]),Pke(e)||(e.categoryMatches=[]),Bke(e)||(e.categoryMatchesMap={})})}A(Dke,"assignTokenDefaultProps");function Oke(t){kr(t,e=>{e.categoryMatches=[],kr(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(Ike[n].tokenTypeIdx)})})}A(Oke,"assignCategoriesTokensProp");function $ke(t){kr(t,e=>{QH([],e)})}A($ke,"assignCategoriesMapProp");function QH(t,e){kr(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),kr(e.CATEGORIES,r=>{const n=t.concat(e);to(n,r)||QH(n,r)})}A(QH,"singleAssignCategoriesToksMap");function JH(t){return mr(t,"tokenTypeIdx")}A(JH,"hasShortKeyProperty");function O9(t){return mr(t,"CATEGORIES")}A(O9,"hasCategoriesProperty");function Pke(t){return mr(t,"categoryMatches")}A(Pke,"hasExtendingTokensTypesProperty");function Bke(t){return mr(t,"categoryMatchesMap")}A(Bke,"hasExtendingTokensTypesMapProperty");function Fke(t){return mr(t,"tokenTypeIdx")}A(Fke,"isTokenType");var $9={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,a){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},Si;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Si||(Si={}));var dw={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}A(Mke,"buildLineBreakIssueMessage");function ZH(t){return ir(t,r=>wo(r)?r.charCodeAt(0):r)}A(ZH,"getCharCodes");function I3(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}A(I3,"addToMapOfArrays");var hw=256,N3=[];function Rh(t){return t255?255+~~(t/255):t}}A(Ike,"initCharCodeToOptimizedIndexMap");function Gx(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}A(Gx,"tokenStructuredMatcher");function bk(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}A(bk,"tokenStructuredMatcherNoCategories");var fre=1,Nke={};function Wx(t){const e=Dke(t);Oke(e),Pke(e),$ke(e),kr(e,r=>{r.isParent=r.categoryMatches.length>0})}A(Wx,"augmentTokenTypes");function Dke(t){let e=es(t),r=t,n=!0;for(;n;){r=zS(nc(ir(r,a=>a.CATEGORIES)));const i=QL(r,e);e=e.concat(i),Gn(i)?n=!1:r=i}return e}A(Dke,"expandCategories");function Oke(t){kr(t,e=>{JH(e)||(Nke[fre]=e,e.tokenTypeIdx=fre++),O9(e)&&!cn(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),O9(e)||(e.CATEGORIES=[]),Bke(e)||(e.categoryMatches=[]),Fke(e)||(e.categoryMatchesMap={})})}A(Oke,"assignTokenDefaultProps");function $ke(t){kr(t,e=>{e.categoryMatches=[],kr(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(Nke[n].tokenTypeIdx)})})}A($ke,"assignCategoriesTokensProp");function Pke(t){kr(t,e=>{QH([],e)})}A(Pke,"assignCategoriesMapProp");function QH(t,e){kr(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),kr(e.CATEGORIES,r=>{const n=t.concat(e);to(n,r)||QH(n,r)})}A(QH,"singleAssignCategoriesToksMap");function JH(t){return mr(t,"tokenTypeIdx")}A(JH,"hasShortKeyProperty");function O9(t){return mr(t,"CATEGORIES")}A(O9,"hasCategoriesProperty");function Bke(t){return mr(t,"categoryMatches")}A(Bke,"hasExtendingTokensTypesProperty");function Fke(t){return mr(t,"categoryMatchesMap")}A(Fke,"hasExtendingTokensTypesMapProperty");function zke(t){return mr(t,"tokenTypeIdx")}A(zke,"isTokenType");var $9={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,a){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},Si;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Si||(Si={}));var dw={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:$9,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(dw);var v1,Gs=(v1=class{constructor(e,r=dw){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${i}>`);const{time:o,value:l}=YH(a),u=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. -a boolean 2nd argument is no longer supported`);this.config=Wo({},dw,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===dw.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Pwt;else if(this.config.lineTerminatorCharacters===dw.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),cn(e)?i={modes:{defaultMode:es(e)},defaultMode:uw}:(a=!1,i=es(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Eke(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Ake(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},kr(i.modes,(o,l)=>{i.modes[l]=JL(o,u=>_h(u))});const s=Go(i.modes);if(kr(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(hke(o,s))}),Vn(this.lexerDefinitionErrors)){Wx(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=uke(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=Wo({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Vn(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=ir(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- +a boolean 2nd argument is no longer supported`);this.config=Wo({},dw,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===dw.lineTerminatorsPattern)this.config.lineTerminatorsPattern=zwt;else if(this.config.lineTerminatorCharacters===dw.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),cn(e)?i={modes:{defaultMode:es(e)},defaultMode:uw}:(a=!1,i=es(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Ake(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(_ke(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},kr(i.modes,(o,l)=>{i.modes[l]=JL(o,u=>_h(u))});const s=Go(i.modes);if(kr(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(dke(o,s))}),Gn(this.lexerDefinitionErrors)){Wx(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=hke(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=Wo({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Gn(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=ir(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- `);throw new Error(`Errors detected in definition of Lexer: -`+l)}kr(this.lexerDefinitionWarning,o=>{UH(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=ga),this.trackStartLines===!1&&(this.computeNewColumn=DS),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=ga),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=Ho(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!Vn(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. +`+l)}kr(this.lexerDefinitionWarning,o=>{UH(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=ma),this.trackStartLines===!1&&(this.computeNewColumn=DS),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=ma),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=Ho(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!Gn(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. - Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{ske()}),this.TRACE_INIT("toFastProperties",()=>{XH(this)})})}tokenize(e,r=this.defaultMode){if(!Vn(this.lexerDefinitionErrors)){const i=ir(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- + Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{oke()}),this.TRACE_INIT("toFastProperties",()=>{XH(this)})})}tokenize(e,r=this.defaultMode){if(!Gn(this.lexerDefinitionErrors)){const i=ir(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: -`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,u,h,d,f,p,g,m,y,v;const T=e,b=T.length;let w=0,C=0;const S=this.hasCustom?0:Math.floor(e.length/10),k=new Array(S),E=[];let _=this.trackStartLines?1:void 0,M=this.trackStartLines?1:void 0;const L=_ke(this.emptyGroups),P=this.trackStartLines,D=this.config.lineTerminatorsPattern;let R=0,I=[],$=[];const O=[],N=[];Object.freeze(N);let F=!1;const z=A(H=>{if(O.length===1&&H.tokenType.PUSH_MODE===void 0){const q=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(H);E.push({offset:H.startOffset,line:H.startLine,column:H.startColumn,length:H.image.length,message:q})}else{O.pop();const q=U0(O);I=this.patternIdxToConfig[q],$=this.charCodeToPatternIdxToConfig[q],R=I.length;const Z=this.canModeBeOptimized[q]&&this.config.safeMode===!1;$&&Z?F=!0:F=!1}},"pop_mode");function V(H){O.push(H),$=this.charCodeToPatternIdxToConfig[H],I=this.patternIdxToConfig[H],R=I.length,R=I.length;const q=this.canModeBeOptimized[H]&&this.config.safeMode===!1;$&&q?F=!0:F=!1}A(V,"push_mode"),V.call(this,r);let B;const G=this.config.recoveryEnabled;for(;wl.length){l=s,d=s.length,u=h,B=Q;break}}}break}}if(d!==-1){if(f=B.group,f!==void 0&&(l=l!==null?l:e.substring(w,w+d),p=B.tokenTypeIdx,g=this.createTokenInstance(l,w,p,B.tokenType,_,M,d),this.handlePayload(g,u),f===!1?C=this.addToken(k,C,g):L[f].push(g)),P===!0&&B.canLineTerminator===!0){let Y=0,ie,K;D.lastIndex=0;do l=l!==null?l:e.substring(w,w+d),ie=D.test(l),ie===!0&&(K=D.lastIndex-1,Y++);while(ie===!0);Y!==0?(_=_+Y,M=d-K,this.updateTokenEndLineColumnLocation(g,f,K,Y,_,M,d)):M=this.computeNewColumn(M,d)}else M=this.computeNewColumn(M,d);w=w+d,this.handleModes(B,z,V,g)}else{const Y=w,ie=_,K=M;let Q=G===!1;for(;Q===!1&&w ${f0(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",o=` +`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,u,h,d,f,p,g,m,y,v;const T=e,b=T.length;let w=0,C=0;const S=this.hasCustom?0:Math.floor(e.length/10),k=new Array(S),E=[];let _=this.trackStartLines?1:void 0,M=this.trackStartLines?1:void 0;const L=Rke(this.emptyGroups),P=this.trackStartLines,D=this.config.lineTerminatorsPattern;let R=0,I=[],$=[];const O=[],N=[];Object.freeze(N);let F=!1;const z=A(H=>{if(O.length===1&&H.tokenType.PUSH_MODE===void 0){const q=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(H);E.push({offset:H.startOffset,line:H.startLine,column:H.startColumn,length:H.image.length,message:q})}else{O.pop();const q=U0(O);I=this.patternIdxToConfig[q],$=this.charCodeToPatternIdxToConfig[q],R=I.length;const Z=this.canModeBeOptimized[q]&&this.config.safeMode===!1;$&&Z?F=!0:F=!1}},"pop_mode");function V(H){O.push(H),$=this.charCodeToPatternIdxToConfig[H],I=this.patternIdxToConfig[H],R=I.length,R=I.length;const q=this.canModeBeOptimized[H]&&this.config.safeMode===!1;$&&q?F=!0:F=!1}A(V,"push_mode"),V.call(this,r);let B;const G=this.config.recoveryEnabled;for(;wl.length){l=s,d=s.length,u=h,B=Q;break}}}break}}if(d!==-1){if(f=B.group,f!==void 0&&(l=l!==null?l:e.substring(w,w+d),p=B.tokenTypeIdx,g=this.createTokenInstance(l,w,p,B.tokenType,_,M,d),this.handlePayload(g,u),f===!1?C=this.addToken(k,C,g):L[f].push(g)),P===!0&&B.canLineTerminator===!0){let Y=0,ie,K;D.lastIndex=0;do l=l!==null?l:e.substring(w,w+d),ie=D.test(l),ie===!0&&(K=D.lastIndex-1,Y++);while(ie===!0);Y!==0?(_=_+Y,M=d-K,this.updateTokenEndLineColumnLocation(g,f,K,Y,_,M,d)):M=this.computeNewColumn(M,d)}else M=this.computeNewColumn(M,d);w=w+d,this.handleModes(B,z,V,g)}else{const Y=w,ie=_,K=M;let Q=G===!1;for(;Q===!1&&w ${f0(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",o=` but found: '`+uc(e).image+"'";if(n)return a+n+o;{const l=Ho(t,(f,p)=>f.concat(p),[]),u=ir(l,f=>`[${ir(f,p=>f0(p)).join(", ")}]`),d=`one of these possible Token sequences: ${ir(u,(f,p)=>` ${p+1}. ${f}`).join(` `)}`;return a+d+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",s=` but found: '`+uc(e).image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: - <${ir(t,u=>`[${ir(u,h=>f0(h)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(iy);var Fwt={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- + <${ir(t,u=>`[${ir(u,h=>f0(h)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(iy);var Gwt={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- inside top level rule: ->`+t.name+"<-"}},t0={buildDuplicateFoundError(t,e){function r(h){return h instanceof Jn?h.terminalType.name:h instanceof Xs?h.nonTerminalName:""}A(r,"getExtraProductionArgument");const n=t.name,i=uc(e),a=i.idx,s=Gl(i),o=r(i),l=a>0;let u=`->${s}${l?a:""}<- ${o?`with argument: ->${o}<-`:""} appears more than once (${e.length} times) in the top level rule: ->${n}<-. For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES @@ -1515,44 +1517,44 @@ rule: <${e}> can be invoked from itself (directly or indirectly) without consuming any Tokens. The grammar path that causes this is: ${n} To fix this refactor your grammar to remove the left recursion. -see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Fx?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function Vke(t,e){const r=new zwt(t,e);return r.resolveRefs(),r.errors}A(Vke,"resolveGrammar");var b1,zwt=(b1=class extends zx{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){kr(na(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:js.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},A(b1,"GastRefResolverVisitor"),b1),x1,Vwt=(x1=class extends e7{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=es(this.path.ruleStack).reverse(),this.occurrenceStack=es(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){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Vn(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},A(x1,"AbstractNextPossibleTokensWalker"),x1),T1,Gwt=(T1=class extends Vwt{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){const i=r.concat(n),a=new Co({definition:i});this.possibleTokTypes=Vx(a),this.found=!0}}},A(T1,"NextAfterTokenWalker"),T1),w1,r7=(w1=class extends e7{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}},A(w1,"AbstractNextTerminalAfterProductionWalker"),w1),C1,Wwt=(C1=class extends r7{walkMany(e,r,n){if(e.idx===this.occurrence){const i=uc(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Jn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},A(C1,"NextTerminalAfterManyWalker"),C1),k1,Tre=(k1=class extends r7{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=uc(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Jn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},A(k1,"NextTerminalAfterManySepWalker"),k1),S1,Hwt=(S1=class extends r7{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=uc(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Jn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},A(S1,"NextTerminalAfterAtLeastOneWalker"),S1),E1,wre=(E1=class extends r7{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=uc(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Jn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},A(E1,"NextTerminalAfterAtLeastOneSepWalker"),E1);function t6(t,e,r=[]){r=es(r);let n=[],i=0;function a(o){return o.concat(Ga(t,i+1))}A(a,"remainingPathWith");function s(o){const l=t6(a(o),e,r);return n.concat(l)}for(A(s,"getAlternativesForProd");r.length{Vn(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof Jn)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Ga(t,i)}),n}A(t6,"possiblePathsFrom");function rq(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Vn(d);){const f=d.pop();if(f===s){o&&U0(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(Vn(p))continue;const v=p[0];if(v===i){const T={idx:g,def:Ga(p),ruleStack:yk(m),occurrenceStack:yk(y)};d.push(T)}else if(v instanceof Jn)if(g=0;T--){const b=v.definition[T],w={idx:g,def:b.definition.concat(Ga(p)),ruleStack:m,occurrenceStack:y};d.push(w),d.push(s)}else if(v instanceof Co)d.push({idx:g,def:v.definition.concat(Ga(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof Fx)d.push(Gke(v,g,m,y));else throw Error("non exhaustive match")}return h}A(rq,"nextPossibleTokensAfter");function Gke(t,e,r,n){const i=es(r);i.push(t.name);const a=es(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}A(Gke,"expandTopLevelRule");var pi;(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"})(pi||(pi={}));function n7(t){if(t instanceof Qa||t==="Option")return pi.OPTION;if(t instanceof ki||t==="Repetition")return pi.REPETITION;if(t instanceof Xo||t==="RepetitionMandatory")return pi.REPETITION_MANDATORY;if(t instanceof jo||t==="RepetitionMandatoryWithSeparator")return pi.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof ko||t==="RepetitionWithSeparator")return pi.REPETITION_WITH_SEPARATOR;if(t instanceof So||t==="Alternation")return pi.ALTERNATION;throw Error("non exhaustive match")}A(n7,"getProdType");function P9(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=n7(n);return a===pi.ALTERNATION?WS(e,r,i):HS(e,r,a,i)}A(P9,"getLookaheadPaths");function Wke(t,e,r,n,i,a){const s=WS(t,e,r),o=iq(s)?bk:Gx;return a(s,n,o,i)}A(Wke,"buildLookaheadFuncForOr");function Hke(t,e,r,n,i,a){const s=HS(t,e,i,r),o=iq(s)?bk:Gx;return a(s[0],o,n)}A(Hke,"buildLookaheadFuncForOptionalProd");function qke(t,e,r,n){const i=t.length,a=ic(t,s=>ic(s,o=>o.length===1));if(e)return function(s){const o=ir(s,l=>l.GATE);for(let l=0;lnc(l)),o=Ho(s,(l,u,h)=>(kr(u,d=>{mr(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),kr(d.categoryMatches,f=>{mr(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;sa.length===1),i=t.length;if(n&&!r){const a=nc(t);if(a.length===1&&Vn(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=Ho(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,kr(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;at6([s],1)),n=B9(r.length),i=ir(r,s=>{const o={};return kr(s,l=>{const u=D3(l.partialPath);kr(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=B9(o.length);for(let l=0;l{const v=D3(y.partialPath);kr(v,T=>{i[l][T]=!0})})}}}}return n}A(nq,"lookAheadSequenceFromAlternatives");function WS(t,e,r,n){const i=new Yke(t,pi.ALTERNATION,n);return e.accept(i),nq(i.result,r)}A(WS,"getLookaheadPathsForOr");function HS(t,e,r,n){const i=new Yke(t,r);e.accept(i);const a=i.result,o=new qwt(e,t,r).startWalking(),l=new Co({definition:a}),u=new Co({definition:o});return nq([l,u],n)}A(HS,"getLookaheadPathsForOptionalProd");function r6(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}A(jke,"isStrictPrefixOfPath");function iq(t){return ic(t,e=>ic(e,r=>ic(r,n=>Vn(n.categoryMatches))))}A(iq,"areTokenCategoriesNotUsed");function Kke(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return ir(e,r=>Object.assign({type:js.CUSTOM_LOOKAHEAD_VALIDATION},r))}A(Kke,"validateLookahead");function Zke(t,e,r,n){const i=vl(t,l=>Qke(l,r)),a=lSe(t,e,r),s=vl(t,l=>iSe(l,r)),o=vl(t,l=>eSe(l,t,n,r));return i.concat(a,s,o)}A(Zke,"validateGrammar");function Qke(t,e){const r=new Uwt;t.accept(r);const n=r.allProductions,i=swt(n,Jke),a=fc(i,o=>o.length>1);return ir(na(a),o=>{const l=uc(o),u=e.buildDuplicateFoundError(t,o),h=Gl(l),d={message:u,type:js.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=aq(l);return f&&(d.parameter=f),d})}A(Qke,"validateDuplicateProductions");function Jke(t){return`${Gl(t)}_#_${t.idx}_#_${aq(t)}`}A(Jke,"identifyProductionForDuplicates");function aq(t){return t instanceof Jn?t.terminalType.name:t instanceof Xs?t.nonTerminalName:""}A(aq,"getExtraProductionArgument");var R1,Uwt=(R1=class extends zx{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)}},A(R1,"OccurrenceValidationCollector"),R1);function eSe(t,e,r,n){const i=[];if(Ho(e,(s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:js.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}A(eSe,"validateRuleDoesNotAlreadyExist");function tSe(t,e,r){const n=[];let i;return to(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:js.INVALID_RULE_OVERRIDE,ruleName:t})),n}A(tSe,"validateRuleIsOverridden");function sq(t,e,r,n=[]){const i=[],a=sC(e.definition);if(Vn(a))return[];{const s=t.name;to(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:js.LEFT_RECURSION,ruleName:s});const l=QL(a,n.concat([t])),u=vl(l,h=>{const d=es(n);return d.push(h),sq(t,h,r,d)});return i.concat(u)}}A(sq,"validateNoLeftRecursion");function sC(t){let e=[];if(Vn(t))return e;const r=uc(t);if(r instanceof Xs)e.push(r.referencedRule);else if(r instanceof Co||r instanceof Qa||r instanceof Xo||r instanceof jo||r instanceof ko||r instanceof ki)e=e.concat(sC(r.definition));else if(r instanceof So)e=nc(ir(r.definition,a=>sC(a.definition)));else if(!(r instanceof Jn))throw Error("non exhaustive match");const n=vk(r),i=t.length>1;if(n&&i){const a=Ga(t);return e.concat(sC(a))}else return e}A(sC,"getFirstNoneTerminal");var L1,oq=(L1=class extends zx{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},A(L1,"OrCollector"),L1);function rSe(t,e){const r=new oq;t.accept(r);const n=r.alternations;return vl(n,a=>{const s=yk(a.definition);return vl(s,(o,l)=>{const u=rq([o],[],Gx,1);return Vn(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:js.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}A(rSe,"validateEmptyOrAlternative");function nSe(t,e,r){const n=new oq;t.accept(n);let i=n.alternations;return i=JL(i,s=>s.ignoreAmbiguities===!0),vl(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=WS(o,t,l,s),h=sSe(u,s,t,r),d=oSe(u,s,t,r);return h.concat(d)})}A(nSe,"validateAmbiguousAlternationAlternatives");var M1,Ywt=(M1=class extends zx{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)}},A(M1,"RepetitionCollector"),M1);function iSe(t,e){const r=new oq;t.accept(r);const n=r.alternations;return vl(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:js.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}A(iSe,"validateTooManyAlts");function aSe(t,e,r){const n=[];return kr(t,i=>{const a=new Ywt;i.accept(a);const s=a.allProductions;kr(s,o=>{const l=n7(o),u=o.maxLookahead||e,h=o.idx,f=HS(h,i,l,u)[0];if(Vn(nc(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:js.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}A(aSe,"validateSomeNonEmptyLookaheadPath");function sSe(t,e,r,n){const i=[],a=Ho(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||kr(l,h=>{const d=[u];kr(t,(f,p)=>{u!==p&&r6(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!r6(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return ir(a,o=>{const l=ir(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:js.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}A(sSe,"checkAlternativesAmbiguities");function oSe(t,e,r,n){const i=Ho(t,(s,o,l)=>{const u=ir(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return zS(vl(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=El(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:js.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}A(oSe,"checkPrefixAlternativesAmbiguities");function lSe(t,e,r){const n=[],i=ir(e,a=>a.name);return kr(t,a=>{const s=a.name;if(to(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:js.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}A(lSe,"checkTerminalAndNoneTerminalsNameSpace");function cSe(t){const e=HH(t,{errMsgProvider:Fwt}),r={};return kr(t.rules,n=>{r[n.name]=n}),Vke(r,e.errMsgProvider)}A(cSe,"resolveGrammar");function uSe(t){return t=HH(t,{errMsgProvider:t0}),Zke(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}A(uSe,"validateGrammar");var hSe="MismatchedTokenException",dSe="NoViableAltException",fSe="EarlyExitException",pSe="NotAllInputParsedException",gSe=[hSe,dSe,fSe,pSe];Object.freeze(gSe);function xk(t){return to(gSe,t.name)}A(xk,"isRecognitionException");var I1,i7=(I1=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},A(I1,"RecognitionException"),I1),N1,mSe=(N1=class extends i7{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=hSe}},A(N1,"MismatchedTokenException"),N1),D1,Xwt=(D1=class extends i7{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=dSe}},A(D1,"NoViableAltException"),D1),O1,jwt=(O1=class extends i7{constructor(e,r){super(e,r),this.name=pSe}},A(O1,"NotAllInputParsedException"),O1),$1,Kwt=($1=class extends i7{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=fSe}},A($1,"EarlyExitException"),$1),dN={},ySe="InRuleRecoveryException",P1,Zwt=(P1=class extends Error{constructor(e){super(e),this.name=ySe}},A(P1,"InRuleRecoveryException"),P1),B1,Qwt=(B1=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=mr(e,"recoveryEnabled")?e.recoveryEnabled:Lh.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=vSe)}getTokenToInsert(e){const r=GS(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){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=A(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new mSe(p,u,this.LA(0));g.resyncedTokens=yk(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,a)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));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){const 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)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Zwt("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Vn(r))return!1;const n=this.LA(1);return rx(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return to(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=rx(e,a=>tq(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return dN;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return ir(e,(n,i)=>i===0?dN:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=ir(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return nc(e)}getFollowSetFromFollowKey(e){if(e===dN)return[mf];const r=e.ruleName+e.idxInCallingRule+nke+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,mf)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return yk(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=es(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return ir(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},A(B1,"Recoverable"),B1);function vSe(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=mf,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}A(vSe,"attemptInRepetitionRecovery");var Jwt=4,Pf=8,bSe=1<sq(r,r,t0))}validateEmptyOrAlternatives(e){return vl(e,r=>rSe(r,t0))}validateAmbiguousAlternationAlternatives(e,r){return vl(e,n=>nSe(n,r,t0))}validateSomeNonEmptyLookaheadPath(e,r){return aSe(e,r,t0)}buildLookaheadForAlternation(e){return Wke(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,qke)}buildLookaheadForOptional(e){return Hke(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,n7(e.prodType),Uke)}},A(F1,"LLkLookaheadStrategy"),F1),z1,eCt=(z1=class{initLooksAhead(e){this.dynamicTokensEnabled=mr(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Lh.dynamicTokensEnabled,this.maxLookahead=mr(e,"maxLookahead")?e.maxLookahead:Lh.maxLookahead,this.lookaheadStrategy=mr(e,"lookaheadStrategy")?e.lookaheadStrategy:new lq({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){kr(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=TSe(r);kr(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${Gl(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=$3(this.fullRuleNameToShort[r.name],bSe,u.idx);this.setLaFuncCache(f,d)})}),kr(i,u=>{this.computeLookaheadFunc(r,u.idx,F9,"Repetition",u.maxLookahead,Gl(u))}),kr(a,u=>{this.computeLookaheadFunc(r,u.idx,xSe,"Option",u.maxLookahead,Gl(u))}),kr(s,u=>{this.computeLookaheadFunc(r,u.idx,z9,"RepetitionMandatory",u.maxLookahead,Gl(u))}),kr(o,u=>{this.computeLookaheadFunc(r,u.idx,O3,"RepetitionMandatoryWithSeparator",u.maxLookahead,Gl(u))}),kr(l,u=>{this.computeLookaheadFunc(r,u.idx,V9,"RepetitionWithSeparator",u.maxLookahead,Gl(u))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=$3(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return $3(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},A(z1,"LooksAhead"),z1),V1,tCt=(V1=class extends zx{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)}},A(V1,"DslMethodsCollectorVisitor"),V1),l4=new tCt;function TSe(t){l4.reset(),t.accept(l4);const e=l4.dslMethods;return l4.reset(),e}A(TSe,"collectMethods");function G9(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffsets.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Fx?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function Gke(t,e){const r=new Wwt(t,e);return r.resolveRefs(),r.errors}A(Gke,"resolveGrammar");var b1,Wwt=(b1=class extends zx{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){kr(na(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:js.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},A(b1,"GastRefResolverVisitor"),b1),x1,Hwt=(x1=class extends e7{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=es(this.path.ruleStack).reverse(),this.occurrenceStack=es(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){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Gn(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},A(x1,"AbstractNextPossibleTokensWalker"),x1),T1,qwt=(T1=class extends Hwt{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){const i=r.concat(n),a=new Co({definition:i});this.possibleTokTypes=Vx(a),this.found=!0}}},A(T1,"NextAfterTokenWalker"),T1),w1,r7=(w1=class extends e7{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}},A(w1,"AbstractNextTerminalAfterProductionWalker"),w1),C1,Uwt=(C1=class extends r7{walkMany(e,r,n){if(e.idx===this.occurrence){const i=uc(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Jn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},A(C1,"NextTerminalAfterManyWalker"),C1),k1,wre=(k1=class extends r7{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=uc(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Jn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},A(k1,"NextTerminalAfterManySepWalker"),k1),S1,Ywt=(S1=class extends r7{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=uc(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Jn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},A(S1,"NextTerminalAfterAtLeastOneWalker"),S1),E1,Cre=(E1=class extends r7{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=uc(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Jn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},A(E1,"NextTerminalAfterAtLeastOneSepWalker"),E1);function t6(t,e,r=[]){r=es(r);let n=[],i=0;function a(o){return o.concat(Ga(t,i+1))}A(a,"remainingPathWith");function s(o){const l=t6(a(o),e,r);return n.concat(l)}for(A(s,"getAlternativesForProd");r.length{Gn(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof Jn)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Ga(t,i)}),n}A(t6,"possiblePathsFrom");function rq(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Gn(d);){const f=d.pop();if(f===s){o&&U0(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(Gn(p))continue;const v=p[0];if(v===i){const T={idx:g,def:Ga(p),ruleStack:yk(m),occurrenceStack:yk(y)};d.push(T)}else if(v instanceof Jn)if(g=0;T--){const b=v.definition[T],w={idx:g,def:b.definition.concat(Ga(p)),ruleStack:m,occurrenceStack:y};d.push(w),d.push(s)}else if(v instanceof Co)d.push({idx:g,def:v.definition.concat(Ga(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof Fx)d.push(Wke(v,g,m,y));else throw Error("non exhaustive match")}return h}A(rq,"nextPossibleTokensAfter");function Wke(t,e,r,n){const i=es(r);i.push(t.name);const a=es(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}A(Wke,"expandTopLevelRule");var pi;(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"})(pi||(pi={}));function n7(t){if(t instanceof Qa||t==="Option")return pi.OPTION;if(t instanceof ki||t==="Repetition")return pi.REPETITION;if(t instanceof Xo||t==="RepetitionMandatory")return pi.REPETITION_MANDATORY;if(t instanceof jo||t==="RepetitionMandatoryWithSeparator")return pi.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof ko||t==="RepetitionWithSeparator")return pi.REPETITION_WITH_SEPARATOR;if(t instanceof So||t==="Alternation")return pi.ALTERNATION;throw Error("non exhaustive match")}A(n7,"getProdType");function P9(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=n7(n);return a===pi.ALTERNATION?WS(e,r,i):HS(e,r,a,i)}A(P9,"getLookaheadPaths");function Hke(t,e,r,n,i,a){const s=WS(t,e,r),o=iq(s)?bk:Gx;return a(s,n,o,i)}A(Hke,"buildLookaheadFuncForOr");function qke(t,e,r,n,i,a){const s=HS(t,e,i,r),o=iq(s)?bk:Gx;return a(s[0],o,n)}A(qke,"buildLookaheadFuncForOptionalProd");function Uke(t,e,r,n){const i=t.length,a=ic(t,s=>ic(s,o=>o.length===1));if(e)return function(s){const o=ir(s,l=>l.GATE);for(let l=0;lnc(l)),o=Ho(s,(l,u,h)=>(kr(u,d=>{mr(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),kr(d.categoryMatches,f=>{mr(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;sa.length===1),i=t.length;if(n&&!r){const a=nc(t);if(a.length===1&&Gn(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=Ho(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,kr(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;at6([s],1)),n=B9(r.length),i=ir(r,s=>{const o={};return kr(s,l=>{const u=D3(l.partialPath);kr(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=B9(o.length);for(let l=0;l{const v=D3(y.partialPath);kr(v,T=>{i[l][T]=!0})})}}}}return n}A(nq,"lookAheadSequenceFromAlternatives");function WS(t,e,r,n){const i=new Xke(t,pi.ALTERNATION,n);return e.accept(i),nq(i.result,r)}A(WS,"getLookaheadPathsForOr");function HS(t,e,r,n){const i=new Xke(t,r);e.accept(i);const a=i.result,o=new Xwt(e,t,r).startWalking(),l=new Co({definition:a}),u=new Co({definition:o});return nq([l,u],n)}A(HS,"getLookaheadPathsForOptionalProd");function r6(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}A(Kke,"isStrictPrefixOfPath");function iq(t){return ic(t,e=>ic(e,r=>ic(r,n=>Gn(n.categoryMatches))))}A(iq,"areTokenCategoriesNotUsed");function Zke(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return ir(e,r=>Object.assign({type:js.CUSTOM_LOOKAHEAD_VALIDATION},r))}A(Zke,"validateLookahead");function Qke(t,e,r,n){const i=vl(t,l=>Jke(l,r)),a=cSe(t,e,r),s=vl(t,l=>aSe(l,r)),o=vl(t,l=>tSe(l,t,n,r));return i.concat(a,s,o)}A(Qke,"validateGrammar");function Jke(t,e){const r=new jwt;t.accept(r);const n=r.allProductions,i=cwt(n,eSe),a=fc(i,o=>o.length>1);return ir(na(a),o=>{const l=uc(o),u=e.buildDuplicateFoundError(t,o),h=Gl(l),d={message:u,type:js.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=aq(l);return f&&(d.parameter=f),d})}A(Jke,"validateDuplicateProductions");function eSe(t){return`${Gl(t)}_#_${t.idx}_#_${aq(t)}`}A(eSe,"identifyProductionForDuplicates");function aq(t){return t instanceof Jn?t.terminalType.name:t instanceof Xs?t.nonTerminalName:""}A(aq,"getExtraProductionArgument");var R1,jwt=(R1=class extends zx{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)}},A(R1,"OccurrenceValidationCollector"),R1);function tSe(t,e,r,n){const i=[];if(Ho(e,(s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:js.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}A(tSe,"validateRuleDoesNotAlreadyExist");function rSe(t,e,r){const n=[];let i;return to(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:js.INVALID_RULE_OVERRIDE,ruleName:t})),n}A(rSe,"validateRuleIsOverridden");function sq(t,e,r,n=[]){const i=[],a=sC(e.definition);if(Gn(a))return[];{const s=t.name;to(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:js.LEFT_RECURSION,ruleName:s});const l=QL(a,n.concat([t])),u=vl(l,h=>{const d=es(n);return d.push(h),sq(t,h,r,d)});return i.concat(u)}}A(sq,"validateNoLeftRecursion");function sC(t){let e=[];if(Gn(t))return e;const r=uc(t);if(r instanceof Xs)e.push(r.referencedRule);else if(r instanceof Co||r instanceof Qa||r instanceof Xo||r instanceof jo||r instanceof ko||r instanceof ki)e=e.concat(sC(r.definition));else if(r instanceof So)e=nc(ir(r.definition,a=>sC(a.definition)));else if(!(r instanceof Jn))throw Error("non exhaustive match");const n=vk(r),i=t.length>1;if(n&&i){const a=Ga(t);return e.concat(sC(a))}else return e}A(sC,"getFirstNoneTerminal");var L1,oq=(L1=class extends zx{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},A(L1,"OrCollector"),L1);function nSe(t,e){const r=new oq;t.accept(r);const n=r.alternations;return vl(n,a=>{const s=yk(a.definition);return vl(s,(o,l)=>{const u=rq([o],[],Gx,1);return Gn(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:js.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}A(nSe,"validateEmptyOrAlternative");function iSe(t,e,r){const n=new oq;t.accept(n);let i=n.alternations;return i=JL(i,s=>s.ignoreAmbiguities===!0),vl(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=WS(o,t,l,s),h=oSe(u,s,t,r),d=lSe(u,s,t,r);return h.concat(d)})}A(iSe,"validateAmbiguousAlternationAlternatives");var M1,Kwt=(M1=class extends zx{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)}},A(M1,"RepetitionCollector"),M1);function aSe(t,e){const r=new oq;t.accept(r);const n=r.alternations;return vl(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:js.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}A(aSe,"validateTooManyAlts");function sSe(t,e,r){const n=[];return kr(t,i=>{const a=new Kwt;i.accept(a);const s=a.allProductions;kr(s,o=>{const l=n7(o),u=o.maxLookahead||e,h=o.idx,f=HS(h,i,l,u)[0];if(Gn(nc(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:js.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}A(sSe,"validateSomeNonEmptyLookaheadPath");function oSe(t,e,r,n){const i=[],a=Ho(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||kr(l,h=>{const d=[u];kr(t,(f,p)=>{u!==p&&r6(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!r6(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return ir(a,o=>{const l=ir(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:js.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}A(oSe,"checkAlternativesAmbiguities");function lSe(t,e,r,n){const i=Ho(t,(s,o,l)=>{const u=ir(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return zS(vl(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=El(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:js.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}A(lSe,"checkPrefixAlternativesAmbiguities");function cSe(t,e,r){const n=[],i=ir(e,a=>a.name);return kr(t,a=>{const s=a.name;if(to(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:js.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}A(cSe,"checkTerminalAndNoneTerminalsNameSpace");function uSe(t){const e=HH(t,{errMsgProvider:Gwt}),r={};return kr(t.rules,n=>{r[n.name]=n}),Gke(r,e.errMsgProvider)}A(uSe,"resolveGrammar");function hSe(t){return t=HH(t,{errMsgProvider:t0}),Qke(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}A(hSe,"validateGrammar");var dSe="MismatchedTokenException",fSe="NoViableAltException",pSe="EarlyExitException",gSe="NotAllInputParsedException",mSe=[dSe,fSe,pSe,gSe];Object.freeze(mSe);function xk(t){return to(mSe,t.name)}A(xk,"isRecognitionException");var I1,i7=(I1=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},A(I1,"RecognitionException"),I1),N1,ySe=(N1=class extends i7{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=dSe}},A(N1,"MismatchedTokenException"),N1),D1,Zwt=(D1=class extends i7{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=fSe}},A(D1,"NoViableAltException"),D1),O1,Qwt=(O1=class extends i7{constructor(e,r){super(e,r),this.name=gSe}},A(O1,"NotAllInputParsedException"),O1),$1,Jwt=($1=class extends i7{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=pSe}},A($1,"EarlyExitException"),$1),dN={},vSe="InRuleRecoveryException",P1,eCt=(P1=class extends Error{constructor(e){super(e),this.name=vSe}},A(P1,"InRuleRecoveryException"),P1),B1,tCt=(B1=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=mr(e,"recoveryEnabled")?e.recoveryEnabled:Lh.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=bSe)}getTokenToInsert(e){const r=GS(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){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=A(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new ySe(p,u,this.LA(0));g.resyncedTokens=yk(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,a)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));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){const 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)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new eCt("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Gn(r))return!1;const n=this.LA(1);return rx(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return to(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=rx(e,a=>tq(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return dN;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return ir(e,(n,i)=>i===0?dN:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=ir(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return nc(e)}getFollowSetFromFollowKey(e){if(e===dN)return[mf];const r=e.ruleName+e.idxInCallingRule+ike+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,mf)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return yk(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=es(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return ir(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},A(B1,"Recoverable"),B1);function bSe(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=mf,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}A(bSe,"attemptInRepetitionRecovery");var rCt=4,Pf=8,xSe=1<sq(r,r,t0))}validateEmptyOrAlternatives(e){return vl(e,r=>nSe(r,t0))}validateAmbiguousAlternationAlternatives(e,r){return vl(e,n=>iSe(n,r,t0))}validateSomeNonEmptyLookaheadPath(e,r){return sSe(e,r,t0)}buildLookaheadForAlternation(e){return Hke(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Uke)}buildLookaheadForOptional(e){return qke(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,n7(e.prodType),Yke)}},A(F1,"LLkLookaheadStrategy"),F1),z1,nCt=(z1=class{initLooksAhead(e){this.dynamicTokensEnabled=mr(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Lh.dynamicTokensEnabled,this.maxLookahead=mr(e,"maxLookahead")?e.maxLookahead:Lh.maxLookahead,this.lookaheadStrategy=mr(e,"lookaheadStrategy")?e.lookaheadStrategy:new lq({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){kr(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=wSe(r);kr(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${Gl(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=$3(this.fullRuleNameToShort[r.name],xSe,u.idx);this.setLaFuncCache(f,d)})}),kr(i,u=>{this.computeLookaheadFunc(r,u.idx,F9,"Repetition",u.maxLookahead,Gl(u))}),kr(a,u=>{this.computeLookaheadFunc(r,u.idx,TSe,"Option",u.maxLookahead,Gl(u))}),kr(s,u=>{this.computeLookaheadFunc(r,u.idx,z9,"RepetitionMandatory",u.maxLookahead,Gl(u))}),kr(o,u=>{this.computeLookaheadFunc(r,u.idx,O3,"RepetitionMandatoryWithSeparator",u.maxLookahead,Gl(u))}),kr(l,u=>{this.computeLookaheadFunc(r,u.idx,V9,"RepetitionWithSeparator",u.maxLookahead,Gl(u))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=$3(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return $3(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},A(z1,"LooksAhead"),z1),V1,iCt=(V1=class extends zx{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)}},A(V1,"DslMethodsCollectorVisitor"),V1),l4=new iCt;function wSe(t){l4.reset(),t.accept(l4);const e=l4.dslMethods;return l4.reset(),e}A(wSe,"collectMethods");function G9(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffsets.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: ${a.join(` `).replace(/\n/g,` - `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}A(SSe,"createBaseSemanticVisitorConstructor");function ESe(t,e,r){const n=A(function(){},"derivedConstructor");cq(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return kr(e,a=>{i[a]=kSe}),n.prototype=i,n.prototype.constructor=n,n}A(ESe,"createBaseVisitorConstructorWithDefaults");var H9;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(H9||(H9={}));function ASe(t,e){return _Se(t,e)}A(ASe,"validateVisitor");function _Se(t,e){const r=El(e,i=>Yh(t[i])===!1),n=ir(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:H9.MISSING_METHOD,methodName:i}));return zS(n)}A(_Se,"validateMissingCstMethods");var G1,nCt=(G1=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=mr(e,"nodeLocationTracking")?e.nodeLocationTracking:Lh.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ga,this.cstFinallyStateUpdate=ga,this.cstPostTerminal=ga,this.cstPostNonTerminal=ga,this.cstPostRule=ga;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=W9,this.setNodeLocationFromNode=W9,this.cstPostRule=ga,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ga,this.setNodeLocationFromNode=ga,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=G9,this.setNodeLocationFromNode=G9,this.cstPostRule=ga,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ga,this.setNodeLocationFromNode=ga,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ga,this.setNodeLocationFromNode=ga,this.cstPostRule=ga,this.setInitialNodeLocation=ga;else throw Error(`Invalid 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){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const 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){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];wSe(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];CSe(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(_h(this.baseCstVisitorConstructor)){const e=SSe(this.className,Go(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(_h(this.baseCstVisitorWithDefaultsConstructor)){const e=ESe(this.className,Go(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},A(G1,"TreeBuilder"),G1),W1,iCt=(W1=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing 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)):n6}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?n6: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()}},A(W1,"LexerAdapter"),W1),H1,aCt=(H1=class{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=i6){if(to(this.definedRulesNames,e)){const s={message:t0.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:js.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=i6){const i=tSe(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(xk(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return ZCe(na(this.gastProductionsCache))}},A(H1,"RecognizerApi"),H1),q1,sCt=(q1=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=bk,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},mr(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. + `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}A(ESe,"createBaseSemanticVisitorConstructor");function ASe(t,e,r){const n=A(function(){},"derivedConstructor");cq(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return kr(e,a=>{i[a]=SSe}),n.prototype=i,n.prototype.constructor=n,n}A(ASe,"createBaseVisitorConstructorWithDefaults");var H9;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(H9||(H9={}));function _Se(t,e){return RSe(t,e)}A(_Se,"validateVisitor");function RSe(t,e){const r=El(e,i=>Yh(t[i])===!1),n=ir(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:H9.MISSING_METHOD,methodName:i}));return zS(n)}A(RSe,"validateMissingCstMethods");var G1,sCt=(G1=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=mr(e,"nodeLocationTracking")?e.nodeLocationTracking:Lh.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ma,this.cstFinallyStateUpdate=ma,this.cstPostTerminal=ma,this.cstPostNonTerminal=ma,this.cstPostRule=ma;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=W9,this.setNodeLocationFromNode=W9,this.cstPostRule=ma,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ma,this.setNodeLocationFromNode=ma,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=G9,this.setNodeLocationFromNode=G9,this.cstPostRule=ma,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ma,this.setNodeLocationFromNode=ma,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ma,this.setNodeLocationFromNode=ma,this.cstPostRule=ma,this.setInitialNodeLocation=ma;else throw Error(`Invalid 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){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const 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){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];CSe(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];kSe(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(_h(this.baseCstVisitorConstructor)){const e=ESe(this.className,Go(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(_h(this.baseCstVisitorWithDefaultsConstructor)){const e=ASe(this.className,Go(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},A(G1,"TreeBuilder"),G1),W1,oCt=(W1=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing 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)):n6}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?n6: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()}},A(W1,"LexerAdapter"),W1),H1,lCt=(H1=class{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=i6){if(to(this.definedRulesNames,e)){const s={message:t0.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:js.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=i6){const i=rSe(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(xk(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return QCe(na(this.gastProductionsCache))}},A(H1,"RecognizerApi"),H1),q1,cCt=(q1=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=bk,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},mr(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 - For Further details.`);if(cn(e)){if(Vn(e))throw Error(`A Token Vocabulary cannot be empty. + For Further details.`);if(cn(e)){if(Gn(e))throw Error(`A Token Vocabulary cannot be empty. Note that the first argument for the parser constructor is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 - For Further details.`)}if(cn(e))this.tokensMap=Ho(e,(a,s)=>(a[s.name]=s,a),{});else if(mr(e,"modes")&&ic(nc(na(e.modes)),Fke)){const a=nc(na(e.modes)),s=qH(a);this.tokensMap=Ho(s,(o,l)=>(o[l.name]=l,o),{})}else if(kl(e))this.tokensMap=es(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=mf;const n=mr(e,"modes")?nc(na(e.modes)):na(e),i=ic(n,a=>Vn(a.categoryMatches));this.tokenMatcher=i?bk:Gx,Wx(na(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' -Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=mr(n,"resyncEnabled")?n.resyncEnabled:i6.resyncEnabled,a=mr(n,"recoveryValueFunc")?n.recoveryValueFunc:i6.recoveryValueFunc,s=this.ruleShortNameIdx<s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(z9,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=A(()=>s.call(this)&&o.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,pi.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,z9,e,Hwt)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(O3,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=A(()=>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,o,i,wre],o,O3,e,wre)}else throw this.raiseEarlyExitException(e,pi.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(F9,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=A(()=>o.call(this)&&l.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,F9,e,Wwt,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(V9,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=A(()=>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,o,i,Tre],o,V9,e,Tre)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,O3,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(bSe,r),i=cn(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){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new jwt(r,e))}}subruleInternal(e,r,n){let i;try{const 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 xk(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{const 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;const 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 mSe(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===ySe?n:a}}else throw n}saveRecogState(){const e=this.errors,r=es(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(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),mf)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},A(q1,"RecognizerEngine"),q1),U1,oCt=(U1=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=mr(e,"errorMessageProvider")?e.errorMessageProvider:Lh.errorMessageProvider}SAVE_ERROR(e){if(xk(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:es(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return es(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=HS(e,a,r,this.maxLookahead)[0],l=[];for(let h=1;h<=this.maxLookahead;h++)l.push(this.LA(h));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Kwt(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=WS(e,i,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Xwt(l,this.LA(1),o))}},A(U1,"ErrorHandler"),U1),Y1,lCt=(Y1=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(_h(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return rq([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=uc(e.ruleStack),i=this.getGAstProductions()[r];return new Gwt(i,e).startWalking()}},A(Y1,"ContentAssist"),Y1),a7={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(a7);var Cre=!0,kre=Math.pow(2,Pf)-1,RSe=Sy({name:"RECORDING_PHASE_TOKEN",pattern:Gs.NA});Wx([RSe]);var LSe=GS(RSe,`This IToken indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(LSe);var cCt={name:`This CSTNode indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},X1,uCt=(X1=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return n6}topLevelRuleRecord(e,r){try{const n=new Fx({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` + For Further details.`)}if(cn(e))this.tokensMap=Ho(e,(a,s)=>(a[s.name]=s,a),{});else if(mr(e,"modes")&&ic(nc(na(e.modes)),zke)){const a=nc(na(e.modes)),s=qH(a);this.tokensMap=Ho(s,(o,l)=>(o[l.name]=l,o),{})}else if(kl(e))this.tokensMap=es(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=mf;const n=mr(e,"modes")?nc(na(e.modes)):na(e),i=ic(n,a=>Gn(a.categoryMatches));this.tokenMatcher=i?bk:Gx,Wx(na(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' +Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=mr(n,"resyncEnabled")?n.resyncEnabled:i6.resyncEnabled,a=mr(n,"recoveryValueFunc")?n.recoveryValueFunc:i6.recoveryValueFunc,s=this.ruleShortNameIdx<s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(z9,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=A(()=>s.call(this)&&o.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,pi.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,z9,e,Ywt)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(O3,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=A(()=>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,o,i,Cre],o,O3,e,Cre)}else throw this.raiseEarlyExitException(e,pi.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(F9,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=A(()=>o.call(this)&&l.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,F9,e,Uwt,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(V9,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=A(()=>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,o,i,wre],o,V9,e,wre)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,O3,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(xSe,r),i=cn(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){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Qwt(r,e))}}subruleInternal(e,r,n){let i;try{const 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 xk(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{const 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;const 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 ySe(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===vSe?n:a}}else throw n}saveRecogState(){const e=this.errors,r=es(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(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),mf)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},A(q1,"RecognizerEngine"),q1),U1,uCt=(U1=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=mr(e,"errorMessageProvider")?e.errorMessageProvider:Lh.errorMessageProvider}SAVE_ERROR(e){if(xk(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:es(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return es(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=HS(e,a,r,this.maxLookahead)[0],l=[];for(let h=1;h<=this.maxLookahead;h++)l.push(this.LA(h));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Jwt(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=WS(e,i,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Zwt(l,this.LA(1),o))}},A(U1,"ErrorHandler"),U1),Y1,hCt=(Y1=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(_h(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return rq([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=uc(e.ruleStack),i=this.getGAstProductions()[r];return new qwt(i,e).startWalking()}},A(Y1,"ContentAssist"),Y1),a7={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(a7);var kre=!0,Sre=Math.pow(2,Pf)-1,LSe=Sy({name:"RECORDING_PHASE_TOKEN",pattern:Gs.NA});Wx([LSe]);var MSe=GS(LSe,`This IToken indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(MSe);var dCt={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},X1,fCt=(X1=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return n6}topLevelRuleRecord(e,r){try{const n=new Fx({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` This error was thrown during the "grammar recording phase" For more info see: - https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Am.call(this,Qa,e,r)}atLeastOneInternalRecord(e,r){Am.call(this,Xo,r,e)}atLeastOneSepFirstInternalRecord(e,r){Am.call(this,jo,r,e,Cre)}manyInternalRecord(e,r){Am.call(this,ki,r,e)}manySepFirstInternalRecord(e,r){Am.call(this,ko,r,e,Cre)}orInternalRecord(e,r){return MSe.call(this,e,r)}subruleInternalRecord(e,r,n){if(Tk(r),!e||mr(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=U0(this.recordingProdStack),a=e.ruleName,s=new Xs({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?cCt:a7}consumeInternalRecord(e,r,n){if(Tk(r),!JH(e)){const s=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=U0(this.recordingProdStack),a=new Jn({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),LSe}},A(X1,"GastRecorder"),X1);function Am(t,e,r,n=!1){Tk(r);const i=U0(this.recordingProdStack),a=Yh(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),mr(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),a7}A(Am,"recordProd");function MSe(t,e){Tk(e);const r=U0(this.recordingProdStack),n=cn(t)===!1,i=n===!1?t:t.DEF,a=new So({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});mr(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=UCe(i,o=>Yh(o.GATE));return a.hasPredicates=s,r.definition.push(a),kr(i,o=>{const l=new Co({definition:[]});a.definition.push(l),mr(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:mr(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),a7}A(MSe,"recordOrProd");function q9(t){return t===0?"":`${t}`}A(q9,"getIdxSuffix");function Tk(t){if(t<0||t>kre){const e=new Error(`Invalid DSL Method idx value: <${t}> - Idx value must be a none negative value smaller than ${kre+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}A(Tk,"assertMethodIdxIsValid");var j1,hCt=(j1=class{initPerformanceTracer(e){if(mr(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=Lh.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:i,value:a}=YH(r),s=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,a}else return r()}},A(j1,"PerformanceTracer"),j1);function ISe(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}A(ISe,"applyMixins");var n6=GS(mf,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(n6);var Lh=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:iy,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),i6=Object.freeze({recoveryValueFunc:A(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),js;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(js||(js={}));function U9(t=void 0){return function(){return t}}A(U9,"EMPTY_ALT");var m0,uq=(m0=class{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{XH(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),kr(this.definedRulesNames,i=>{const s=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=cSe({rules:na(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Vn(n)&&this.skipValidations===!1){const i=uSe({rules:na(this.gastProductionsCache),tokenTypes:na(this.tokensMap),errMsgProvider:t0,grammarName:r}),a=Kke({lookaheadStrategy:this.lookaheadStrategy,rules:na(this.gastProductionsCache),tokenTypes:na(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),Vn(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=ike(na(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:na(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(na(this.gastProductionsCache))})),!m0.DEFER_DEFINITION_ERRORS_HANDLING&&!Vn(this.definitionErrors))throw e=ir(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: + https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Am.call(this,Qa,e,r)}atLeastOneInternalRecord(e,r){Am.call(this,Xo,r,e)}atLeastOneSepFirstInternalRecord(e,r){Am.call(this,jo,r,e,kre)}manyInternalRecord(e,r){Am.call(this,ki,r,e)}manySepFirstInternalRecord(e,r){Am.call(this,ko,r,e,kre)}orInternalRecord(e,r){return ISe.call(this,e,r)}subruleInternalRecord(e,r,n){if(Tk(r),!e||mr(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=U0(this.recordingProdStack),a=e.ruleName,s=new Xs({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?dCt:a7}consumeInternalRecord(e,r,n){if(Tk(r),!JH(e)){const s=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=U0(this.recordingProdStack),a=new Jn({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),MSe}},A(X1,"GastRecorder"),X1);function Am(t,e,r,n=!1){Tk(r);const i=U0(this.recordingProdStack),a=Yh(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),mr(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),a7}A(Am,"recordProd");function ISe(t,e){Tk(e);const r=U0(this.recordingProdStack),n=cn(t)===!1,i=n===!1?t:t.DEF,a=new So({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});mr(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=YCe(i,o=>Yh(o.GATE));return a.hasPredicates=s,r.definition.push(a),kr(i,o=>{const l=new Co({definition:[]});a.definition.push(l),mr(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:mr(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),a7}A(ISe,"recordOrProd");function q9(t){return t===0?"":`${t}`}A(q9,"getIdxSuffix");function Tk(t){if(t<0||t>Sre){const e=new Error(`Invalid DSL Method idx value: <${t}> + Idx value must be a none negative value smaller than ${Sre+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}A(Tk,"assertMethodIdxIsValid");var j1,pCt=(j1=class{initPerformanceTracer(e){if(mr(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=Lh.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:i,value:a}=YH(r),s=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,a}else return r()}},A(j1,"PerformanceTracer"),j1);function NSe(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}A(NSe,"applyMixins");var n6=GS(mf,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(n6);var Lh=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:iy,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),i6=Object.freeze({recoveryValueFunc:A(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),js;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(js||(js={}));function U9(t=void 0){return function(){return t}}A(U9,"EMPTY_ALT");var m0,uq=(m0=class{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{XH(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),kr(this.definedRulesNames,i=>{const s=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=uSe({rules:na(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Gn(n)&&this.skipValidations===!1){const i=hSe({rules:na(this.gastProductionsCache),tokenTypes:na(this.tokensMap),errMsgProvider:t0,grammarName:r}),a=Zke({lookaheadStrategy:this.lookaheadStrategy,rules:na(this.gastProductionsCache),tokenTypes:na(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),Gn(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=ake(na(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:na(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(na(this.gastProductionsCache))})),!m0.DEFER_DEFINITION_ERRORS_HANDLING&&!Gn(this.definitionErrors))throw e=ir(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: ${e.join(` ------------------------------- `)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),mr(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. Please use the flag on the relevant DSL method instead. See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES - For further details.`);this.skipValidations=mr(r,"skipValidations")?r.skipValidations:Lh.skipValidations}},A(m0,"Parser"),m0);uq.DEFER_DEFINITION_ERRORS_HANDLING=!1;ISe(uq,[Qwt,eCt,nCt,iCt,sCt,aCt,oCt,lCt,uCt,hCt]);var K1,dCt=(K1=class extends uq{constructor(e,r=Lh){const n=es(r);n.outputCst=!1,super(e,n)}},A(K1,"EmbeddedActionsParser"),K1);function NSe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}A(VSe,"listCacheHas");var vCt=VSe;function GSe(t,e){var r=this.__data__,n=s7(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}A(GSe,"listCacheSet");var bCt=GSe;function Mg(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Skt?new TEe:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=sSt}A(HEe,"isLength");var fq=HEe,oSt="[object Arguments]",lSt="[object Array]",cSt="[object Boolean]",uSt="[object Date]",hSt="[object Error]",dSt="[object Function]",fSt="[object Map]",pSt="[object Number]",gSt="[object Object]",mSt="[object RegExp]",ySt="[object Set]",vSt="[object String]",bSt="[object WeakMap]",xSt="[object ArrayBuffer]",TSt="[object DataView]",wSt="[object Float32Array]",CSt="[object Float64Array]",kSt="[object Int8Array]",SSt="[object Int16Array]",ESt="[object Int32Array]",ASt="[object Uint8Array]",_St="[object Uint8ClampedArray]",RSt="[object Uint16Array]",LSt="[object Uint32Array]",Kn={};Kn[wSt]=Kn[CSt]=Kn[kSt]=Kn[SSt]=Kn[ESt]=Kn[ASt]=Kn[_St]=Kn[RSt]=Kn[LSt]=!0;Kn[oSt]=Kn[lSt]=Kn[xSt]=Kn[cSt]=Kn[TSt]=Kn[uSt]=Kn[hSt]=Kn[dSt]=Kn[fSt]=Kn[pSt]=Kn[gSt]=Kn[mSt]=Kn[ySt]=Kn[vSt]=Kn[bSt]=!1;function qEe(t){return nx(t)&&fq(t.length)&&!!Kn[Hx(t)]}A(qEe,"baseIsTypedArray");var MSt=qEe;function UEe(t){return function(e){return t(e)}}A(UEe,"baseUnary");var ISt=UEe,YEe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,oC=YEe&&typeof module=="object"&&module&&!module.nodeType&&module,NSt=oC&&oC.exports===YEe,gN=NSt&&YSe.process,DSt=(function(){try{var t=oC&&oC.require&&oC.require("util").types;return t||gN&&gN.binding&&gN.binding("util")}catch{}})(),Dre=DSt,Ore=Dre&&Dre.isTypedArray,OSt=Ore?ISt(Ore):MSt,pq=OSt,$St=Object.prototype,PSt=$St.hasOwnProperty;function XEe(t,e){var r=Ks(t),n=!r&&u7(t),i=!r&&!n&&a6(t),a=!r&&!n&&!i&&pq(t),s=r||n||i||a,o=s?jkt(t.length,String):[],l=o.length;for(var u in t)(e||PSt.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||WEe(u,l)))&&o.push(u);return o}A(XEe,"arrayLikeKeys");var BSt=XEe,FSt=Object.prototype;function jEe(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||FSt;return t===r}A(jEe,"isPrototype");var KEe=jEe;function ZEe(t,e){return function(r){return t(e(r))}}A(ZEe,"overArg");var zSt=ZEe,VSt=zSt(Object.keys,Object),GSt=VSt,WSt=Object.prototype,HSt=WSt.hasOwnProperty;function QEe(t){if(!KEe(t))return GSt(t);var e=[];for(var r in Object(t))HSt.call(t,r)&&r!="constructor"&&e.push(r);return e}A(QEe,"baseKeys");var JEe=QEe;function e4e(t){return t!=null&&fq(t.length)&&!eEe(t)}A(e4e,"isArrayLike");var h7=e4e;function t4e(t){return h7(t)?BSt(t):JEe(t)}A(t4e,"keys");var gq=t4e;function r4e(t){return Wkt(t,gq,Xkt)}A(r4e,"getAllKeys");var $re=r4e,qSt=1,USt=Object.prototype,YSt=USt.hasOwnProperty;function n4e(t,e,r,n,i,a){var s=r&qSt,o=$re(t),l=o.length,u=$re(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:YSt.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var y=s;++dCq(t,e,s));return $g(t,e,n,r,...i)}A(j4e,"alternation");function K4e(t,e,r){const n=oa(t,e,r,{type:yf});jh(t,n);const i=$g(t,e,n,r,Bf(t,e,r));return Z4e(t,e,r,i)}A(K4e,"option");function Bf(t,e,r){const n=HEt(nh(r.definition,i=>Cq(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:J4e(t,n)}A(Bf,"block");function kq(t,e,r,n,i){const a=n.left,s=n.right,o=oa(t,e,r,{type:jEt});jh(t,o);const l=oa(t,e,r,{type:V4e});return a.loopback=o,l.loopback=o,t.decisionMap[X0(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Ii(s,o),i===void 0?(Ii(o,a),Ii(o,l)):(Ii(o,l),Ii(o,i.left),Ii(i.right,a)),{left:a,right:l}}A(kq,"plus");function Sq(t,e,r,n,i){const a=n.left,s=n.right,o=oa(t,e,r,{type:XEt});jh(t,o);const l=oa(t,e,r,{type:V4e}),u=oa(t,e,r,{type:YEt});return o.loopback=u,l.loopback=u,Ii(o,a),Ii(o,l),Ii(s,u),i!==void 0?(Ii(u,l),Ii(u,i.left),Ii(i.right,a)):Ii(u,o),t.decisionMap[X0(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}A(Sq,"star");function Z4e(t,e,r,n){const i=n.left,a=n.right;return Ii(i,a),t.decisionMap[X0(e,"Option",r.idx)]=i,n}A(Z4e,"optional");function jh(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}A(jh,"defineDecisionState");function $g(t,e,r,n,...i){const a=oa(t,e,n,{type:UEt,start:r});r.end=a;for(const o of i)o!==void 0?(Ii(r,o.left),Ii(o.right,a)):Ii(r,a);const s={left:r,right:a};return t.decisionMap[X0(e,Q4e(n),n.idx)]=r,s}A($g,"makeAlts");function Q4e(t){if(t instanceof So)return"Alternation";if(t instanceof Qa)return"Option";if(t instanceof ki)return"Repetition";if(t instanceof ko)return"RepetitionWithSeparator";if(t instanceof Xo)return"RepetitionMandatory";if(t instanceof jo)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}A(Q4e,"getProdType");function J4e(t,e){const r=e.length;for(let a=0;ae.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},A(tv,"ATNConfigSet"),tv);function Eq(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}A(Eq,"getATNConfigKey");function n3e(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?Aq(o,e-1,r,n,i):MEe(i,o):n||(i[i.length]=o)}return i}A(Aq,"baseFlatten");var o3e=Aq;function l3e(t,e){return o3e(nh(t,e),1)}A(l3e,"flatMap");var e4t=l3e;function c3e(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}A(f3e,"arrayIncludes");var a4t=f3e;function p3e(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=h4t){var u=e?null:u4t(t);if(u)return dq(u);s=!1,i=kEe,l=new TEe}else l=e?[]:o;e:for(;++n{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}A(E3e,"createDFACache");var rv,A3e=(rv=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;nconsole.log(n))}initialize(e){this.atn=W4e(e.rules),this.dfas=_3e(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=X0(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=nh(P9({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>nh(f,p=>p[0]));if(Q9(d,!1)&&!a){const f=Xre(d,(p,g,m)=>(mN(g,y=>{y&&(p[y.tokenTypeIdx]=m,mN(y.categoryMatches,v=>{p[v]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),y=f[m.tokenTypeIdx];if(p!==void 0&&y!==void 0){const v=(g=p[y])===null||g===void 0?void 0:g.GATE;if(v!==void 0&&v.call(this)===!1)return}return y}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new A3e,g=f===void 0?0:f.length;for(let y=0;ynh(f,p=>p[0]));if(Q9(d)&&d[0][0]&&!a){const f=d[0],p=p4t(f);if(p.length===1&&T4t(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=Xre(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,mN(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=B3.call(this,s,h,jre,o);return typeof f=="object"?!1:f===0}}},A(nv,"LLStarLookaheadStrategy"),nv);function Q9(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}A(Q9,"isLL1Sequence");function _3e(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nf0(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${N3e(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, + For further details.`);this.skipValidations=mr(r,"skipValidations")?r.skipValidations:Lh.skipValidations}},A(m0,"Parser"),m0);uq.DEFER_DEFINITION_ERRORS_HANDLING=!1;NSe(uq,[tCt,nCt,sCt,oCt,cCt,lCt,uCt,hCt,fCt,pCt]);var K1,gCt=(K1=class extends uq{constructor(e,r=Lh){const n=es(r);n.outputCst=!1,super(e,n)}},A(K1,"EmbeddedActionsParser"),K1);function DSe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}A(GSe,"listCacheHas");var TCt=GSe;function WSe(t,e){var r=this.__data__,n=s7(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}A(WSe,"listCacheSet");var wCt=WSe;function Mg(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&_kt?new wEe:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=cSt}A(qEe,"isLength");var fq=qEe,uSt="[object Arguments]",hSt="[object Array]",dSt="[object Boolean]",fSt="[object Date]",pSt="[object Error]",gSt="[object Function]",mSt="[object Map]",ySt="[object Number]",vSt="[object Object]",bSt="[object RegExp]",xSt="[object Set]",TSt="[object String]",wSt="[object WeakMap]",CSt="[object ArrayBuffer]",kSt="[object DataView]",SSt="[object Float32Array]",ESt="[object Float64Array]",ASt="[object Int8Array]",_St="[object Int16Array]",RSt="[object Int32Array]",LSt="[object Uint8Array]",MSt="[object Uint8ClampedArray]",ISt="[object Uint16Array]",NSt="[object Uint32Array]",Kn={};Kn[SSt]=Kn[ESt]=Kn[ASt]=Kn[_St]=Kn[RSt]=Kn[LSt]=Kn[MSt]=Kn[ISt]=Kn[NSt]=!0;Kn[uSt]=Kn[hSt]=Kn[CSt]=Kn[dSt]=Kn[kSt]=Kn[fSt]=Kn[pSt]=Kn[gSt]=Kn[mSt]=Kn[ySt]=Kn[vSt]=Kn[bSt]=Kn[xSt]=Kn[TSt]=Kn[wSt]=!1;function UEe(t){return nx(t)&&fq(t.length)&&!!Kn[Hx(t)]}A(UEe,"baseIsTypedArray");var DSt=UEe;function YEe(t){return function(e){return t(e)}}A(YEe,"baseUnary");var OSt=YEe,XEe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,oC=XEe&&typeof module=="object"&&module&&!module.nodeType&&module,$St=oC&&oC.exports===XEe,gN=$St&&XSe.process,PSt=(function(){try{var t=oC&&oC.require&&oC.require("util").types;return t||gN&&gN.binding&&gN.binding("util")}catch{}})(),Ore=PSt,$re=Ore&&Ore.isTypedArray,BSt=$re?OSt($re):DSt,pq=BSt,FSt=Object.prototype,zSt=FSt.hasOwnProperty;function jEe(t,e){var r=Ks(t),n=!r&&u7(t),i=!r&&!n&&a6(t),a=!r&&!n&&!i&&pq(t),s=r||n||i||a,o=s?Qkt(t.length,String):[],l=o.length;for(var u in t)(e||zSt.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||HEe(u,l)))&&o.push(u);return o}A(jEe,"arrayLikeKeys");var VSt=jEe,GSt=Object.prototype;function KEe(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||GSt;return t===r}A(KEe,"isPrototype");var ZEe=KEe;function QEe(t,e){return function(r){return t(e(r))}}A(QEe,"overArg");var WSt=QEe,HSt=WSt(Object.keys,Object),qSt=HSt,USt=Object.prototype,YSt=USt.hasOwnProperty;function JEe(t){if(!ZEe(t))return qSt(t);var e=[];for(var r in Object(t))YSt.call(t,r)&&r!="constructor"&&e.push(r);return e}A(JEe,"baseKeys");var e4e=JEe;function t4e(t){return t!=null&&fq(t.length)&&!tEe(t)}A(t4e,"isArrayLike");var h7=t4e;function r4e(t){return h7(t)?VSt(t):e4e(t)}A(r4e,"keys");var gq=r4e;function n4e(t){return Ukt(t,gq,Zkt)}A(n4e,"getAllKeys");var Pre=n4e,XSt=1,jSt=Object.prototype,KSt=jSt.hasOwnProperty;function i4e(t,e,r,n,i,a){var s=r&XSt,o=Pre(t),l=o.length,u=Pre(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:KSt.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var y=s;++dCq(t,e,s));return $g(t,e,n,r,...i)}A(K4e,"alternation");function Z4e(t,e,r){const n=oa(t,e,r,{type:yf});jh(t,n);const i=$g(t,e,n,r,Bf(t,e,r));return Q4e(t,e,r,i)}A(Z4e,"option");function Bf(t,e,r){const n=YEt(nh(r.definition,i=>Cq(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:e3e(t,n)}A(Bf,"block");function kq(t,e,r,n,i){const a=n.left,s=n.right,o=oa(t,e,r,{type:QEt});jh(t,o);const l=oa(t,e,r,{type:G4e});return a.loopback=o,l.loopback=o,t.decisionMap[X0(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Ii(s,o),i===void 0?(Ii(o,a),Ii(o,l)):(Ii(o,l),Ii(o,i.left),Ii(i.right,a)),{left:a,right:l}}A(kq,"plus");function Sq(t,e,r,n,i){const a=n.left,s=n.right,o=oa(t,e,r,{type:ZEt});jh(t,o);const l=oa(t,e,r,{type:G4e}),u=oa(t,e,r,{type:KEt});return o.loopback=u,l.loopback=u,Ii(o,a),Ii(o,l),Ii(s,u),i!==void 0?(Ii(u,l),Ii(u,i.left),Ii(i.right,a)):Ii(u,o),t.decisionMap[X0(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}A(Sq,"star");function Q4e(t,e,r,n){const i=n.left,a=n.right;return Ii(i,a),t.decisionMap[X0(e,"Option",r.idx)]=i,n}A(Q4e,"optional");function jh(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}A(jh,"defineDecisionState");function $g(t,e,r,n,...i){const a=oa(t,e,n,{type:jEt,start:r});r.end=a;for(const o of i)o!==void 0?(Ii(r,o.left),Ii(o.right,a)):Ii(r,a);const s={left:r,right:a};return t.decisionMap[X0(e,J4e(n),n.idx)]=r,s}A($g,"makeAlts");function J4e(t){if(t instanceof So)return"Alternation";if(t instanceof Qa)return"Option";if(t instanceof ki)return"Repetition";if(t instanceof ko)return"RepetitionWithSeparator";if(t instanceof Xo)return"RepetitionMandatory";if(t instanceof jo)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}A(J4e,"getProdType");function e3e(t,e){const r=e.length;for(let a=0;ae.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},A(tv,"ATNConfigSet"),tv);function Eq(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}A(Eq,"getATNConfigKey");function i3e(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?Aq(o,e-1,r,n,i):IEe(i,o):n||(i[i.length]=o)}return i}A(Aq,"baseFlatten");var l3e=Aq;function c3e(t,e){return l3e(nh(t,e),1)}A(c3e,"flatMap");var n4t=c3e;function u3e(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}A(p3e,"arrayIncludes");var l4t=p3e;function g3e(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=p4t){var u=e?null:f4t(t);if(u)return dq(u);s=!1,i=SEe,l=new wEe}else l=e?[]:o;e:for(;++n{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}A(A3e,"createDFACache");var rv,_3e=(rv=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;nconsole.log(n))}initialize(e){this.atn=H4e(e.rules),this.dfas=R3e(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=X0(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=nh(P9({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>nh(f,p=>p[0]));if(Q9(d,!1)&&!a){const f=jre(d,(p,g,m)=>(mN(g,y=>{y&&(p[y.tokenTypeIdx]=m,mN(y.categoryMatches,v=>{p[v]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),y=f[m.tokenTypeIdx];if(p!==void 0&&y!==void 0){const v=(g=p[y])===null||g===void 0?void 0:g.GATE;if(v!==void 0&&v.call(this)===!1)return}return y}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new _3e,g=f===void 0?0:f.length;for(let y=0;ynh(f,p=>p[0]));if(Q9(d)&&d[0][0]&&!a){const f=d[0],p=y4t(f);if(p.length===1&&k4t(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=jre(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,mN(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=B3.call(this,s,h,Kre,o);return typeof f=="object"?!1:f===0}}},A(nv,"LLStarLookaheadStrategy"),nv);function Q9(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}A(Q9,"isLL1Sequence");function R3e(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nf0(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${D3e(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, <${e}> may appears as a prefix path in all these alternatives. `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,n}A(I3e,"buildAmbiguityError");function N3e(t){if(t instanceof Xs)return"SUBRULE";if(t instanceof Qa)return"OPTION";if(t instanceof So)return"OR";if(t instanceof Xo)return"AT_LEAST_ONE";if(t instanceof jo)return"AT_LEAST_ONE_SEP";if(t instanceof ko)return"MANY_SEP";if(t instanceof ki)return"MANY";if(t instanceof Jn)return"CONSUME";throw Error("non exhaustive match")}A(N3e,"getProductionDslName");function D3e(t,e,r){const n=e4t(e.configs.elements,a=>a.state.transitions),i=f4t(n.filter(a=>a instanceof Tq).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}A(D3e,"buildAdaptivePredictError");function O3e(t,e){return t.edges[e.tokenTypeIdx]}A(O3e,"getExistingTargetState");function $3e(t,e,r){const n=new Z9,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===qS){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l0&&!V3e(a))for(const s of i)a.add(s);return a}A($3e,"computeReachSet");function P3e(t,e){if(t instanceof Tq&&tq(e,t.tokenType))return t.target}A(P3e,"getReachableTarget");function B3e(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}A(B3e,"getUniqueAlt");function _q(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}A(_q,"newDFAState");function J9(t,e,r,n){return n=Rq(t,n),e.edges[r.tokenTypeIdx]=n,n}A(J9,"addDFAEdge");function Rq(t,e){if(e===s6)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}A(Rq,"addDFAState");function F3e(t){const e=new Z9,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};Sk(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i1)return!0;return!1}A(q3e,"hasConflictingAltSet");function U3e(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}A(U3e,"hasStateAssociatedWithOneAlt");SS();var iv,Y3e=(iv=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Mq(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new b7;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new o6(e.startOffset,e.image.length,dk(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new o6(a.startOffset,a.image.length,dk(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infix&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},A(iv,"CstNodeBuilder"),iv),av,Lq=(av=class{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},A(av,"AbstractCstNode"),av),sv,o6=(sv=class extends Lq{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},A(sv,"LeafCstNodeImpl"),sv),ov,b7=(ov=class extends Lq{constructor(){super(...arguments),this.content=new S4t(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},A(ov,"CompositeCstNodeImpl"),ov),y0,S4t=(y0=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,y0.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}},A(y0,"CstNodeContainer"),y0),lv,Mq=(lv=class extends b7{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},A(lv,"RootCstNodeImpl"),lv),l6=Symbol("Datatype");function F3(t){return t.$type===l6}A(F3,"isDataTypeNode");var Kre="​",X3e=A(t=>t.endsWith(Kre)?t:t+Kre,"withRuleSuffix"),cv,Iq=(cv=class{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new A4t(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Q3e(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},A(cv,"AbstractLangiumParser"),cv),uv,j3e=(uv=class extends Iq{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Y3e,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e);let i;Qb(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(X3e(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),Ys(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===l6?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),a?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;in)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=Sh(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(F3(u)){let h=i.image;Sh(n)||(h=this.converter.convert(h,s).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,i,s))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(F3(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):F3(e)?this.converter.convert(e.value,e.$cstNode):(LW(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let a=0,s=-1;for(let m=0;ms?(s=v.precedence,a=m):v.precedence===s&&(v.rightAssoc||(a=m))}const o=i.slice(0,a),l=i.slice(a+1),u=n.slice(0,a+1),h=n.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:h,operators:l},p=this.constructInfix(d,r),g=this.constructInfix(f,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[a],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=bg(e,kh);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Tg(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a==="single"&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):a==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},A(uv,"LangiumParser"),uv),hv,K3e=(hv=class{buildMismatchTokenMessage(e){return iy.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return iy.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return iy.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return iy.buildEarlyExitMessage(e)}},A(hv,"AbstractParserErrorMessageProvider"),hv),dv,Nq=(dv=class extends K3e{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},A(dv,"LangiumParserErrorMessageProvider"),dv),fv,Z3e=(fv=class extends Iq{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(X3e(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},A(fv,"LangiumCompletionParser"),fv),E4t={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Nq},pv,Q3e=(pv=class extends dCt{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...E4t,lookaheadStrategy:n?new lq({maxLookahead:r.maxLookahead}):new k4t({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},A(pv,"ChevrotainWrapper"),pv),gv,A4t=(gv=class extends Q3e{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}},A(gv,"ProfilerWrapper"),gv);function x7(t,e,r){return J3e({parser:e,tokens:r,ruleNames:new Map},t),e}A(x7,"createParser");function J3e(t,e){const r=OL(e,!1),n=Sn(e.rules).filter(Ys).filter(a=>r.has(a));for(const a of n){const s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,vf(s,a.definition))}const i=Sn(e.rules).filter(Qb).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,e5e(t,a))}A(J3e,"buildRules");function e5e(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(Sl(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,s);const l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:s};s.elements.push(l,u);const d=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:A(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=T7(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:A(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}A(e5e,"buildInfixRule");function vf(t,e,r=!1){let n;if(Sh(e))n=o5e(t,e);else if(pf(e))n=t5e(t,e);else if(kh(e))n=vf(t,e.terminal);else if(Tg(e))n=Dq(t,e);else if(Eh(e))n=r5e(t,e);else if(EL(e))n=i5e(t,e);else if(LL(e))n=a5e(t,e);else if(wg(e))n=s5e(t,e);else if(PW(e)){const i=t.consume++;n=A(()=>t.parser.consume(i,mf,e),"method")}else throw new IL(e.$cstNode,`Unexpected element type: ${e.$type}`);return Oq(t,r?void 0:Ek(e),n,e.cardinality)}A(vf,"buildElement");function t5e(t,e){const r=q0(e);return()=>t.parser.action(r,e)}A(t5e,"buildAction");function r5e(t,e){const r=e.rule.ref;if(xg(r)){const n=t.subrule++,i=Ys(r)&&r.fragment,a=e.arguments.length>0?n5e(r,e.arguments):()=>({});let s;return o=>{s??(s=T7(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(Sl(r)){const n=t.consume++,i=c6(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)Of();else throw new IL(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}A(r5e,"buildRuleCall");function n5e(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,s;return{parameterName:(s=(a=i.parameter)==null?void 0:a.ref)==null?void 0:s.name,predicate:Hl(i.value)}});return i=>{const a={};for(const{parameterName:s,predicate:o}of n)s&&(a[s]=o(i));return a}}else{const n=e.map(i=>Hl(i.value));return i=>{const a={};for(let s=0;se(n)||r(n)}else if(OW(t)){const e=Hl(t.left),r=Hl(t.right);return n=>e(n)&&r(n)}else if(zW(t)){const e=Hl(t.value);return r=>!e(r)}else if(VW(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(NW(t)){const e=!!t.true;return()=>e}Of()}A(Hl,"buildPredicate");function i5e(t,e){if(e.elements.length===1)return vf(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:vf(t,i,!0)},s=Ek(i);s&&(a.GATE=Hl(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:A(()=>a.ALT(i),"ALT")},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}A(i5e,"buildAlternatives");function a5e(t,e){if(e.elements.length===1)return vf(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:vf(t,o,!0)},u=Ek(o);u&&(l.GATE=Hl(u)),r.push(l)}const n=t.or++,i=A((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),a=A(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:A(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),s=Oq(t,Ek(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}A(a5e,"buildUnorderedGroup");function s5e(t,e){const r=e.elements.map(n=>vf(t,n));return n=>r.forEach(i=>i(n))}A(s5e,"buildGroup");function Ek(t){if(wg(t))return t.guardCondition}A(Ek,"getGuardCondition");function Dq(t,e,r=e.terminal){if(r)if(Eh(r)&&Ys(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=T7(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(Eh(r)&&Sl(r.rule.ref)){const n=t.consume++,i=c6(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Sh(r)){const n=t.consume++,i=c6(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=FL(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+q0(e.type.ref));return Dq(t,e,i)}}A(Dq,"buildCrossReference");function o5e(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}A(o5e,"buildKeyword");function Oq(t,e,r,n){const i=e&&Hl(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:A(()=>r(s),"ALT"),GATE:A(()=>i(s),"GATE")},{ALT:U9(),GATE:A(()=>!i(s),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:A(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:A(()=>t.parser.atLeastOne(a,{DEF:A(()=>r(o),"DEF")}),"ALT"),GATE:A(()=>i(o),"GATE")},{ALT:U9(),GATE:A(()=>!i(o),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:A(()=>r(s),"DEF")})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:A(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else Of()}A(Oq,"wrap");function T7(t,e){const r=l5e(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}A(T7,"getRule");function l5e(t,e){if(xg(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Ys(n);)(wg(n)||EL(n)||LL(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}A(l5e,"getRuleName");function c6(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}A(c6,"getToken");function $q(t){const e=t.Grammar,r=t.parser.Lexer,n=new Z3e(t);return x7(e,n,r.definition),n.finalize(),n}A($q,"createCompletionParser");function Pq(t){const e=Bq(t);return e.finalize(),e}A(Pq,"createLangiumParser");function Bq(t){const e=t.Grammar,r=t.parser.Lexer,n=new j3e(t);return x7(e,n,r.definition)}A(Bq,"prepareLangiumParser");var mv,w7=(mv=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=Sn(OL(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return a.push(...i),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Sl).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=MS(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=DL(r)?Gs.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(xg).flatMap(i=>Uh(i).filter(Sh)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(Bx(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&cH("^"+a.source+"$",e.value)&&n.push(i),n},[])}},A(mv,"DefaultTokenBuilder"),mv),yv,Fq=(yv=class{convert(e,r){let n=r.grammarSource;if(Tg(n)&&(n=pH(n)),Eh(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return Nc.convertInt(r);case"STRING":return Nc.convertString(r);case"ID":return Nc.convertID(r)}switch((i=CH(e))==null?void 0:i.toLowerCase()){case"number":return Nc.convertNumber(r);case"boolean":return Nc.convertBoolean(r);case"bigint":return Nc.convertBigint(r);case"date":return Nc.convertDate(r);default:return r}}},A(yv,"DefaultValueConverter"),yv),Nc;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}A(C7,"delayNextTick");var z3=0,c5e=10;function k7(){return z3=performance.now(),new zn.CancellationTokenSource}A(k7,"startCancelableOperation");function zq(t){c5e=t}A(zq,"setInterruptionPeriod");var Vc=Symbol("OperationCancelled");function Pg(t){return t===Vc}A(Pg,"isOperationCancelled");async function va(t){if(t===zn.CancellationToken.None)return;const e=performance.now();if(e-z3>=c5e&&(z3=e,await C7(),z3=performance.now()),t.isCancellationRequested)throw Vc}A(va,"interruptAndCheck");var vv,Mh=(vv=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},A(vv,"Deferred"),vv),Xd,Zre=(Xd=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Xd.isIncremental(n)){const i=Gq(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=eB(n.text,!1,a);if(l-o===h.length)for(let f=0,p=h.length;fe?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1r&&Vq(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},A(Xd,"FullTextDocument"),Xd),u6;(function(t){function e(i,a,s,o){return new Zre(i,a,s,o)}A(e,"create"),t.create=e;function r(i,a,s){if(i instanceof Zre)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}A(r,"update"),t.update=r;function n(i,a){const s=i.getText(),o=h6(a.map(u5e),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(dl&&u.push(s.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(s.substr(l)),u.join("")}A(n,"applyEdits"),t.applyEdits=n})(u6||(u6={}));function h6(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);h6(n,e),h6(i,e);let a=0,s=0,o=0;for(;ar.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}A(Gq,"getWellformedRange");function u5e(t){const e=Gq(t.range);return e!==t.range?{newText:t.newText,range:e}:t}A(u5e,"getWellformedEdit");var h5e;(()=>{var t={975:D=>{function R(O){if(typeof O!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(O))}A(R,"e");function I(O,N){for(var F,z="",V=0,B=-1,G=0,H=0;H<=O.length;++H){if(H2){var q=z.lastIndexOf("/");if(q!==z.length-1){q===-1?(z="",V=0):V=(z=z.slice(0,q)).length-1-z.lastIndexOf("/"),B=H,G=0;continue}}else if(z.length===2||z.length===1){z="",V=0,B=H,G=0;continue}}N&&(z.length>0?z+="/..":z="..",V=2)}else z.length>0?z+="/"+O.slice(B+1,H):z=O.slice(B+1,H),V=H-B-1;B=H,G=0}else F===46&&G!==-1?++G:G=-1}return z}A(I,"r");var $={resolve:A(function(){for(var O,N="",F=!1,z=arguments.length-1;z>=-1&&!F;z--){var V;z>=0?V=arguments[z]:(O===void 0&&(O=process.cwd()),V=O),R(V),V.length!==0&&(N=V+"/"+N,F=V.charCodeAt(0)===47)}return N=I(N,!F),F?N.length>0?"/"+N:"/":N.length>0?N:"."},"resolve"),normalize:A(function(O){if(R(O),O.length===0)return".";var N=O.charCodeAt(0)===47,F=O.charCodeAt(O.length-1)===47;return(O=I(O,!N)).length!==0||N||(O="."),O.length>0&&F&&(O+="/"),N?"/"+O:O},"normalize"),isAbsolute:A(function(O){return R(O),O.length>0&&O.charCodeAt(0)===47},"isAbsolute"),join:A(function(){if(arguments.length===0)return".";for(var O,N=0;N0&&(O===void 0?O=F:O+="/"+F)}return O===void 0?".":$.normalize(O)},"join"),relative:A(function(O,N){if(R(O),R(N),O===N||(O=$.resolve(O))===(N=$.resolve(N)))return"";for(var F=1;FH){if(N.charCodeAt(B+Z)===47)return N.slice(B+Z+1);if(Z===0)return N.slice(B+Z)}else V>H&&(O.charCodeAt(F+Z)===47?q=Z:Z===0&&(q=0));break}var Y=O.charCodeAt(F+Z);if(Y!==N.charCodeAt(B+Z))break;Y===47&&(q=Z)}var ie="";for(Z=F+q+1;Z<=z;++Z)Z!==z&&O.charCodeAt(Z)!==47||(ie.length===0?ie+="..":ie+="/..");return ie.length>0?ie+N.slice(B+q):(B+=q,N.charCodeAt(B)===47&&++B,N.slice(B))},"relative"),_makeLong:A(function(O){return O},"_makeLong"),dirname:A(function(O){if(R(O),O.length===0)return".";for(var N=O.charCodeAt(0),F=N===47,z=-1,V=!0,B=O.length-1;B>=1;--B)if((N=O.charCodeAt(B))===47){if(!V){z=B;break}}else V=!1;return z===-1?F?"/":".":F&&z===1?"//":O.slice(0,z)},"dirname"),basename:A(function(O,N){if(N!==void 0&&typeof N!="string")throw new TypeError('"ext" argument must be a string');R(O);var F,z=0,V=-1,B=!0;if(N!==void 0&&N.length>0&&N.length<=O.length){if(N.length===O.length&&N===O)return"";var G=N.length-1,H=-1;for(F=O.length-1;F>=0;--F){var q=O.charCodeAt(F);if(q===47){if(!B){z=F+1;break}}else H===-1&&(B=!1,H=F+1),G>=0&&(q===N.charCodeAt(G)?--G==-1&&(V=F):(G=-1,V=H))}return z===V?V=H:V===-1&&(V=O.length),O.slice(z,V)}for(F=O.length-1;F>=0;--F)if(O.charCodeAt(F)===47){if(!B){z=F+1;break}}else V===-1&&(B=!1,V=F+1);return V===-1?"":O.slice(z,V)},"basename"),extname:A(function(O){R(O);for(var N=-1,F=0,z=-1,V=!0,B=0,G=O.length-1;G>=0;--G){var H=O.charCodeAt(G);if(H!==47)z===-1&&(V=!1,z=G+1),H===46?N===-1?N=G:B!==1&&(B=1):N!==-1&&(B=-1);else if(!V){F=G+1;break}}return N===-1||z===-1||B===0||B===1&&N===z-1&&N===F+1?"":O.slice(N,z)},"extname"),format:A(function(O){if(O===null||typeof O!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof O);return(function(N,F){var z=F.dir||F.root,V=F.base||(F.name||"")+(F.ext||"");return z?z===F.root?z+V:z+"/"+V:V})(0,O)},"format"),parse:A(function(O){R(O);var N={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return N;var F,z=O.charCodeAt(0),V=z===47;V?(N.root="/",F=1):F=0;for(var B=-1,G=0,H=-1,q=!0,Z=O.length-1,Y=0;Z>=F;--Z)if((z=O.charCodeAt(Z))!==47)H===-1&&(q=!1,H=Z+1),z===46?B===-1?B=Z:Y!==1&&(Y=1):B!==-1&&(Y=-1);else if(!q){G=Z+1;break}return B===-1||H===-1||Y===0||Y===1&&B===H-1&&B===G+1?H!==-1&&(N.base=N.name=G===0&&V?O.slice(1,H):O.slice(G,H)):(G===0&&V?(N.name=O.slice(1,B),N.base=O.slice(1,H)):(N.name=O.slice(G,B),N.base=O.slice(G,H)),N.ext=O.slice(B,H)),G>0?N.dir=O.slice(0,G-1):V&&(N.dir="/"),N},"parse"),sep:"/",delimiter:":",win32:null,posix:null};$.posix=$,D.exports=$}},e={};function r(D){var R=e[D];if(R!==void 0)return R.exports;var I=e[D]={exports:{}};return t[D](I,I.exports,r),I.exports}A(r,"r"),r.d=(D,R)=>{for(var I in R)r.o(R,I)&&!r.o(D,I)&&Object.defineProperty(D,I,{enumerable:!0,get:R[I]})},r.o=(D,R)=>Object.prototype.hasOwnProperty.call(D,R),r.r=D=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(D,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:A(()=>f,"URI"),Utils:A(()=>M,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(D,R){if(!D.scheme&&R)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${D.authority}", path: "${D.path}", query: "${D.query}", fragment: "${D.fragment}"}`);if(D.scheme&&!a.test(D.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(D.path){if(D.authority){if(!s.test(D.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(D.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}A(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,L=class L{constructor(R,I,$,O,N,F=!1){jt(this,"scheme");jt(this,"authority");jt(this,"path");jt(this,"query");jt(this,"fragment");typeof R=="object"?(this.scheme=R.scheme||u,this.authority=R.authority||u,this.path=R.path||u,this.query=R.query||u,this.fragment=R.fragment||u):(this.scheme=(function(z,V){return z||V?z:"file"})(R,F),this.authority=I||u,this.path=(function(z,V){switch(z){case"https":case"http":case"file":V?V[0]!==h&&(V=h+V):V=h}return V})(this.scheme,$||u),this.query=O||u,this.fragment=N||u,l(this,F))}static isUri(R){return R instanceof L||!!R&&typeof R.authority=="string"&&typeof R.fragment=="string"&&typeof R.path=="string"&&typeof R.query=="string"&&typeof R.scheme=="string"&&typeof R.fsPath=="string"&&typeof R.with=="function"&&typeof R.toString=="function"}get fsPath(){return T(this,!1)}with(R){if(!R)return this;let{scheme:I,authority:$,path:O,query:N,fragment:F}=R;return I===void 0?I=this.scheme:I===null&&(I=u),$===void 0?$=this.authority:$===null&&($=u),O===void 0?O=this.path:O===null&&(O=u),N===void 0?N=this.query:N===null&&(N=u),F===void 0?F=this.fragment:F===null&&(F=u),I===this.scheme&&$===this.authority&&O===this.path&&N===this.query&&F===this.fragment?this:new g(I,$,O,N,F)}static parse(R,I=!1){const $=d.exec(R);return $?new g($[2]||u,S($[4]||u),S($[5]||u),S($[7]||u),S($[9]||u),I):new g(u,u,u,u,u)}static file(R){let I=u;if(i&&(R=R.replace(/\\/g,h)),R[0]===h&&R[1]===h){const $=R.indexOf(h,2);$===-1?(I=R.substring(2),R=h):(I=R.substring(2,$),R=R.substring($)||h)}return new g("file",I,R,u,u)}static from(R){const I=new g(R.scheme,R.authority,R.path,R.query,R.fragment);return l(I,!0),I}toString(R=!1){return b(this,R)}toJSON(){return this}static revive(R){if(R){if(R instanceof L)return R;{const I=new g(R);return I._formatted=R.external,I._fsPath=R._sep===p?R.fsPath:null,I}}return R}};A(L,"l");let f=L;const p=i?1:void 0,P=class P extends f{constructor(){super(...arguments);jt(this,"_formatted",null);jt(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=T(this,!1)),this._fsPath}toString(I=!1){return I?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){const I={$mid:1};return this._fsPath&&(I.fsPath=this._fsPath,I._sep=p),this._formatted&&(I.external=this._formatted),this.path&&(I.path=this.path),this.scheme&&(I.scheme=this.scheme),this.authority&&(I.authority=this.authority),this.query&&(I.query=this.query),this.fragment&&(I.fragment=this.fragment),I}};A(P,"d");let g=P;const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function y(D,R,I){let $,O=-1;for(let N=0;N=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===45||F===46||F===95||F===126||R&&F===47||I&&F===91||I&&F===93||I&&F===58)O!==-1&&($+=encodeURIComponent(D.substring(O,N)),O=-1),$!==void 0&&($+=D.charAt(N));else{$===void 0&&($=D.substr(0,N));const z=m[F];z!==void 0?(O!==-1&&($+=encodeURIComponent(D.substring(O,N)),O=-1),$+=z):O===-1&&(O=N)}}return O!==-1&&($+=encodeURIComponent(D.substring(O))),$!==void 0?$:D}A(y,"m");function v(D){let R;for(let I=0;I1&&D.scheme==="file"?`//${D.authority}${D.path}`:D.path.charCodeAt(0)===47&&(D.path.charCodeAt(1)>=65&&D.path.charCodeAt(1)<=90||D.path.charCodeAt(1)>=97&&D.path.charCodeAt(1)<=122)&&D.path.charCodeAt(2)===58?R?D.path.substr(1):D.path[1].toLowerCase()+D.path.substr(2):D.path,i&&(I=I.replace(/\//g,"\\")),I}A(T,"v");function b(D,R){const I=R?v:y;let $="",{scheme:O,authority:N,path:F,query:z,fragment:V}=D;if(O&&($+=O,$+=":"),(N||O==="file")&&($+=h,$+=h),N){let B=N.indexOf("@");if(B!==-1){const G=N.substr(0,B);N=N.substr(B+1),B=G.lastIndexOf(":"),B===-1?$+=I(G,!1,!1):($+=I(G.substr(0,B),!1,!1),$+=":",$+=I(G.substr(B+1),!1,!0)),$+="@"}N=N.toLowerCase(),B=N.lastIndexOf(":"),B===-1?$+=I(N,!1,!0):($+=I(N.substr(0,B),!1,!0),$+=N.substr(B))}if(F){if(F.length>=3&&F.charCodeAt(0)===47&&F.charCodeAt(2)===58){const B=F.charCodeAt(1);B>=65&&B<=90&&(F=`/${String.fromCharCode(B+32)}:${F.substr(3)}`)}else if(F.length>=2&&F.charCodeAt(1)===58){const B=F.charCodeAt(0);B>=65&&B<=90&&(F=`${String.fromCharCode(B+32)}:${F.substr(2)}`)}$+=I(F,!0,!1)}return z&&($+="?",$+=I(z,!1,!1)),V&&($+="#",$+=R?V:y(V,!1,!1)),$}A(b,"b");function w(D){try{return decodeURIComponent(D)}catch{return D.length>3?D.substr(0,3)+w(D.substr(3)):D}}A(w,"C");const C=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function S(D){return D.match(C)?D.replace(C,(R=>w(R))):D}A(S,"w");var k=r(975);const E=k.posix||k,_="/";var M;(function(D){D.joinPath=function(R,...I){return R.with({path:E.join(R.path,...I)})},D.resolvePath=function(R,...I){let $=R.path,O=!1;$[0]!==_&&($=_+$,O=!0);let N=E.resolve($,...I);return O&&N[0]===_&&!R.authority&&(N=N.substring(1)),R.with({path:N})},D.dirname=function(R){if(R.path.length===0||R.path===_)return R;let I=E.dirname(R.path);return I.length===1&&I.charCodeAt(0)===46&&(I=""),R.with({path:I})},D.basename=function(R){return E.basename(R.path)},D.extname=function(R){return E.extname(R.path)}})(M||(M={})),h5e=n})();var{URI:Bo,Utils:CT}=h5e,Fs;(function(t){t.basename=CT.basename,t.dirname=CT.dirname,t.extname=CT.extname,t.joinPath=CT.joinPath,t.resolvePath=CT.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}A(r,"equals"),t.equals=r;function n(s,o){const l=typeof s=="string"?Bo.parse(s).path:s.path,u=typeof o=="string"?Bo.parse(o).path:o.path,h=l.split("/").filter(m=>m.length>0),d=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]!==d[0])return u.substring(1)}let f=0;for(;f({name:i.name,uri:Fs.joinPath(Bo.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(Fs.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const a of n){let s=i.children.get(a);if(!s)if(r)s={name:a,children:new Map,parent:i},i.children.set(a,s);else return;i=s}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}},A(bv,"UriTrie"),bv),Gr;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(Gr||(Gr={}));var xv,d5e=(xv=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=zn.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Bo.parse(e.uri),zn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return zn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:Gr.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:Gr.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var s,o;const n=(s=e.parseResult.value.$cstNode)==null?void 0:s.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:l})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=Gr.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=u6.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},A(xv,"DefaultLangiumDocumentFactory"),xv),Tv,f5e=(Tv=class{constructor(e){this.documentTrie=new Wq,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return Sn(this.documentTrie.all())}addDocument(e){const r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,Gr.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=Gr.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=Gr.Changed;return this.documentTrie.delete(r),n}},A(Tv,"DefaultLangiumDocuments"),Tv),mp=Symbol("RefResolving"),wv,p5e=(wv=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=zn.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const a of rc(e.parseResult.value))await va(r),Zb(a).forEach(s=>{const o=`${a.$type}:${s.property}`;i.startSubTask(o);try{this.doLink(s,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of rc(e.parseResult.value))await va(r),Zb(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=mp;try{const i=this.getCandidate(e);if(_p(i))n._ref=i;else{n._nodeDescription=i;const a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const a=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=mp;try{const i=this.getCandidates(e),a=[];if(_p(i))n._linkingError=i;else for(const s of i){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}n._items=a}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(const r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Hi(this._ref))return this._ref;if(AW(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=mp;const o=Cy(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if(_p(r))return{error:r};const n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=Cy(e.container).$document;n&&n.stateTg(r)&&r.isMulti)}findDeclarations(e){if(e){const r=vH(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(Bs(i)||Yc(i))return R_(i);if(Array.isArray(i)){for(const a of i)if((Bs(a)||Yc(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return R_(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||ZW(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of Zb(n))if(Yc(i.reference)&&i.reference.items.some(a=>a.ref===e))return i.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i)??i.$cstNode;a&&n.push(a)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>Fs.equals(a.sourceUri,r.documentUri))),n.push(...i),Sn(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=tc(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:ex(a),local:!0})}}return n}},A(kv,"DefaultReferences"),kv),Sv,Ih=(Sv=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return hk.sum(Sn(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const r=this.map.get(e);return r?Sn(r):Xb}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return Sn(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return Sn(this.map.keys())}values(){return Sn(this.map.values()).flat()}entriesGroupedByKey(){return Sn(this.map.entries())}},A(Sv,"MultiMap"),Sv),Ev,d6=(Ev=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}},A(Ev,"BiMap"),Ev),Av,y5e=(Av=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=zn.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=AS,i=zn.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await va(i),this.addExportedSymbol(s,a,r);return a}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=zn.CancellationToken.None){const n=e.parseResult.value,i=new Ih;for(const a of Uh(n))await va(r),this.addLocalSymbol(a,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}},A(Av,"DefaultScopeComputation"),Av),_v,tB=(_v=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},A(_v,"StreamScope"),_v),Rv,_4t=(Rv=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?Sn(i).concat(this.outerScope.getElements(e)):Sn(i)}getAllElements(){let e=Sn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},A(Rv,"MapScope"),Rv),Lv,v5e=(Lv=class{constructor(e,r,n){this.elements=new Ih,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?Sn(n).concat(this.outerScope.getElements(e)):Sn(n)}getAllElements(){let e=Sn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},A(Lv,"MultiMapScope"),Lv),R4t={getElement(){},getElements(){return Xb},getAllElements(){return Xb}},Mv,S7=(Mv=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},A(Mv,"DisposableCache"),Mv),Iv,qq=(Iv=class extends S7{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},A(Iv,"SimpleCache"),Iv),Nv,E7=(Nv=class extends S7{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},A(Nv,"ContextCache"),Nv),Dv,b5e=(Dv=class extends E7{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(const a of i)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{const a=n.concat(i);for(const s of a)this.clear(s)}))}},A(Dv,"DocumentCache"),Dv),Ov,Uq=(Ov=class extends qq{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},A(Ov,"WorkspaceCache"),Ov),$v,x5e=($v=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Uq(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=tc(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(o=>this.reflection.isSubtype(o.type,n))),s=s.$container;while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new tB(Sn(e),r,n)}createScopeForNodes(e,r,n){const i=Sn(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new tB(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new v5e(this.indexManager.allElements(e)))}},A($v,"DefaultScopeProvider"),$v);function Yq(t){return typeof t.$comment=="string"}A(Yq,"isAstNodeWithComment");function rB(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}A(rB,"isIntermediateReference");var Pv,T5e=(Pv=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=A((o,l)=>this.replacer(o,l,n),"defaultReplacer"),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=tc(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,h;if(!this.ignoreProperties.has(e))if(Bs(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=tc(d);let g="";this.currentDocument&&this.currentDocument!==p&&(o?g=o(p.uri,d):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${m}`,$refText:f}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:f}}else if(Yc(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=tc(p.ref);let y="";this.currentDocument&&this.currentDocument!==m&&(o?y=o(m.uri,g):y=m.uri.toString());const v=this.astNodeLocator.getAstNodePath(g);f.push(`${y}#${v}`)}return{$refs:f,$refText:d}}else if(Hi(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(h=r.$cstNode)==null?void 0:h.text),s){d??(d={...r});const f=this.commentProvider.getComment(r);f&&(d.$comment=f.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=A(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=mH(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(Pg(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=Sn(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},A(Fv,"ValidationRegistry"),Fv),k5e=Object.freeze({validateNode:!0,validateChildren:!0}),zv,S5e=(zv=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=zn.CancellationToken.None){const i=e.parseResult,a=[];if(await va(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ul.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ul.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ul.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(Pg(s))throw s;console.error("An error occurred during validation:",s)}return await va(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const s of i){const o=s.severity??"error",l={severity:lC(o),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:jq(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=dk(i.token);if(a){const s={severity:lC("error"),range:a,message:i.message,data:r0(ul.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const s=a.error;if(s){const o={node:s.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:s.info.property,index:s.info.index,data:{code:ul.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=zn.CancellationToken.None){const i=[],a=A((s,o,l)=>{i.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=zn.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await va(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=zn.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const o=rc(e).iterator();for(const l of o){s.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const h=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of h)await d(l,n,i)}finally{s.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{s.stop()}}else{const s=rc(e).iterator();for(const o of s){await va(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return k5e}async validateAstAfter(e,r,n,i=zn.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await va(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:Xq(n),severity:lC(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},A(zv,"DefaultDocumentValidator"),zv);function Xq(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=$L(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=yH(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}A(Xq,"getDiagnosticRange");function lC(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}A(lC,"toDiagnosticSeverity");function jq(t){switch(t){case"error":return r0(ul.LexingError);case"warning":return r0(ul.LexingWarning);case"info":return r0(ul.LexingInfo);case"hint":return r0(ul.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}A(jq,"toDiagnosticData");var ul;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(ul||(ul={}));var Vv,E5e=(Vv=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??tc(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=A(()=>s??(s=ex(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:ex(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},A(Vv,"DefaultAstNodeDescriptionProvider"),Vv),Gv,A5e=(Gv=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=zn.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of rc(i))await va(r),Zb(a).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];Bs(r)&&r.$nodeDescription?n=[r.$nodeDescription]:Yc(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=tc(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=ex(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:Fs.equals(l.documentUri,i)});return s}},A(Gv,"DefaultReferenceDescriptionProvider"),Gv),Wv,_5e=(Wv=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u==null?void 0:u[l]}return i[a]},e)}},A(Wv,"DefaultAstNodeLocator"),Wv),A7={};TL(A7,CW($x()));var Hv,R5e=(Hv=class{constructor(e){this._ready=new Mh,this.onConfigurationSectionUpdateEmitter=new A7.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},A(Hv,"DefaultConfigurationProvider"),Hv),u4=CW(c1t()),p0;(function(t){function e(r){return{dispose:A(async()=>await r(),"dispose")}}A(e,"create"),t.create=e})(p0||(p0={}));var qv,L5e=(qv=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Ih,this.documentPhaseListeners=new Ih,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Gr.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=zn.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===Gr.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,Gr.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(s))==null?void 0:i.result}),a.state=Gr.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=Gr.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=zn.CancellationToken.None){this.currentState=Gr.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const h of u)i.push(h.uri),this.cleanUpDeleted(h)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=Gr.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,Gr.Changed)}const s=Sn(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,Gr.ComputedScopes)),await this.emitUpdate(a,i),await va(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return Sn(s).filter(u=>!a.has(u)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r=0&&!this.hasTextDocument(e[n]);)n--;rn.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),p0.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case Gr.Changed:case Gr.Parsed:this.indexManager.removeContent(e.uri);case Gr.IndexedContent:e.localSymbols=void 0;case Gr.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Gr.Linked:this.indexManager.removeReferences(e.uri);case Gr.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Gr.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Gr.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,Gr.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,Gr.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,Gr.ComputedScopes,n,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,n)});const i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,Gr.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,Gr.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,Gr.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){for(const s of e)s.states.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),p0.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),p0.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=zn.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(Vc);if(this.currentState>=e&&e>i.state)return Promise.reject(new u4.ResponseError(u4.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${Gr[i.state]}, requiring ${Gr[e]}, but workspace state is already ${Gr[this.currentState]}. Returning undefined.`))}else return Promise.reject(new u4.ResponseError(u4.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{Fs.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Vc)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(Vc):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(Vc)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await va(n),await s(e,n)}catch(o){if(!Pg(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await va(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),a=typeof i.validation=="object"?{...i.validation}:{};a.categories=this.findMissingValidationCategories(e,i);const s=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=Sn(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},A(qv,"DefaultDocumentBuilder"),qv),Uv,M5e=(Uv=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new E7,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=tc(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{Fs.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),Sn(i)}allElements(e,r){let n=Sn(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=zn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=zn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}},A(Uv,"DefaultIndexManager"),Uv),Yv,I5e=(Yv=class{constructor(e){this.initialBuildOptions={},this._ready=new Mh,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=zn.CancellationToken.None){const n=await this.performStartup(e);await va(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=A(s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));const a=Sn(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Bo.parse(e.uri)}async traverseFolder(e,r){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=Fs.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},A(Yv,"DefaultWorkspaceManager"),Yv),Xv,N5e=(Xv=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return $9.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return $9.buildUnableToPopLexerModeMessage(e)}},A(Xv,"DefaultLexerErrorMessageProvider"),Xv),Kq={mode:"full"},jv,Zq=(jv=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=p6(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Gs(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Kq){var i,a;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(a=(i=this.tokenBuilder).flushLexingReport)==null?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(p6(e))return e;const r=R7(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},A(jv,"DefaultLexer"),jv);function _7(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}A(_7,"isTokenTypeArray");function R7(t){return t&&"modes"in t&&"defaultMode"in t}A(R7,"isIMultiModeLexerDefinition");function p6(t){return!_7(t)&&!R7(t)}A(p6,"isTokenTypeDictionary");SS();function Qq(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=mn.create(0,0));const a=eU(t),s=L7(n),o=D5e({lines:a,position:i,options:s});return P5e({index:0,tokens:o,position:i})}A(Qq,"parseJSDoc");function Jq(t,e){const r=L7(e),n=eU(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}A(Jq,"isJSDoc");function eU(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Bbe)}A(eU,"getLines");var Qre=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,L4t=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function D5e(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o=h.length){if(e.length>0){const p=mn.create(r,n);e.push({type:"break",content:"",range:jr.create(p,p)})}}else{Qre.lastIndex=d;const p=Qre.exec(h);if(p){const g=p[0],m=p[1],y=mn.create(r,n+d),v=mn.create(r,n+d+g.length);e.push({type:"tag",content:m,range:jr.create(y,v)}),d+=g.length,d=g6(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}A(D5e,"tokenize");function O5e(t,e,r,n){const i=[];if(t.length===0){const a=mn.create(r,n),s=mn.create(r,n+e.length);i.push({type:"text",content:e,range:jr.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:jr.create(mn.create(r,a+n),mn.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:jr.create(mn.create(r,a+h+n),mn.create(r,a+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:jr.create(mn.create(r,a+h+n),mn.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:jr.create(mn.create(r,a+h+n),mn.create(r,a+h+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:jr.create(mn.create(r,a+n),mn.create(r,a+n+s.length))})}return i}A(O5e,"buildInlineTokens");var M4t=/\S/,I4t=/\s*$/;function g6(t,e){const r=t.substring(e).match(M4t);return r?e+r.index:t.length}A(g6,"skipWhitespace");function $5e(t){const e=t.match(I4t);if(e&&typeof e.index=="number")return e.index}A($5e,"lastCharacter");function P5e(t){var a,s;const e=mn.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Jre([],jr.create(e,e));const r=[];for(;t.indexr.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=iB(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=iB(r)+i}return r.trim()}},A(Kv,"JSDocCommentImpl"),Kv),Zv,yN=(Zv=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} -${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=V5e(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i} -${r}`),this.inline?`{${i}}`:i}},A(Zv,"JSDocTagImpl"),Zv);function V5e(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=g6(e,i);a=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),((n=r.renderLink)==null?void 0:n.call(r,e,a))??G5e(e,a)}}A(V5e,"renderInlineTag");function G5e(t,e){try{return Bo.parse(t,!0),`[${e}](${t})`}catch{return t}}A(G5e,"renderLinkDefault");var Qv,nB=(Qv=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` +For Further details.`,n}A(N3e,"buildAmbiguityError");function D3e(t){if(t instanceof Xs)return"SUBRULE";if(t instanceof Qa)return"OPTION";if(t instanceof So)return"OR";if(t instanceof Xo)return"AT_LEAST_ONE";if(t instanceof jo)return"AT_LEAST_ONE_SEP";if(t instanceof ko)return"MANY_SEP";if(t instanceof ki)return"MANY";if(t instanceof Jn)return"CONSUME";throw Error("non exhaustive match")}A(D3e,"getProductionDslName");function O3e(t,e,r){const n=n4t(e.configs.elements,a=>a.state.transitions),i=m4t(n.filter(a=>a instanceof Tq).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}A(O3e,"buildAdaptivePredictError");function $3e(t,e){return t.edges[e.tokenTypeIdx]}A($3e,"getExistingTargetState");function P3e(t,e,r){const n=new Z9,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===qS){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l0&&!G3e(a))for(const s of i)a.add(s);return a}A(P3e,"computeReachSet");function B3e(t,e){if(t instanceof Tq&&tq(e,t.tokenType))return t.target}A(B3e,"getReachableTarget");function F3e(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}A(F3e,"getUniqueAlt");function _q(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}A(_q,"newDFAState");function J9(t,e,r,n){return n=Rq(t,n),e.edges[r.tokenTypeIdx]=n,n}A(J9,"addDFAEdge");function Rq(t,e){if(e===s6)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}A(Rq,"addDFAState");function z3e(t){const e=new Z9,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};Sk(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i1)return!0;return!1}A(U3e,"hasConflictingAltSet");function Y3e(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}A(Y3e,"hasStateAssociatedWithOneAlt");SS();var iv,X3e=(iv=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Mq(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new b7;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new o6(e.startOffset,e.image.length,dk(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new o6(a.startOffset,a.image.length,dk(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infix&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},A(iv,"CstNodeBuilder"),iv),av,Lq=(av=class{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},A(av,"AbstractCstNode"),av),sv,o6=(sv=class extends Lq{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},A(sv,"LeafCstNodeImpl"),sv),ov,b7=(ov=class extends Lq{constructor(){super(...arguments),this.content=new _4t(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},A(ov,"CompositeCstNodeImpl"),ov),y0,_4t=(y0=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,y0.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}},A(y0,"CstNodeContainer"),y0),lv,Mq=(lv=class extends b7{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},A(lv,"RootCstNodeImpl"),lv),l6=Symbol("Datatype");function F3(t){return t.$type===l6}A(F3,"isDataTypeNode");var Zre="​",j3e=A(t=>t.endsWith(Zre)?t:t+Zre,"withRuleSuffix"),cv,Iq=(cv=class{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new L4t(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new J3e(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},A(cv,"AbstractLangiumParser"),cv),uv,K3e=(uv=class extends Iq{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new X3e,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e);let i;Qb(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(j3e(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),Ys(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===l6?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),a?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;in)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=Sh(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(F3(u)){let h=i.image;Sh(n)||(h=this.converter.convert(h,s).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,i,s))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(F3(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):F3(e)?this.converter.convert(e.value,e.$cstNode):(LW(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let a=0,s=-1;for(let m=0;ms?(s=v.precedence,a=m):v.precedence===s&&(v.rightAssoc||(a=m))}const o=i.slice(0,a),l=i.slice(a+1),u=n.slice(0,a+1),h=n.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:h,operators:l},p=this.constructInfix(d,r),g=this.constructInfix(f,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[a],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=bg(e,kh);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Tg(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a==="single"&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):a==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},A(uv,"LangiumParser"),uv),hv,Z3e=(hv=class{buildMismatchTokenMessage(e){return iy.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return iy.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return iy.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return iy.buildEarlyExitMessage(e)}},A(hv,"AbstractParserErrorMessageProvider"),hv),dv,Nq=(dv=class extends Z3e{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},A(dv,"LangiumParserErrorMessageProvider"),dv),fv,Q3e=(fv=class extends Iq{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(j3e(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},A(fv,"LangiumCompletionParser"),fv),R4t={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Nq},pv,J3e=(pv=class extends gCt{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...R4t,lookaheadStrategy:n?new lq({maxLookahead:r.maxLookahead}):new A4t({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},A(pv,"ChevrotainWrapper"),pv),gv,L4t=(gv=class extends J3e{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}},A(gv,"ProfilerWrapper"),gv);function x7(t,e,r){return e5e({parser:e,tokens:r,ruleNames:new Map},t),e}A(x7,"createParser");function e5e(t,e){const r=OL(e,!1),n=Sn(e.rules).filter(Ys).filter(a=>r.has(a));for(const a of n){const s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,vf(s,a.definition))}const i=Sn(e.rules).filter(Qb).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,t5e(t,a))}A(e5e,"buildRules");function t5e(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(Sl(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,s);const l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:s};s.elements.push(l,u);const d=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:A(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=T7(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:A(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}A(t5e,"buildInfixRule");function vf(t,e,r=!1){let n;if(Sh(e))n=l5e(t,e);else if(pf(e))n=r5e(t,e);else if(kh(e))n=vf(t,e.terminal);else if(Tg(e))n=Dq(t,e);else if(Eh(e))n=n5e(t,e);else if(EL(e))n=a5e(t,e);else if(LL(e))n=s5e(t,e);else if(wg(e))n=o5e(t,e);else if(PW(e)){const i=t.consume++;n=A(()=>t.parser.consume(i,mf,e),"method")}else throw new IL(e.$cstNode,`Unexpected element type: ${e.$type}`);return Oq(t,r?void 0:Ek(e),n,e.cardinality)}A(vf,"buildElement");function r5e(t,e){const r=q0(e);return()=>t.parser.action(r,e)}A(r5e,"buildAction");function n5e(t,e){const r=e.rule.ref;if(xg(r)){const n=t.subrule++,i=Ys(r)&&r.fragment,a=e.arguments.length>0?i5e(r,e.arguments):()=>({});let s;return o=>{s??(s=T7(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(Sl(r)){const n=t.consume++,i=c6(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)Of();else throw new IL(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}A(n5e,"buildRuleCall");function i5e(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,s;return{parameterName:(s=(a=i.parameter)==null?void 0:a.ref)==null?void 0:s.name,predicate:Hl(i.value)}});return i=>{const a={};for(const{parameterName:s,predicate:o}of n)s&&(a[s]=o(i));return a}}else{const n=e.map(i=>Hl(i.value));return i=>{const a={};for(let s=0;se(n)||r(n)}else if(OW(t)){const e=Hl(t.left),r=Hl(t.right);return n=>e(n)&&r(n)}else if(zW(t)){const e=Hl(t.value);return r=>!e(r)}else if(VW(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(NW(t)){const e=!!t.true;return()=>e}Of()}A(Hl,"buildPredicate");function a5e(t,e){if(e.elements.length===1)return vf(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:vf(t,i,!0)},s=Ek(i);s&&(a.GATE=Hl(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:A(()=>a.ALT(i),"ALT")},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}A(a5e,"buildAlternatives");function s5e(t,e){if(e.elements.length===1)return vf(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:vf(t,o,!0)},u=Ek(o);u&&(l.GATE=Hl(u)),r.push(l)}const n=t.or++,i=A((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),a=A(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:A(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),s=Oq(t,Ek(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}A(s5e,"buildUnorderedGroup");function o5e(t,e){const r=e.elements.map(n=>vf(t,n));return n=>r.forEach(i=>i(n))}A(o5e,"buildGroup");function Ek(t){if(wg(t))return t.guardCondition}A(Ek,"getGuardCondition");function Dq(t,e,r=e.terminal){if(r)if(Eh(r)&&Ys(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=T7(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(Eh(r)&&Sl(r.rule.ref)){const n=t.consume++,i=c6(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Sh(r)){const n=t.consume++,i=c6(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=FL(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+q0(e.type.ref));return Dq(t,e,i)}}A(Dq,"buildCrossReference");function l5e(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}A(l5e,"buildKeyword");function Oq(t,e,r,n){const i=e&&Hl(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:A(()=>r(s),"ALT"),GATE:A(()=>i(s),"GATE")},{ALT:U9(),GATE:A(()=>!i(s),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:A(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:A(()=>t.parser.atLeastOne(a,{DEF:A(()=>r(o),"DEF")}),"ALT"),GATE:A(()=>i(o),"GATE")},{ALT:U9(),GATE:A(()=>!i(o),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:A(()=>r(s),"DEF")})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:A(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else Of()}A(Oq,"wrap");function T7(t,e){const r=c5e(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}A(T7,"getRule");function c5e(t,e){if(xg(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Ys(n);)(wg(n)||EL(n)||LL(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}A(c5e,"getRuleName");function c6(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}A(c6,"getToken");function $q(t){const e=t.Grammar,r=t.parser.Lexer,n=new Q3e(t);return x7(e,n,r.definition),n.finalize(),n}A($q,"createCompletionParser");function Pq(t){const e=Bq(t);return e.finalize(),e}A(Pq,"createLangiumParser");function Bq(t){const e=t.Grammar,r=t.parser.Lexer,n=new K3e(t);return x7(e,n,r.definition)}A(Bq,"prepareLangiumParser");var mv,w7=(mv=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=Sn(OL(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return a.push(...i),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Sl).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=MS(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=DL(r)?Gs.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(xg).flatMap(i=>Uh(i).filter(Sh)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(Bx(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&cH("^"+a.source+"$",e.value)&&n.push(i),n},[])}},A(mv,"DefaultTokenBuilder"),mv),yv,Fq=(yv=class{convert(e,r){let n=r.grammarSource;if(Tg(n)&&(n=pH(n)),Eh(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return Nc.convertInt(r);case"STRING":return Nc.convertString(r);case"ID":return Nc.convertID(r)}switch((i=CH(e))==null?void 0:i.toLowerCase()){case"number":return Nc.convertNumber(r);case"boolean":return Nc.convertBoolean(r);case"bigint":return Nc.convertBigint(r);case"date":return Nc.convertDate(r);default:return r}}},A(yv,"DefaultValueConverter"),yv),Nc;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}A(C7,"delayNextTick");var z3=0,u5e=10;function k7(){return z3=performance.now(),new Vn.CancellationTokenSource}A(k7,"startCancelableOperation");function zq(t){u5e=t}A(zq,"setInterruptionPeriod");var Vc=Symbol("OperationCancelled");function Pg(t){return t===Vc}A(Pg,"isOperationCancelled");async function ba(t){if(t===Vn.CancellationToken.None)return;const e=performance.now();if(e-z3>=u5e&&(z3=e,await C7(),z3=performance.now()),t.isCancellationRequested)throw Vc}A(ba,"interruptAndCheck");var vv,Mh=(vv=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},A(vv,"Deferred"),vv),Xd,Qre=(Xd=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Xd.isIncremental(n)){const i=Gq(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=eB(n.text,!1,a);if(l-o===h.length)for(let f=0,p=h.length;fe?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1r&&Vq(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},A(Xd,"FullTextDocument"),Xd),u6;(function(t){function e(i,a,s,o){return new Qre(i,a,s,o)}A(e,"create"),t.create=e;function r(i,a,s){if(i instanceof Qre)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}A(r,"update"),t.update=r;function n(i,a){const s=i.getText(),o=h6(a.map(h5e),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(dl&&u.push(s.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(s.substr(l)),u.join("")}A(n,"applyEdits"),t.applyEdits=n})(u6||(u6={}));function h6(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);h6(n,e),h6(i,e);let a=0,s=0,o=0;for(;ar.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}A(Gq,"getWellformedRange");function h5e(t){const e=Gq(t.range);return e!==t.range?{newText:t.newText,range:e}:t}A(h5e,"getWellformedEdit");var d5e;(()=>{var t={975:D=>{function R(O){if(typeof O!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(O))}A(R,"e");function I(O,N){for(var F,z="",V=0,B=-1,G=0,H=0;H<=O.length;++H){if(H2){var q=z.lastIndexOf("/");if(q!==z.length-1){q===-1?(z="",V=0):V=(z=z.slice(0,q)).length-1-z.lastIndexOf("/"),B=H,G=0;continue}}else if(z.length===2||z.length===1){z="",V=0,B=H,G=0;continue}}N&&(z.length>0?z+="/..":z="..",V=2)}else z.length>0?z+="/"+O.slice(B+1,H):z=O.slice(B+1,H),V=H-B-1;B=H,G=0}else F===46&&G!==-1?++G:G=-1}return z}A(I,"r");var $={resolve:A(function(){for(var O,N="",F=!1,z=arguments.length-1;z>=-1&&!F;z--){var V;z>=0?V=arguments[z]:(O===void 0&&(O=process.cwd()),V=O),R(V),V.length!==0&&(N=V+"/"+N,F=V.charCodeAt(0)===47)}return N=I(N,!F),F?N.length>0?"/"+N:"/":N.length>0?N:"."},"resolve"),normalize:A(function(O){if(R(O),O.length===0)return".";var N=O.charCodeAt(0)===47,F=O.charCodeAt(O.length-1)===47;return(O=I(O,!N)).length!==0||N||(O="."),O.length>0&&F&&(O+="/"),N?"/"+O:O},"normalize"),isAbsolute:A(function(O){return R(O),O.length>0&&O.charCodeAt(0)===47},"isAbsolute"),join:A(function(){if(arguments.length===0)return".";for(var O,N=0;N0&&(O===void 0?O=F:O+="/"+F)}return O===void 0?".":$.normalize(O)},"join"),relative:A(function(O,N){if(R(O),R(N),O===N||(O=$.resolve(O))===(N=$.resolve(N)))return"";for(var F=1;FH){if(N.charCodeAt(B+Z)===47)return N.slice(B+Z+1);if(Z===0)return N.slice(B+Z)}else V>H&&(O.charCodeAt(F+Z)===47?q=Z:Z===0&&(q=0));break}var Y=O.charCodeAt(F+Z);if(Y!==N.charCodeAt(B+Z))break;Y===47&&(q=Z)}var ie="";for(Z=F+q+1;Z<=z;++Z)Z!==z&&O.charCodeAt(Z)!==47||(ie.length===0?ie+="..":ie+="/..");return ie.length>0?ie+N.slice(B+q):(B+=q,N.charCodeAt(B)===47&&++B,N.slice(B))},"relative"),_makeLong:A(function(O){return O},"_makeLong"),dirname:A(function(O){if(R(O),O.length===0)return".";for(var N=O.charCodeAt(0),F=N===47,z=-1,V=!0,B=O.length-1;B>=1;--B)if((N=O.charCodeAt(B))===47){if(!V){z=B;break}}else V=!1;return z===-1?F?"/":".":F&&z===1?"//":O.slice(0,z)},"dirname"),basename:A(function(O,N){if(N!==void 0&&typeof N!="string")throw new TypeError('"ext" argument must be a string');R(O);var F,z=0,V=-1,B=!0;if(N!==void 0&&N.length>0&&N.length<=O.length){if(N.length===O.length&&N===O)return"";var G=N.length-1,H=-1;for(F=O.length-1;F>=0;--F){var q=O.charCodeAt(F);if(q===47){if(!B){z=F+1;break}}else H===-1&&(B=!1,H=F+1),G>=0&&(q===N.charCodeAt(G)?--G==-1&&(V=F):(G=-1,V=H))}return z===V?V=H:V===-1&&(V=O.length),O.slice(z,V)}for(F=O.length-1;F>=0;--F)if(O.charCodeAt(F)===47){if(!B){z=F+1;break}}else V===-1&&(B=!1,V=F+1);return V===-1?"":O.slice(z,V)},"basename"),extname:A(function(O){R(O);for(var N=-1,F=0,z=-1,V=!0,B=0,G=O.length-1;G>=0;--G){var H=O.charCodeAt(G);if(H!==47)z===-1&&(V=!1,z=G+1),H===46?N===-1?N=G:B!==1&&(B=1):N!==-1&&(B=-1);else if(!V){F=G+1;break}}return N===-1||z===-1||B===0||B===1&&N===z-1&&N===F+1?"":O.slice(N,z)},"extname"),format:A(function(O){if(O===null||typeof O!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof O);return(function(N,F){var z=F.dir||F.root,V=F.base||(F.name||"")+(F.ext||"");return z?z===F.root?z+V:z+"/"+V:V})(0,O)},"format"),parse:A(function(O){R(O);var N={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return N;var F,z=O.charCodeAt(0),V=z===47;V?(N.root="/",F=1):F=0;for(var B=-1,G=0,H=-1,q=!0,Z=O.length-1,Y=0;Z>=F;--Z)if((z=O.charCodeAt(Z))!==47)H===-1&&(q=!1,H=Z+1),z===46?B===-1?B=Z:Y!==1&&(Y=1):B!==-1&&(Y=-1);else if(!q){G=Z+1;break}return B===-1||H===-1||Y===0||Y===1&&B===H-1&&B===G+1?H!==-1&&(N.base=N.name=G===0&&V?O.slice(1,H):O.slice(G,H)):(G===0&&V?(N.name=O.slice(1,B),N.base=O.slice(1,H)):(N.name=O.slice(G,B),N.base=O.slice(G,H)),N.ext=O.slice(B,H)),G>0?N.dir=O.slice(0,G-1):V&&(N.dir="/"),N},"parse"),sep:"/",delimiter:":",win32:null,posix:null};$.posix=$,D.exports=$}},e={};function r(D){var R=e[D];if(R!==void 0)return R.exports;var I=e[D]={exports:{}};return t[D](I,I.exports,r),I.exports}A(r,"r"),r.d=(D,R)=>{for(var I in R)r.o(R,I)&&!r.o(D,I)&&Object.defineProperty(D,I,{enumerable:!0,get:R[I]})},r.o=(D,R)=>Object.prototype.hasOwnProperty.call(D,R),r.r=D=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(D,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:A(()=>f,"URI"),Utils:A(()=>M,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(D,R){if(!D.scheme&&R)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${D.authority}", path: "${D.path}", query: "${D.query}", fragment: "${D.fragment}"}`);if(D.scheme&&!a.test(D.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(D.path){if(D.authority){if(!s.test(D.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(D.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}A(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,L=class L{constructor(R,I,$,O,N,F=!1){jt(this,"scheme");jt(this,"authority");jt(this,"path");jt(this,"query");jt(this,"fragment");typeof R=="object"?(this.scheme=R.scheme||u,this.authority=R.authority||u,this.path=R.path||u,this.query=R.query||u,this.fragment=R.fragment||u):(this.scheme=(function(z,V){return z||V?z:"file"})(R,F),this.authority=I||u,this.path=(function(z,V){switch(z){case"https":case"http":case"file":V?V[0]!==h&&(V=h+V):V=h}return V})(this.scheme,$||u),this.query=O||u,this.fragment=N||u,l(this,F))}static isUri(R){return R instanceof L||!!R&&typeof R.authority=="string"&&typeof R.fragment=="string"&&typeof R.path=="string"&&typeof R.query=="string"&&typeof R.scheme=="string"&&typeof R.fsPath=="string"&&typeof R.with=="function"&&typeof R.toString=="function"}get fsPath(){return T(this,!1)}with(R){if(!R)return this;let{scheme:I,authority:$,path:O,query:N,fragment:F}=R;return I===void 0?I=this.scheme:I===null&&(I=u),$===void 0?$=this.authority:$===null&&($=u),O===void 0?O=this.path:O===null&&(O=u),N===void 0?N=this.query:N===null&&(N=u),F===void 0?F=this.fragment:F===null&&(F=u),I===this.scheme&&$===this.authority&&O===this.path&&N===this.query&&F===this.fragment?this:new g(I,$,O,N,F)}static parse(R,I=!1){const $=d.exec(R);return $?new g($[2]||u,S($[4]||u),S($[5]||u),S($[7]||u),S($[9]||u),I):new g(u,u,u,u,u)}static file(R){let I=u;if(i&&(R=R.replace(/\\/g,h)),R[0]===h&&R[1]===h){const $=R.indexOf(h,2);$===-1?(I=R.substring(2),R=h):(I=R.substring(2,$),R=R.substring($)||h)}return new g("file",I,R,u,u)}static from(R){const I=new g(R.scheme,R.authority,R.path,R.query,R.fragment);return l(I,!0),I}toString(R=!1){return b(this,R)}toJSON(){return this}static revive(R){if(R){if(R instanceof L)return R;{const I=new g(R);return I._formatted=R.external,I._fsPath=R._sep===p?R.fsPath:null,I}}return R}};A(L,"l");let f=L;const p=i?1:void 0,P=class P extends f{constructor(){super(...arguments);jt(this,"_formatted",null);jt(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=T(this,!1)),this._fsPath}toString(I=!1){return I?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){const I={$mid:1};return this._fsPath&&(I.fsPath=this._fsPath,I._sep=p),this._formatted&&(I.external=this._formatted),this.path&&(I.path=this.path),this.scheme&&(I.scheme=this.scheme),this.authority&&(I.authority=this.authority),this.query&&(I.query=this.query),this.fragment&&(I.fragment=this.fragment),I}};A(P,"d");let g=P;const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function y(D,R,I){let $,O=-1;for(let N=0;N=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===45||F===46||F===95||F===126||R&&F===47||I&&F===91||I&&F===93||I&&F===58)O!==-1&&($+=encodeURIComponent(D.substring(O,N)),O=-1),$!==void 0&&($+=D.charAt(N));else{$===void 0&&($=D.substr(0,N));const z=m[F];z!==void 0?(O!==-1&&($+=encodeURIComponent(D.substring(O,N)),O=-1),$+=z):O===-1&&(O=N)}}return O!==-1&&($+=encodeURIComponent(D.substring(O))),$!==void 0?$:D}A(y,"m");function v(D){let R;for(let I=0;I1&&D.scheme==="file"?`//${D.authority}${D.path}`:D.path.charCodeAt(0)===47&&(D.path.charCodeAt(1)>=65&&D.path.charCodeAt(1)<=90||D.path.charCodeAt(1)>=97&&D.path.charCodeAt(1)<=122)&&D.path.charCodeAt(2)===58?R?D.path.substr(1):D.path[1].toLowerCase()+D.path.substr(2):D.path,i&&(I=I.replace(/\//g,"\\")),I}A(T,"v");function b(D,R){const I=R?v:y;let $="",{scheme:O,authority:N,path:F,query:z,fragment:V}=D;if(O&&($+=O,$+=":"),(N||O==="file")&&($+=h,$+=h),N){let B=N.indexOf("@");if(B!==-1){const G=N.substr(0,B);N=N.substr(B+1),B=G.lastIndexOf(":"),B===-1?$+=I(G,!1,!1):($+=I(G.substr(0,B),!1,!1),$+=":",$+=I(G.substr(B+1),!1,!0)),$+="@"}N=N.toLowerCase(),B=N.lastIndexOf(":"),B===-1?$+=I(N,!1,!0):($+=I(N.substr(0,B),!1,!0),$+=N.substr(B))}if(F){if(F.length>=3&&F.charCodeAt(0)===47&&F.charCodeAt(2)===58){const B=F.charCodeAt(1);B>=65&&B<=90&&(F=`/${String.fromCharCode(B+32)}:${F.substr(3)}`)}else if(F.length>=2&&F.charCodeAt(1)===58){const B=F.charCodeAt(0);B>=65&&B<=90&&(F=`${String.fromCharCode(B+32)}:${F.substr(2)}`)}$+=I(F,!0,!1)}return z&&($+="?",$+=I(z,!1,!1)),V&&($+="#",$+=R?V:y(V,!1,!1)),$}A(b,"b");function w(D){try{return decodeURIComponent(D)}catch{return D.length>3?D.substr(0,3)+w(D.substr(3)):D}}A(w,"C");const C=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function S(D){return D.match(C)?D.replace(C,(R=>w(R))):D}A(S,"w");var k=r(975);const E=k.posix||k,_="/";var M;(function(D){D.joinPath=function(R,...I){return R.with({path:E.join(R.path,...I)})},D.resolvePath=function(R,...I){let $=R.path,O=!1;$[0]!==_&&($=_+$,O=!0);let N=E.resolve($,...I);return O&&N[0]===_&&!R.authority&&(N=N.substring(1)),R.with({path:N})},D.dirname=function(R){if(R.path.length===0||R.path===_)return R;let I=E.dirname(R.path);return I.length===1&&I.charCodeAt(0)===46&&(I=""),R.with({path:I})},D.basename=function(R){return E.basename(R.path)},D.extname=function(R){return E.extname(R.path)}})(M||(M={})),d5e=n})();var{URI:Bo,Utils:CT}=d5e,Fs;(function(t){t.basename=CT.basename,t.dirname=CT.dirname,t.extname=CT.extname,t.joinPath=CT.joinPath,t.resolvePath=CT.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}A(r,"equals"),t.equals=r;function n(s,o){const l=typeof s=="string"?Bo.parse(s).path:s.path,u=typeof o=="string"?Bo.parse(o).path:o.path,h=l.split("/").filter(m=>m.length>0),d=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]!==d[0])return u.substring(1)}let f=0;for(;f({name:i.name,uri:Fs.joinPath(Bo.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(Fs.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const a of n){let s=i.children.get(a);if(!s)if(r)s={name:a,children:new Map,parent:i},i.children.set(a,s);else return;i=s}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}},A(bv,"UriTrie"),bv),Gr;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(Gr||(Gr={}));var xv,f5e=(xv=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=Vn.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Bo.parse(e.uri),Vn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return Vn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:Gr.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:Gr.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var s,o;const n=(s=e.parseResult.value.$cstNode)==null?void 0:s.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:l})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=Gr.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=u6.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},A(xv,"DefaultLangiumDocumentFactory"),xv),Tv,p5e=(Tv=class{constructor(e){this.documentTrie=new Wq,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return Sn(this.documentTrie.all())}addDocument(e){const r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,Gr.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=Gr.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=Gr.Changed;return this.documentTrie.delete(r),n}},A(Tv,"DefaultLangiumDocuments"),Tv),mp=Symbol("RefResolving"),wv,g5e=(wv=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=Vn.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const a of rc(e.parseResult.value))await ba(r),Zb(a).forEach(s=>{const o=`${a.$type}:${s.property}`;i.startSubTask(o);try{this.doLink(s,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of rc(e.parseResult.value))await ba(r),Zb(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=mp;try{const i=this.getCandidate(e);if(_p(i))n._ref=i;else{n._nodeDescription=i;const a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const a=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=mp;try{const i=this.getCandidates(e),a=[];if(_p(i))n._linkingError=i;else for(const s of i){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}n._items=a}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(const r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Hi(this._ref))return this._ref;if(AW(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=mp;const o=Cy(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if(_p(r))return{error:r};const n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=Cy(e.container).$document;n&&n.stateTg(r)&&r.isMulti)}findDeclarations(e){if(e){const r=vH(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(Bs(i)||Yc(i))return R_(i);if(Array.isArray(i)){for(const a of i)if((Bs(a)||Yc(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return R_(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||ZW(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of Zb(n))if(Yc(i.reference)&&i.reference.items.some(a=>a.ref===e))return i.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i)??i.$cstNode;a&&n.push(a)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>Fs.equals(a.sourceUri,r.documentUri))),n.push(...i),Sn(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=tc(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:ex(a),local:!0})}}return n}},A(kv,"DefaultReferences"),kv),Sv,Ih=(Sv=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return hk.sum(Sn(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const r=this.map.get(e);return r?Sn(r):Xb}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return Sn(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return Sn(this.map.keys())}values(){return Sn(this.map.values()).flat()}entriesGroupedByKey(){return Sn(this.map.entries())}},A(Sv,"MultiMap"),Sv),Ev,d6=(Ev=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}},A(Ev,"BiMap"),Ev),Av,v5e=(Av=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=Vn.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=AS,i=Vn.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await ba(i),this.addExportedSymbol(s,a,r);return a}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=Vn.CancellationToken.None){const n=e.parseResult.value,i=new Ih;for(const a of Uh(n))await ba(r),this.addLocalSymbol(a,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}},A(Av,"DefaultScopeComputation"),Av),_v,tB=(_v=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},A(_v,"StreamScope"),_v),Rv,M4t=(Rv=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?Sn(i).concat(this.outerScope.getElements(e)):Sn(i)}getAllElements(){let e=Sn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},A(Rv,"MapScope"),Rv),Lv,b5e=(Lv=class{constructor(e,r,n){this.elements=new Ih,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?Sn(n).concat(this.outerScope.getElements(e)):Sn(n)}getAllElements(){let e=Sn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},A(Lv,"MultiMapScope"),Lv),I4t={getElement(){},getElements(){return Xb},getAllElements(){return Xb}},Mv,S7=(Mv=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},A(Mv,"DisposableCache"),Mv),Iv,qq=(Iv=class extends S7{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},A(Iv,"SimpleCache"),Iv),Nv,E7=(Nv=class extends S7{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},A(Nv,"ContextCache"),Nv),Dv,x5e=(Dv=class extends E7{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(const a of i)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{const a=n.concat(i);for(const s of a)this.clear(s)}))}},A(Dv,"DocumentCache"),Dv),Ov,Uq=(Ov=class extends qq{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},A(Ov,"WorkspaceCache"),Ov),$v,T5e=($v=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Uq(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=tc(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(o=>this.reflection.isSubtype(o.type,n))),s=s.$container;while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new tB(Sn(e),r,n)}createScopeForNodes(e,r,n){const i=Sn(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new tB(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new b5e(this.indexManager.allElements(e)))}},A($v,"DefaultScopeProvider"),$v);function Yq(t){return typeof t.$comment=="string"}A(Yq,"isAstNodeWithComment");function rB(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}A(rB,"isIntermediateReference");var Pv,w5e=(Pv=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=A((o,l)=>this.replacer(o,l,n),"defaultReplacer"),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=tc(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,h;if(!this.ignoreProperties.has(e))if(Bs(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=tc(d);let g="";this.currentDocument&&this.currentDocument!==p&&(o?g=o(p.uri,d):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${m}`,$refText:f}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:f}}else if(Yc(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=tc(p.ref);let y="";this.currentDocument&&this.currentDocument!==m&&(o?y=o(m.uri,g):y=m.uri.toString());const v=this.astNodeLocator.getAstNodePath(g);f.push(`${y}#${v}`)}return{$refs:f,$refText:d}}else if(Hi(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(h=r.$cstNode)==null?void 0:h.text),s){d??(d={...r});const f=this.commentProvider.getComment(r);f&&(d.$comment=f.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=A(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=mH(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(Pg(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=Sn(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},A(Fv,"ValidationRegistry"),Fv),S5e=Object.freeze({validateNode:!0,validateChildren:!0}),zv,E5e=(zv=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=Vn.CancellationToken.None){const i=e.parseResult,a=[];if(await ba(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ul.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ul.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ul.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(Pg(s))throw s;console.error("An error occurred during validation:",s)}return await ba(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const s of i){const o=s.severity??"error",l={severity:lC(o),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:jq(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=dk(i.token);if(a){const s={severity:lC("error"),range:a,message:i.message,data:r0(ul.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const s=a.error;if(s){const o={node:s.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:s.info.property,index:s.info.index,data:{code:ul.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=Vn.CancellationToken.None){const i=[],a=A((s,o,l)=>{i.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=Vn.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await ba(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=Vn.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const o=rc(e).iterator();for(const l of o){s.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const h=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of h)await d(l,n,i)}finally{s.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{s.stop()}}else{const s=rc(e).iterator();for(const o of s){await ba(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return S5e}async validateAstAfter(e,r,n,i=Vn.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await ba(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:Xq(n),severity:lC(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},A(zv,"DefaultDocumentValidator"),zv);function Xq(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=$L(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=yH(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}A(Xq,"getDiagnosticRange");function lC(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}A(lC,"toDiagnosticSeverity");function jq(t){switch(t){case"error":return r0(ul.LexingError);case"warning":return r0(ul.LexingWarning);case"info":return r0(ul.LexingInfo);case"hint":return r0(ul.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}A(jq,"toDiagnosticData");var ul;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(ul||(ul={}));var Vv,A5e=(Vv=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??tc(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=A(()=>s??(s=ex(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:ex(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},A(Vv,"DefaultAstNodeDescriptionProvider"),Vv),Gv,_5e=(Gv=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=Vn.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of rc(i))await ba(r),Zb(a).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];Bs(r)&&r.$nodeDescription?n=[r.$nodeDescription]:Yc(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=tc(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=ex(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:Fs.equals(l.documentUri,i)});return s}},A(Gv,"DefaultReferenceDescriptionProvider"),Gv),Wv,R5e=(Wv=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u==null?void 0:u[l]}return i[a]},e)}},A(Wv,"DefaultAstNodeLocator"),Wv),A7={};TL(A7,CW($x()));var Hv,L5e=(Hv=class{constructor(e){this._ready=new Mh,this.onConfigurationSectionUpdateEmitter=new A7.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},A(Hv,"DefaultConfigurationProvider"),Hv),u4=CW(d1t()),p0;(function(t){function e(r){return{dispose:A(async()=>await r(),"dispose")}}A(e,"create"),t.create=e})(p0||(p0={}));var qv,M5e=(qv=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Ih,this.documentPhaseListeners=new Ih,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Gr.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=Vn.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===Gr.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,Gr.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(s))==null?void 0:i.result}),a.state=Gr.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=Gr.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=Vn.CancellationToken.None){this.currentState=Gr.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const h of u)i.push(h.uri),this.cleanUpDeleted(h)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=Gr.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,Gr.Changed)}const s=Sn(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,Gr.ComputedScopes)),await this.emitUpdate(a,i),await ba(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return Sn(s).filter(u=>!a.has(u)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r=0&&!this.hasTextDocument(e[n]);)n--;rn.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),p0.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case Gr.Changed:case Gr.Parsed:this.indexManager.removeContent(e.uri);case Gr.IndexedContent:e.localSymbols=void 0;case Gr.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Gr.Linked:this.indexManager.removeReferences(e.uri);case Gr.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Gr.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Gr.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,Gr.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,Gr.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,Gr.ComputedScopes,n,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,n)});const i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,Gr.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,Gr.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,Gr.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){for(const s of e)s.states.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),p0.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),p0.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=Vn.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(Vc);if(this.currentState>=e&&e>i.state)return Promise.reject(new u4.ResponseError(u4.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${Gr[i.state]}, requiring ${Gr[e]}, but workspace state is already ${Gr[this.currentState]}. Returning undefined.`))}else return Promise.reject(new u4.ResponseError(u4.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{Fs.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Vc)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(Vc):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(Vc)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await ba(n),await s(e,n)}catch(o){if(!Pg(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await ba(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),a=typeof i.validation=="object"?{...i.validation}:{};a.categories=this.findMissingValidationCategories(e,i);const s=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=Sn(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},A(qv,"DefaultDocumentBuilder"),qv),Uv,I5e=(Uv=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new E7,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=tc(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{Fs.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),Sn(i)}allElements(e,r){let n=Sn(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=Vn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=Vn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}},A(Uv,"DefaultIndexManager"),Uv),Yv,N5e=(Yv=class{constructor(e){this.initialBuildOptions={},this._ready=new Mh,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=Vn.CancellationToken.None){const n=await this.performStartup(e);await ba(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=A(s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));const a=Sn(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Bo.parse(e.uri)}async traverseFolder(e,r){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=Fs.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},A(Yv,"DefaultWorkspaceManager"),Yv),Xv,D5e=(Xv=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return $9.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return $9.buildUnableToPopLexerModeMessage(e)}},A(Xv,"DefaultLexerErrorMessageProvider"),Xv),Kq={mode:"full"},jv,Zq=(jv=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=p6(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Gs(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Kq){var i,a;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(a=(i=this.tokenBuilder).flushLexingReport)==null?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(p6(e))return e;const r=R7(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},A(jv,"DefaultLexer"),jv);function _7(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}A(_7,"isTokenTypeArray");function R7(t){return t&&"modes"in t&&"defaultMode"in t}A(R7,"isIMultiModeLexerDefinition");function p6(t){return!_7(t)&&!R7(t)}A(p6,"isTokenTypeDictionary");SS();function Qq(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=mn.create(0,0));const a=eU(t),s=L7(n),o=O5e({lines:a,position:i,options:s});return B5e({index:0,tokens:o,position:i})}A(Qq,"parseJSDoc");function Jq(t,e){const r=L7(e),n=eU(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}A(Jq,"isJSDoc");function eU(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Fbe)}A(eU,"getLines");var Jre=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,N4t=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function O5e(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o=h.length){if(e.length>0){const p=mn.create(r,n);e.push({type:"break",content:"",range:jr.create(p,p)})}}else{Jre.lastIndex=d;const p=Jre.exec(h);if(p){const g=p[0],m=p[1],y=mn.create(r,n+d),v=mn.create(r,n+d+g.length);e.push({type:"tag",content:m,range:jr.create(y,v)}),d+=g.length,d=g6(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}A(O5e,"tokenize");function $5e(t,e,r,n){const i=[];if(t.length===0){const a=mn.create(r,n),s=mn.create(r,n+e.length);i.push({type:"text",content:e,range:jr.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:jr.create(mn.create(r,a+n),mn.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:jr.create(mn.create(r,a+h+n),mn.create(r,a+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:jr.create(mn.create(r,a+h+n),mn.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:jr.create(mn.create(r,a+h+n),mn.create(r,a+h+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:jr.create(mn.create(r,a+n),mn.create(r,a+n+s.length))})}return i}A($5e,"buildInlineTokens");var D4t=/\S/,O4t=/\s*$/;function g6(t,e){const r=t.substring(e).match(D4t);return r?e+r.index:t.length}A(g6,"skipWhitespace");function P5e(t){const e=t.match(O4t);if(e&&typeof e.index=="number")return e.index}A(P5e,"lastCharacter");function B5e(t){var a,s;const e=mn.create(t.position.line,t.position.character);if(t.tokens.length===0)return new ene([],jr.create(e,e));const r=[];for(;t.indexr.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=iB(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=iB(r)+i}return r.trim()}},A(Kv,"JSDocCommentImpl"),Kv),Zv,yN=(Zv=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} +${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=G5e(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i} +${r}`),this.inline?`{${i}}`:i}},A(Zv,"JSDocTagImpl"),Zv);function G5e(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=g6(e,i);a=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),((n=r.renderLink)==null?void 0:n.call(r,e,a))??W5e(e,a)}}A(G5e,"renderInlineTag");function W5e(t,e){try{return Bo.parse(t,!0),`[${e}](${t})`}catch{return t}}A(W5e,"renderLinkDefault");var Qv,nB=(Qv=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` `)}return e}toMarkdown(e){let r="";for(let n=0;ni.range.start.line&&(r+=` -`)}return r}},A(Qv,"JSDocTextImpl"),Qv),Jv,W5e=(Jv=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},A(Jv,"JSDocLineImpl"),Jv);function iB(t){return t.endsWith(` +`)}return r}},A(Qv,"JSDocTextImpl"),Qv),Jv,H5e=(Jv=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},A(Jv,"JSDocLineImpl"),Jv);function iB(t){return t.endsWith(` `)?` `:` -`}A(iB,"fillNewlines");var e2,H5e=(e2=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&Jq(r))return Qq(r).toMarkdown({renderLink:A((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:A(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const a=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${a},${s}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=tc(e).localSymbols;if(!i)return;let a=e;do{const o=i.getStream(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},A(e2,"JSDocDocumentationProvider"),e2),t2,q5e=(t2=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return Yq(e)?e.$comment:(r=tH(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},A(t2,"DefaultCommentProvider"),t2),r2,U5e=(r2=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},A(r2,"DefaultAsyncParser"),r2),n2,N4t=(n2=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),i=new Mh;let a;const s=r.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(o=>{const l=this.hydrator.hydrate(o);i.resolve(l)}).catch(o=>{i.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),i.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new Mh;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Vc)}),this.queue.push(r),r.promise}},A(n2,"AbstractThreadedAsyncParser"),n2),i2,D4t=(i2=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new A7.Emitter,this.deferred=new Mh,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),n(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(Vc),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new Mh,this.sendMessage(e),this.deferred.promise}},A(i2,"ParserWorker"),i2),a2,Y5e=(a2=class{constructor(){this.previousTokenSource=new zn.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=k7();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=zn.CancellationToken.None){const i=new Mh,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){Pg(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},A(a2,"DefaultWorkspaceLock"),a2),s2,X5e=(s2=class{constructor(e){this.grammarElementIdMap=new d6,this.tokenTypeIdMap=new d6,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of rc(e))r.set(i,{});if(e.$cstNode)for(const i of Jb(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Hi(o)?s.push(this.dehydrateAstNode(o,r)):Bs(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Hi(a)?n[i]=this.dehydrateAstNode(a,r):Bs(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return kL(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Ch(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):vg(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const a of rc(e))r.set(a,{});let i;if(e.$cstNode)for(const a of Jb(e.$cstNode)){let s;"fullText"in a?(s=new Mq(a.fullText),i=s):"content"in a?s=new b7:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Hi(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):Bs(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Hi(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):Bs(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Ch(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new o6(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of rc(this.grammar))SL(r)&&this.grammarElementIdMap.set(r,e++)}},A(s2,"DefaultHydrator"),s2);function La(t){return{documentation:{CommentProvider:A(e=>new q5e(e),"CommentProvider"),DocumentationProvider:A(e=>new H5e(e),"DocumentationProvider")},parser:{AsyncParser:A(e=>new U5e(e),"AsyncParser"),GrammarConfig:A(e=>SH(e),"GrammarConfig"),LangiumParser:A(e=>Pq(e),"LangiumParser"),CompletionParser:A(e=>$q(e),"CompletionParser"),ValueConverter:A(()=>new Fq,"ValueConverter"),TokenBuilder:A(()=>new w7,"TokenBuilder"),Lexer:A(e=>new Zq(e),"Lexer"),ParserErrorMessageProvider:A(()=>new Nq,"ParserErrorMessageProvider"),LexerErrorMessageProvider:A(()=>new N5e,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:A(()=>new _5e,"AstNodeLocator"),AstNodeDescriptionProvider:A(e=>new E5e(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:A(e=>new A5e(e),"ReferenceDescriptionProvider")},references:{Linker:A(e=>new p5e(e),"Linker"),NameProvider:A(()=>new g5e,"NameProvider"),ScopeProvider:A(e=>new x5e(e),"ScopeProvider"),ScopeComputation:A(e=>new y5e(e),"ScopeComputation"),References:A(e=>new m5e(e),"References")},serializer:{Hydrator:A(e=>new X5e(e),"Hydrator"),JsonSerializer:A(e=>new T5e(e),"JsonSerializer")},validation:{DocumentValidator:A(e=>new S5e(e),"DocumentValidator"),ValidationRegistry:A(e=>new C5e(e),"ValidationRegistry")},shared:A(()=>t.shared,"shared")}}A(La,"createDefaultCoreModule");function Ma(t){return{ServiceRegistry:A(e=>new w5e(e),"ServiceRegistry"),workspace:{LangiumDocuments:A(e=>new f5e(e),"LangiumDocuments"),LangiumDocumentFactory:A(e=>new d5e(e),"LangiumDocumentFactory"),DocumentBuilder:A(e=>new L5e(e),"DocumentBuilder"),IndexManager:A(e=>new M5e(e),"IndexManager"),WorkspaceManager:A(e=>new I5e(e),"WorkspaceManager"),FileSystemProvider:A(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:A(()=>new Y5e,"WorkspaceLock"),ConfigurationProvider:A(e=>new R5e(e),"ConfigurationProvider")},profilers:{}}}A(Ma,"createDefaultSharedCoreModule");var aB;(function(t){t.merge=(e,r)=>ix(ix({},e),r)})(aB||(aB={}));function tn(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(ix,{});return aU(u)}A(tn,"inject");var j5e=Symbol("isProxy");function iU(t){if(t&&t[j5e])for(const e of Object.values(t))iU(e);return t}A(iU,"eagerLoad");function aU(t,e){const r=new Proxy({},{deleteProperty:A(()=>!1,"deleteProperty"),set:A(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:A((n,i)=>i===j5e?!0:sB(n,i,t,e||r),"get"),getOwnPropertyDescriptor:A((n,i)=>(sB(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:A((n,i)=>i in t,"has"),ownKeys:A(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}A(aU,"_inject");var ene=Symbol();function sB(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===ene)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=ene;try{t[e]=typeof i=="function"?i(n):aU(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}A(sB,"_resolve");function ix(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=ix(i,n):t[r]=ix({},n)}else t[r]=n}return t}A(ix,"_merge");var oB={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},n0;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(n0||(n0={}));var o2,K5e=(o2=class extends w7{constructor(e=oB){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...oB,...e},this.indentTokenType=Sy({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=Sy({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!_7(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of o)f.name===p?f.PUSH_MODE=n0.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===s?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[n0.REGULAR]:[l,u,...d,h],[n0.IGNORE_INDENTATION]:[...d,h]},defaultMode:n0.REGULAR}:[l,u,h,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r -`.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:(a==null?void 0:a[0].length)??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,r,n,i){const a=this.getLineNumber(r,i);return GS(e,n,i,i+n.length,a,a,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:((d=o==null?void 0:o[0])==null?void 0:d.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,h=((f=e.substring(0,r).match(/[\r\n]+$/))==null?void 0:f[0].length)??1;for(let p=0;p1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},A(o2,"IndentationAwareTokenBuilder"),o2),l2,O4t=(l2=class extends Zq{constructor(e){if(super(e),e.parser.TokenBuilder instanceof K5e)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=Kq){const n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},A(l2,"IndentationAwareLexer"),l2),sU={};Df(sU,{AstUtils:()=>RW,BiMap:()=>d6,Cancellation:()=>zn,ContextCache:()=>E7,CstUtils:()=>EW,DONE_RESULT:()=>Is,Deferred:()=>Mh,Disposable:()=>p0,DisposableCache:()=>S7,DocumentCache:()=>b5e,EMPTY_STREAM:()=>Xb,ErrorWithLocation:()=>IL,GrammarUtils:()=>aH,MultiMap:()=>Ih,OperationCancelled:()=>Vc,Reduction:()=>hk,RegExpUtils:()=>oH,SimpleCache:()=>qq,StreamImpl:()=>zc,TreeStreamImpl:()=>jb,URI:()=>Bo,UriTrie:()=>Wq,UriUtils:()=>Fs,WorkspaceCache:()=>Uq,assertCondition:()=>sH,assertUnreachable:()=>Of,delayNextTick:()=>C7,interruptAndCheck:()=>va,isOperationCancelled:()=>Pg,loadGrammarFromJson:()=>Ia,setInterruptionPeriod:()=>zq,startCancelableOperation:()=>k7,stream:()=>Sn});TL(sU,A7);var c2,Z5e=(c2=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},A(c2,"EmptyFileSystemProvider"),c2),ns={fileSystemProvider:A(()=>new Z5e,"fileSystemProvider")},$4t={Grammar:A(()=>{},"Grammar"),LanguageMetaData:A(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},P4t={AstReflection:A(()=>new KW,"AstReflection")};function Q5e(){const t=tn(Ma(ns),P4t),e=tn(La({shared:t}),$4t);return t.ServiceRegistry.register(e),e}A(Q5e,"createMinimalGrammarServices");function Ia(t){const e=Q5e(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Bo.parse(`memory:/${r.name??"grammar"}.langium`)),r}A(Ia,"loadGrammarFromJson");TL(cbe,sU);var u2,B4t=(u2=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new Ih}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new J5e(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);const n=[];for(const s of r.entries.keys()){const o=r.entries.get(s),l=o.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${s}`,count:o.length,duration:l})}const i=r.duration-n.map(s=>s.duration).reduce((s,o)=>s+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return A(a,"Round"),console.table(n.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/r.duration),"Time (ms)":a(s.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},A(u2,"DefaultLangiumProfiler"),u2),h2,J5e=(h2=class{constructor(e,r){this.stack=[],this.entries=new Ih,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);const n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);const i=n-r.content;this.entries.add(e,i)}},A(h2,"ProfilingTask"),h2),lB;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(lB||(lB={}));var cB;(t=>{t.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(cB||(cB={}));var uB;(t=>{t.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(uB||(uB={}));var hB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(hB||(hB={}));var dB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(dB||(dB={}));var fB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(fB||(fB={}));var pB;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(pB||(pB={}));var gB;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(gB||(gB={}));var mB;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(mB||(mB={}));var yB;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(yB||(yB={}));var vB;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(vB||(vB={}));var bB;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(bB||(bB={}));var xB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(xB||(xB={}));var TB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(TB||(TB={}));var wB;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(wB||(wB={}));({...lB.Terminals,...cB.Terminals,...uB.Terminals,...hB.Terminals,...dB.Terminals,...fB.Terminals,...pB.Terminals,...gB.Terminals,...mB.Terminals,...yB.Terminals,...vB.Terminals,...bB.Terminals,...TB.Terminals,...xB.Terminals,...wB.Terminals});var tne={$type:"AbnfAlternation",alternatives:"alternatives"},rne={$type:"AbnfConcatenation",elements:"elements"},vN={$type:"AbnfElement",primary:"primary",repeat:"repeat"},nne={$type:"AbnfGroup",element:"element"},ine={$type:"AbnfNumVal",value:"value"},ane={$type:"AbnfOptionalGroup",element:"element"},nm={$type:"AbnfPrimary"},bN={$type:"AbnfRule",definition:"definition",name:"name"},sne={$type:"AbnfRuleName",name:"name"},one={$type:"AbnfStringLiteral",value:"value"},h4={$type:"Accelerator",name:"name",x:"x",y:"y"},xN={$type:"Alignment",direction:"direction",members:"members"},d4={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},kT={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},TN={$type:"Annotations",x:"x",y:"y"},Sc={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function F4t(t){return Pi.isInstance(t,Sc.$type)}A(F4t,"isArchitecture");var f4={$type:"Axis",label:"label",name:"name"},G3={$type:"Branch",name:"name",order:"order"};function z4t(t){return Pi.isInstance(t,G3.$type)}A(z4t,"isBranch");var lne={$type:"Checkout",branch:"branch"},p4={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},wN={$type:"ClassDefStatement",className:"className",styleText:"styleText"},_m={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function V4t(t){return Pi.isInstance(t,_m.$type)}A(V4t,"isCommit");var g4={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Qf={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},m4={$type:"Curve",entries:"entries",label:"label",name:"name"},yp={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function G4t(t){return Pi.isInstance(t,yp.$type)}A(G4t,"isCynefin");var y4={$type:"Deaccelerator",name:"name",x:"x",y:"y"},cne={$type:"Decorator",strategy:"strategy"},im={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},W3={$type:"DomainBlock",domain:"domain",items:"items"};function W4t(t){return Pi.isInstance(t,W3.$type)}A(W4t,"isDomainBlock");var CB={$type:"DomainItem",label:"label"};function H4t(t){return Pi.isInstance(t,CB.$type)}A(H4t,"isDomainItem");var une={$type:"EbnfChoice",alternatives:"alternatives"},hne={$type:"EbnfExceptionPostfix",except:"except"},dne={$type:"EbnfGroup",element:"element"},fne={$type:"EbnfNonTerminal",name:"name"},pne={$type:"EbnfOneOrMorePostfix",operator:"operator"},gne={$type:"EbnfOptional",element:"element"},mne={$type:"EbnfOptionalPostfix",operator:"operator"},ST={$type:"EbnfPostfix"},Jf={$type:"EbnfPrimary"},yne={$type:"EbnfRepetition",element:"element"},CN={$type:"EbnfRule",definition:"definition",name:"name"},vne={$type:"EbnfSequence",elements:"elements"},bne={$type:"EbnfSpecial",text:"text"},kN={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},xne={$type:"EbnfTerminal",value:"value"},Tne={$type:"EbnfZeroOrMorePostfix",operator:"operator"},bc={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},am={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},ep={$type:"EmFrame"},ET={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},wne={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},SN={$type:"EmModelEntity",name:"name"};function q4t(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}A(q4t,"isEmModelEntityType");var v4={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},zu={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function eAe(t){return Pi.isInstance(t,zu.$type)}A(eAe,"isEmResetFrame");var od={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},EN={$type:"Entry",axis:"axis",value:"value"},Mu={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},Cne={$type:"Evolution",stages:"stages"},b4={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},AN={$type:"Evolve",component:"component",target:"target"},vp={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function U4t(t){return Pi.isInstance(t,vp.$type)}A(U4t,"isGitGraph");var AT={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},fw={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function Y4t(t){return Pi.isInstance(t,fw.$type)}A(Y4t,"isInfo");var _T={$type:"Item",classSelector:"classSelector",name:"name"},_N={$type:"Junction",id:"id",in:"in"},RT={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},x4={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},tp={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},Rm={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function X4t(t){return Pi.isInstance(t,Rm.$type)}A(X4t,"isMerge");var T4={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},RN={$type:"Option",name:"name",value:"value"},Lm={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function j4t(t){return Pi.isInstance(t,Lm.$type)}A(j4t,"isPacket");var Mm={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function K4t(t){return Pi.isInstance(t,Mm.$type)}A(K4t,"isPacketBlock");var kne={$type:"PegAny",dot:"dot"},Sne={$type:"PegGroup",element:"element"},Ene={$type:"PegIdentifier",name:"name"},Ane={$type:"PegLiteral",value:"value"},_ne={$type:"PegOrderedChoice",alternatives:"alternatives"},LN={$type:"PegPrefix",operator:"operator",suffix:"suffix"},LT={$type:"PegPrimary"},MN={$type:"PegRule",definition:"definition",name:"name"},Rne={$type:"PegSequence",elements:"elements"},IN={$type:"PegSuffix",operator:"operator",primary:"primary"},bp={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function Z4t(t){return Pi.isInstance(t,bp.$type)}A(Z4t,"isPie");var H3={$type:"PieSection",label:"label",value:"value"};function Q4t(t){return Pi.isInstance(t,H3.$type)}A(Q4t,"isPieSection");var NN={$type:"Pipeline",components:"components",parent:"parent"},w4={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},rp={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},Im={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function J4t(t){return Pi.isInstance(t,Im.$type)}A(J4t,"isRailroad");var Nm={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function e3t(t){return Pi.isInstance(t,Nm.$type)}A(e3t,"isRailroadAbnf");var Lne={$type:"RailroadChoiceExpr",alternatives:"alternatives"},Dm={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function t3t(t){return Pi.isInstance(t,Dm.$type)}A(t3t,"isRailroadEbnf");var Iu={$type:"RailroadExpression"},Mne={$type:"RailroadNonTerminalExpr",name:"name"},Ine={$type:"RailroadOneOrMoreExpr",element:"element"},Nne={$type:"RailroadOptionalExpr",element:"element"},Om={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function r3t(t){return Pi.isInstance(t,Om.$type)}A(r3t,"isRailroadPeg");var DN={$type:"RailroadRule",definition:"definition",name:"name"},Dne={$type:"RailroadSequenceExpr",elements:"elements"},One={$type:"RailroadSpecialExpr",text:"text"},$ne={$type:"RailroadTerminalExpr",value:"value"},Pne={$type:"RailroadZeroOrMoreExpr",element:"element"},ON={$type:"Section",classSelector:"classSelector",name:"name"},sm={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},$N={$type:"Size",height:"height",width:"width"},om={$type:"Statement"},pw={$type:"Transition",from:"from",label:"label",to:"to"};function n3t(t){return Pi.isInstance(t,pw.$type)}A(n3t,"isTransition");var $m={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function i3t(t){return Pi.isInstance(t,$m.$type)}A(i3t,"isTreemap");var PN={$type:"TreemapRow",indent:"indent",item:"item"},lm={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},MT={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Fa={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function a3t(t){return Pi.isInstance(t,Fa.$type)}A(a3t,"isWardley");var d2,tAe=(d2=class extends _W{constructor(){super(...arguments),this.types={AbnfAlternation:{name:tne.$type,properties:{alternatives:{name:tne.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:rne.$type,properties:{elements:{name:rne.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:vN.$type,properties:{primary:{name:vN.primary},repeat:{name:vN.repeat}},superTypes:[]},AbnfGroup:{name:nne.$type,properties:{element:{name:nne.element}},superTypes:[nm.$type]},AbnfNumVal:{name:ine.$type,properties:{value:{name:ine.value}},superTypes:[nm.$type]},AbnfOptionalGroup:{name:ane.$type,properties:{element:{name:ane.element}},superTypes:[nm.$type]},AbnfPrimary:{name:nm.$type,properties:{},superTypes:[]},AbnfRule:{name:bN.$type,properties:{definition:{name:bN.definition},name:{name:bN.name}},superTypes:[]},AbnfRuleName:{name:sne.$type,properties:{name:{name:sne.name}},superTypes:[nm.$type]},AbnfStringLiteral:{name:one.$type,properties:{value:{name:one.value}},superTypes:[nm.$type]},Accelerator:{name:h4.$type,properties:{name:{name:h4.name},x:{name:h4.x},y:{name:h4.y}},superTypes:[]},Alignment:{name:xN.$type,properties:{direction:{name:xN.direction},members:{name:xN.members,defaultValue:[]}},superTypes:[]},Anchor:{name:d4.$type,properties:{evolution:{name:d4.evolution},name:{name:d4.name},visibility:{name:d4.visibility}},superTypes:[]},Annotation:{name:kT.$type,properties:{number:{name:kT.number},text:{name:kT.text},x:{name:kT.x},y:{name:kT.y}},superTypes:[]},Annotations:{name:TN.$type,properties:{x:{name:TN.x},y:{name:TN.y}},superTypes:[]},Architecture:{name:Sc.$type,properties:{accDescr:{name:Sc.accDescr},accTitle:{name:Sc.accTitle},alignments:{name:Sc.alignments,defaultValue:[]},edges:{name:Sc.edges,defaultValue:[]},groups:{name:Sc.groups,defaultValue:[]},junctions:{name:Sc.junctions,defaultValue:[]},services:{name:Sc.services,defaultValue:[]},title:{name:Sc.title}},superTypes:[]},Axis:{name:f4.$type,properties:{label:{name:f4.label},name:{name:f4.name}},superTypes:[]},Branch:{name:G3.$type,properties:{name:{name:G3.name},order:{name:G3.order}},superTypes:[om.$type]},Checkout:{name:lne.$type,properties:{branch:{name:lne.branch}},superTypes:[om.$type]},CherryPicking:{name:p4.$type,properties:{id:{name:p4.id},parent:{name:p4.parent},tags:{name:p4.tags,defaultValue:[]}},superTypes:[om.$type]},ClassDefStatement:{name:wN.$type,properties:{className:{name:wN.className},styleText:{name:wN.styleText}},superTypes:[]},Commit:{name:_m.$type,properties:{id:{name:_m.id},message:{name:_m.message},tags:{name:_m.tags,defaultValue:[]},type:{name:_m.type}},superTypes:[om.$type]},Common:{name:g4.$type,properties:{accDescr:{name:g4.accDescr},accTitle:{name:g4.accTitle},title:{name:g4.title}},superTypes:[]},Component:{name:Qf.$type,properties:{decorator:{name:Qf.decorator},evolution:{name:Qf.evolution},inertia:{name:Qf.inertia,defaultValue:!1},label:{name:Qf.label},name:{name:Qf.name},visibility:{name:Qf.visibility}},superTypes:[]},Curve:{name:m4.$type,properties:{entries:{name:m4.entries,defaultValue:[]},label:{name:m4.label},name:{name:m4.name}},superTypes:[]},Cynefin:{name:yp.$type,properties:{accDescr:{name:yp.accDescr},accTitle:{name:yp.accTitle},domains:{name:yp.domains,defaultValue:[]},title:{name:yp.title},transitions:{name:yp.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:y4.$type,properties:{name:{name:y4.name},x:{name:y4.x},y:{name:y4.y}},superTypes:[]},Decorator:{name:cne.$type,properties:{strategy:{name:cne.strategy}},superTypes:[]},Direction:{name:im.$type,properties:{accDescr:{name:im.accDescr},accTitle:{name:im.accTitle},dir:{name:im.dir},statements:{name:im.statements,defaultValue:[]},title:{name:im.title}},superTypes:[vp.$type]},DomainBlock:{name:W3.$type,properties:{domain:{name:W3.domain},items:{name:W3.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:CB.$type,properties:{label:{name:CB.label}},superTypes:[]},EbnfChoice:{name:une.$type,properties:{alternatives:{name:une.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:hne.$type,properties:{except:{name:hne.except}},superTypes:[ST.$type]},EbnfGroup:{name:dne.$type,properties:{element:{name:dne.element}},superTypes:[Jf.$type]},EbnfNonTerminal:{name:fne.$type,properties:{name:{name:fne.name}},superTypes:[Jf.$type]},EbnfOneOrMorePostfix:{name:pne.$type,properties:{operator:{name:pne.operator}},superTypes:[ST.$type]},EbnfOptional:{name:gne.$type,properties:{element:{name:gne.element}},superTypes:[Jf.$type]},EbnfOptionalPostfix:{name:mne.$type,properties:{operator:{name:mne.operator}},superTypes:[ST.$type]},EbnfPostfix:{name:ST.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Jf.$type,properties:{},superTypes:[]},EbnfRepetition:{name:yne.$type,properties:{element:{name:yne.element}},superTypes:[Jf.$type]},EbnfRule:{name:CN.$type,properties:{definition:{name:CN.definition},name:{name:CN.name}},superTypes:[]},EbnfSequence:{name:vne.$type,properties:{elements:{name:vne.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:bne.$type,properties:{text:{name:bne.text}},superTypes:[Jf.$type]},EbnfTerm:{name:kN.$type,properties:{base:{name:kN.base},postfixes:{name:kN.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:xne.$type,properties:{value:{name:xne.value}},superTypes:[Jf.$type]},EbnfZeroOrMorePostfix:{name:Tne.$type,properties:{operator:{name:Tne.operator}},superTypes:[ST.$type]},Edge:{name:bc.$type,properties:{lhsDir:{name:bc.lhsDir},lhsGroup:{name:bc.lhsGroup,defaultValue:!1},lhsId:{name:bc.lhsId},lhsInto:{name:bc.lhsInto,defaultValue:!1},rhsDir:{name:bc.rhsDir},rhsGroup:{name:bc.rhsGroup,defaultValue:!1},rhsId:{name:bc.rhsId},rhsInto:{name:bc.rhsInto,defaultValue:!1},title:{name:bc.title}},superTypes:[]},EmDataEntity:{name:am.$type,properties:{dataBlockValue:{name:am.dataBlockValue},dataType:{name:am.dataType},name:{name:am.name}},superTypes:[]},EmFrame:{name:ep.$type,properties:{},superTypes:[]},EmGwt:{name:ET.$type,properties:{givenStatements:{name:ET.givenStatements,defaultValue:[]},sourceFrame:{name:ET.sourceFrame,referenceType:ep.$type},thenStatements:{name:ET.thenStatements,defaultValue:[]},whenStatements:{name:ET.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:wne.$type,properties:{entityIdentifier:{name:wne.entityIdentifier,referenceType:SN.$type}},superTypes:[]},EmModelEntity:{name:SN.$type,properties:{name:{name:SN.name}},superTypes:[]},EmNoteEntity:{name:v4.$type,properties:{dataBlockValue:{name:v4.dataBlockValue},dataType:{name:v4.dataType},sourceFrame:{name:v4.sourceFrame,referenceType:ep.$type}},superTypes:[]},EmResetFrame:{name:zu.$type,properties:{dataInlineValue:{name:zu.dataInlineValue},dataReference:{name:zu.dataReference,referenceType:am.$type},dataType:{name:zu.dataType},entityIdentifier:{name:zu.entityIdentifier},modelEntityType:{name:zu.modelEntityType},name:{name:zu.name},sourceFrames:{name:zu.sourceFrames,defaultValue:[],referenceType:ep.$type}},superTypes:[ep.$type]},EmTimeFrame:{name:od.$type,properties:{dataInlineValue:{name:od.dataInlineValue},dataReference:{name:od.dataReference,referenceType:am.$type},dataType:{name:od.dataType},entityIdentifier:{name:od.entityIdentifier},modelEntityType:{name:od.modelEntityType},name:{name:od.name},sourceFrames:{name:od.sourceFrames,defaultValue:[],referenceType:ep.$type}},superTypes:[ep.$type]},Entry:{name:EN.$type,properties:{axis:{name:EN.axis,referenceType:f4.$type},value:{name:EN.value}},superTypes:[]},EventModel:{name:Mu.$type,properties:{accDescr:{name:Mu.accDescr},accTitle:{name:Mu.accTitle},dataEntities:{name:Mu.dataEntities,defaultValue:[]},frames:{name:Mu.frames,defaultValue:[]},gwtEntities:{name:Mu.gwtEntities,defaultValue:[]},modelEntities:{name:Mu.modelEntities,defaultValue:[]},noteEntities:{name:Mu.noteEntities,defaultValue:[]},title:{name:Mu.title}},superTypes:[]},Evolution:{name:Cne.$type,properties:{stages:{name:Cne.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:b4.$type,properties:{boundary:{name:b4.boundary},name:{name:b4.name},secondName:{name:b4.secondName}},superTypes:[]},Evolve:{name:AN.$type,properties:{component:{name:AN.component},target:{name:AN.target}},superTypes:[]},GitGraph:{name:vp.$type,properties:{accDescr:{name:vp.accDescr},accTitle:{name:vp.accTitle},statements:{name:vp.statements,defaultValue:[]},title:{name:vp.title}},superTypes:[]},Group:{name:AT.$type,properties:{icon:{name:AT.icon},id:{name:AT.id},in:{name:AT.in},title:{name:AT.title}},superTypes:[]},Info:{name:fw.$type,properties:{accDescr:{name:fw.accDescr},accTitle:{name:fw.accTitle},title:{name:fw.title}},superTypes:[]},Item:{name:_T.$type,properties:{classSelector:{name:_T.classSelector},name:{name:_T.name}},superTypes:[]},Junction:{name:_N.$type,properties:{id:{name:_N.id},in:{name:_N.in}},superTypes:[]},Label:{name:RT.$type,properties:{negX:{name:RT.negX,defaultValue:!1},negY:{name:RT.negY,defaultValue:!1},offsetX:{name:RT.offsetX},offsetY:{name:RT.offsetY}},superTypes:[]},Leaf:{name:x4.$type,properties:{classSelector:{name:x4.classSelector},name:{name:x4.name},value:{name:x4.value}},superTypes:[_T.$type]},Link:{name:tp.$type,properties:{arrow:{name:tp.arrow},from:{name:tp.from},fromPort:{name:tp.fromPort},linkLabel:{name:tp.linkLabel},to:{name:tp.to},toPort:{name:tp.toPort}},superTypes:[]},Merge:{name:Rm.$type,properties:{branch:{name:Rm.branch},id:{name:Rm.id},tags:{name:Rm.tags,defaultValue:[]},type:{name:Rm.type}},superTypes:[om.$type]},Note:{name:T4.$type,properties:{evolution:{name:T4.evolution},text:{name:T4.text},visibility:{name:T4.visibility}},superTypes:[]},Option:{name:RN.$type,properties:{name:{name:RN.name},value:{name:RN.value,defaultValue:!1}},superTypes:[]},Packet:{name:Lm.$type,properties:{accDescr:{name:Lm.accDescr},accTitle:{name:Lm.accTitle},blocks:{name:Lm.blocks,defaultValue:[]},title:{name:Lm.title}},superTypes:[]},PacketBlock:{name:Mm.$type,properties:{bits:{name:Mm.bits},end:{name:Mm.end},label:{name:Mm.label},start:{name:Mm.start}},superTypes:[]},PegAny:{name:kne.$type,properties:{dot:{name:kne.dot}},superTypes:[LT.$type]},PegGroup:{name:Sne.$type,properties:{element:{name:Sne.element}},superTypes:[LT.$type]},PegIdentifier:{name:Ene.$type,properties:{name:{name:Ene.name}},superTypes:[LT.$type]},PegLiteral:{name:Ane.$type,properties:{value:{name:Ane.value}},superTypes:[LT.$type]},PegOrderedChoice:{name:_ne.$type,properties:{alternatives:{name:_ne.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:LN.$type,properties:{operator:{name:LN.operator},suffix:{name:LN.suffix}},superTypes:[]},PegPrimary:{name:LT.$type,properties:{},superTypes:[]},PegRule:{name:MN.$type,properties:{definition:{name:MN.definition},name:{name:MN.name}},superTypes:[]},PegSequence:{name:Rne.$type,properties:{elements:{name:Rne.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:IN.$type,properties:{operator:{name:IN.operator},primary:{name:IN.primary}},superTypes:[]},Pie:{name:bp.$type,properties:{accDescr:{name:bp.accDescr},accTitle:{name:bp.accTitle},sections:{name:bp.sections,defaultValue:[]},showData:{name:bp.showData,defaultValue:!1},title:{name:bp.title}},superTypes:[]},PieSection:{name:H3.$type,properties:{label:{name:H3.label},value:{name:H3.value}},superTypes:[]},Pipeline:{name:NN.$type,properties:{components:{name:NN.components,defaultValue:[]},parent:{name:NN.parent}},superTypes:[]},PipelineComponent:{name:w4.$type,properties:{evolution:{name:w4.evolution},label:{name:w4.label},name:{name:w4.name}},superTypes:[]},Radar:{name:rp.$type,properties:{accDescr:{name:rp.accDescr},accTitle:{name:rp.accTitle},axes:{name:rp.axes,defaultValue:[]},curves:{name:rp.curves,defaultValue:[]},options:{name:rp.options,defaultValue:[]},title:{name:rp.title}},superTypes:[]},Railroad:{name:Im.$type,properties:{accDescr:{name:Im.accDescr},accTitle:{name:Im.accTitle},rules:{name:Im.rules,defaultValue:[]},title:{name:Im.title}},superTypes:[]},RailroadAbnf:{name:Nm.$type,properties:{accDescr:{name:Nm.accDescr},accTitle:{name:Nm.accTitle},rules:{name:Nm.rules,defaultValue:[]},title:{name:Nm.title}},superTypes:[]},RailroadChoiceExpr:{name:Lne.$type,properties:{alternatives:{name:Lne.alternatives,defaultValue:[]}},superTypes:[Iu.$type]},RailroadEbnf:{name:Dm.$type,properties:{accDescr:{name:Dm.accDescr},accTitle:{name:Dm.accTitle},rules:{name:Dm.rules,defaultValue:[]},title:{name:Dm.title}},superTypes:[]},RailroadExpression:{name:Iu.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:Mne.$type,properties:{name:{name:Mne.name}},superTypes:[Iu.$type]},RailroadOneOrMoreExpr:{name:Ine.$type,properties:{element:{name:Ine.element}},superTypes:[Iu.$type]},RailroadOptionalExpr:{name:Nne.$type,properties:{element:{name:Nne.element}},superTypes:[Iu.$type]},RailroadPeg:{name:Om.$type,properties:{accDescr:{name:Om.accDescr},accTitle:{name:Om.accTitle},rules:{name:Om.rules,defaultValue:[]},title:{name:Om.title}},superTypes:[]},RailroadRule:{name:DN.$type,properties:{definition:{name:DN.definition},name:{name:DN.name}},superTypes:[]},RailroadSequenceExpr:{name:Dne.$type,properties:{elements:{name:Dne.elements,defaultValue:[]}},superTypes:[Iu.$type]},RailroadSpecialExpr:{name:One.$type,properties:{text:{name:One.text}},superTypes:[Iu.$type]},RailroadTerminalExpr:{name:$ne.$type,properties:{value:{name:$ne.value}},superTypes:[Iu.$type]},RailroadZeroOrMoreExpr:{name:Pne.$type,properties:{element:{name:Pne.element}},superTypes:[Iu.$type]},Section:{name:ON.$type,properties:{classSelector:{name:ON.classSelector},name:{name:ON.name}},superTypes:[_T.$type]},Service:{name:sm.$type,properties:{icon:{name:sm.icon},iconText:{name:sm.iconText},id:{name:sm.id},in:{name:sm.in},title:{name:sm.title}},superTypes:[]},Size:{name:$N.$type,properties:{height:{name:$N.height},width:{name:$N.width}},superTypes:[]},Statement:{name:om.$type,properties:{},superTypes:[]},Transition:{name:pw.$type,properties:{from:{name:pw.from},label:{name:pw.label},to:{name:pw.to}},superTypes:[]},TreeNode:{name:lm.$type,properties:{classAnnotation:{name:lm.classAnnotation},descAnnotation:{name:lm.descAnnotation},iconAnnotation:{name:lm.iconAnnotation},indent:{name:lm.indent},name:{name:lm.name}},superTypes:[]},TreeView:{name:MT.$type,properties:{accDescr:{name:MT.accDescr},accTitle:{name:MT.accTitle},nodes:{name:MT.nodes,defaultValue:[]},title:{name:MT.title}},superTypes:[]},Treemap:{name:$m.$type,properties:{accDescr:{name:$m.accDescr},accTitle:{name:$m.accTitle},title:{name:$m.title},TreemapRows:{name:$m.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:PN.$type,properties:{indent:{name:PN.indent},item:{name:PN.item}},superTypes:[]},Wardley:{name:Fa.$type,properties:{accDescr:{name:Fa.accDescr},accelerators:{name:Fa.accelerators,defaultValue:[]},accTitle:{name:Fa.accTitle},anchors:{name:Fa.anchors,defaultValue:[]},annotation:{name:Fa.annotation,defaultValue:[]},annotations:{name:Fa.annotations,defaultValue:[]},components:{name:Fa.components,defaultValue:[]},deaccelerators:{name:Fa.deaccelerators,defaultValue:[]},evolution:{name:Fa.evolution},evolves:{name:Fa.evolves,defaultValue:[]},links:{name:Fa.links,defaultValue:[]},notes:{name:Fa.notes,defaultValue:[]},pipelines:{name:Fa.pipelines,defaultValue:[]},size:{name:Fa.size},title:{name:Fa.title}},superTypes:[]}}}},A(d2,"MermaidAstReflection"),d2),Pi=new tAe,Bne,s3t=A(()=>Bne??(Bne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),Fne,o3t=A(()=>Fne??(Fne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),zne,l3t=A(()=>zne??(zne=Ia('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),Vne,c3t=A(()=>Vne??(Vne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),Gne,u3t=A(()=>Gne??(Gne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),Wne,h3t=A(()=>Wne??(Wne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),Hne,d3t=A(()=>Hne??(Hne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),qne,f3t=A(()=>qne??(qne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),Une,p3t=A(()=>Une??(Une=Ia('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),Yne,g3t=A(()=>Yne??(Yne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),Xne,m3t=A(()=>Xne??(Xne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),jne,y3t=A(()=>jne??(jne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),Kne,v3t=A(()=>Kne??(Kne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),Zne,b3t=A(()=>Zne??(Zne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),Qne,x3t=A(()=>Qne??(Qne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),T3t={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},w3t={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},C3t={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},k3t={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},S3t={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},E3t={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},A3t={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},_3t={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},R3t={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},L3t={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},M3t={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},I3t={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},N3t={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},D3t={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},O3t={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ro={AstReflection:A(()=>new tAe,"AstReflection")},$3t={Grammar:A(()=>s3t(),"Grammar"),LanguageMetaData:A(()=>T3t,"LanguageMetaData"),parser:{}},P3t={Grammar:A(()=>o3t(),"Grammar"),LanguageMetaData:A(()=>w3t,"LanguageMetaData"),parser:{}},B3t={Grammar:A(()=>l3t(),"Grammar"),LanguageMetaData:A(()=>C3t,"LanguageMetaData"),parser:{}},F3t={Grammar:A(()=>c3t(),"Grammar"),LanguageMetaData:A(()=>k3t,"LanguageMetaData"),parser:{}},z3t={Grammar:A(()=>u3t(),"Grammar"),LanguageMetaData:A(()=>S3t,"LanguageMetaData"),parser:{}},V3t={Grammar:A(()=>h3t(),"Grammar"),LanguageMetaData:A(()=>E3t,"LanguageMetaData"),parser:{}},G3t={Grammar:A(()=>d3t(),"Grammar"),LanguageMetaData:A(()=>A3t,"LanguageMetaData"),parser:{}},W3t={Grammar:A(()=>f3t(),"Grammar"),LanguageMetaData:A(()=>_3t,"LanguageMetaData"),parser:{}},H3t={Grammar:A(()=>p3t(),"Grammar"),LanguageMetaData:A(()=>R3t,"LanguageMetaData"),parser:{}},q3t={Grammar:A(()=>g3t(),"Grammar"),LanguageMetaData:A(()=>L3t,"LanguageMetaData"),parser:{}},U3t={Grammar:A(()=>m3t(),"Grammar"),LanguageMetaData:A(()=>M3t,"LanguageMetaData"),parser:{}},Y3t={Grammar:A(()=>y3t(),"Grammar"),LanguageMetaData:A(()=>I3t,"LanguageMetaData"),parser:{}},X3t={Grammar:A(()=>v3t(),"Grammar"),LanguageMetaData:A(()=>N3t,"LanguageMetaData"),parser:{}},j3t={Grammar:A(()=>b3t(),"Grammar"),LanguageMetaData:A(()=>D3t,"LanguageMetaData"),parser:{}},K3t={Grammar:A(()=>x3t(),"Grammar"),LanguageMetaData:A(()=>O3t,"LanguageMetaData"),parser:{}},Z3t=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,Q3t=/accTitle[\t ]*:([^\n\r]*)/,J3t=/title([\t ][^\n\r]*|)/,e5t={ACC_DESCR:Z3t,ACC_TITLE:Q3t,TITLE:J3t},f2,vu=(f2=class extends Fq{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=e5t[e.name];if(i===void 0)return;const a=i.exec(r);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` +`}A(iB,"fillNewlines");var e2,q5e=(e2=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&Jq(r))return Qq(r).toMarkdown({renderLink:A((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:A(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const a=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${a},${s}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=tc(e).localSymbols;if(!i)return;let a=e;do{const o=i.getStream(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},A(e2,"JSDocDocumentationProvider"),e2),t2,U5e=(t2=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return Yq(e)?e.$comment:(r=tH(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},A(t2,"DefaultCommentProvider"),t2),r2,Y5e=(r2=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},A(r2,"DefaultAsyncParser"),r2),n2,$4t=(n2=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),i=new Mh;let a;const s=r.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(o=>{const l=this.hydrator.hydrate(o);i.resolve(l)}).catch(o=>{i.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),i.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new Mh;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Vc)}),this.queue.push(r),r.promise}},A(n2,"AbstractThreadedAsyncParser"),n2),i2,P4t=(i2=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new A7.Emitter,this.deferred=new Mh,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),n(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(Vc),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new Mh,this.sendMessage(e),this.deferred.promise}},A(i2,"ParserWorker"),i2),a2,X5e=(a2=class{constructor(){this.previousTokenSource=new Vn.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=k7();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=Vn.CancellationToken.None){const i=new Mh,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){Pg(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},A(a2,"DefaultWorkspaceLock"),a2),s2,j5e=(s2=class{constructor(e){this.grammarElementIdMap=new d6,this.tokenTypeIdMap=new d6,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of rc(e))r.set(i,{});if(e.$cstNode)for(const i of Jb(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Hi(o)?s.push(this.dehydrateAstNode(o,r)):Bs(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Hi(a)?n[i]=this.dehydrateAstNode(a,r):Bs(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return kL(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Ch(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):vg(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const a of rc(e))r.set(a,{});let i;if(e.$cstNode)for(const a of Jb(e.$cstNode)){let s;"fullText"in a?(s=new Mq(a.fullText),i=s):"content"in a?s=new b7:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Hi(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):Bs(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Hi(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):Bs(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Ch(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new o6(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of rc(this.grammar))SL(r)&&this.grammarElementIdMap.set(r,e++)}},A(s2,"DefaultHydrator"),s2);function La(t){return{documentation:{CommentProvider:A(e=>new U5e(e),"CommentProvider"),DocumentationProvider:A(e=>new q5e(e),"DocumentationProvider")},parser:{AsyncParser:A(e=>new Y5e(e),"AsyncParser"),GrammarConfig:A(e=>SH(e),"GrammarConfig"),LangiumParser:A(e=>Pq(e),"LangiumParser"),CompletionParser:A(e=>$q(e),"CompletionParser"),ValueConverter:A(()=>new Fq,"ValueConverter"),TokenBuilder:A(()=>new w7,"TokenBuilder"),Lexer:A(e=>new Zq(e),"Lexer"),ParserErrorMessageProvider:A(()=>new Nq,"ParserErrorMessageProvider"),LexerErrorMessageProvider:A(()=>new D5e,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:A(()=>new R5e,"AstNodeLocator"),AstNodeDescriptionProvider:A(e=>new A5e(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:A(e=>new _5e(e),"ReferenceDescriptionProvider")},references:{Linker:A(e=>new g5e(e),"Linker"),NameProvider:A(()=>new m5e,"NameProvider"),ScopeProvider:A(e=>new T5e(e),"ScopeProvider"),ScopeComputation:A(e=>new v5e(e),"ScopeComputation"),References:A(e=>new y5e(e),"References")},serializer:{Hydrator:A(e=>new j5e(e),"Hydrator"),JsonSerializer:A(e=>new w5e(e),"JsonSerializer")},validation:{DocumentValidator:A(e=>new E5e(e),"DocumentValidator"),ValidationRegistry:A(e=>new k5e(e),"ValidationRegistry")},shared:A(()=>t.shared,"shared")}}A(La,"createDefaultCoreModule");function Ma(t){return{ServiceRegistry:A(e=>new C5e(e),"ServiceRegistry"),workspace:{LangiumDocuments:A(e=>new p5e(e),"LangiumDocuments"),LangiumDocumentFactory:A(e=>new f5e(e),"LangiumDocumentFactory"),DocumentBuilder:A(e=>new M5e(e),"DocumentBuilder"),IndexManager:A(e=>new I5e(e),"IndexManager"),WorkspaceManager:A(e=>new N5e(e),"WorkspaceManager"),FileSystemProvider:A(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:A(()=>new X5e,"WorkspaceLock"),ConfigurationProvider:A(e=>new L5e(e),"ConfigurationProvider")},profilers:{}}}A(Ma,"createDefaultSharedCoreModule");var aB;(function(t){t.merge=(e,r)=>ix(ix({},e),r)})(aB||(aB={}));function tn(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(ix,{});return aU(u)}A(tn,"inject");var K5e=Symbol("isProxy");function iU(t){if(t&&t[K5e])for(const e of Object.values(t))iU(e);return t}A(iU,"eagerLoad");function aU(t,e){const r=new Proxy({},{deleteProperty:A(()=>!1,"deleteProperty"),set:A(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:A((n,i)=>i===K5e?!0:sB(n,i,t,e||r),"get"),getOwnPropertyDescriptor:A((n,i)=>(sB(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:A((n,i)=>i in t,"has"),ownKeys:A(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}A(aU,"_inject");var tne=Symbol();function sB(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===tne)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=tne;try{t[e]=typeof i=="function"?i(n):aU(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}A(sB,"_resolve");function ix(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=ix(i,n):t[r]=ix({},n)}else t[r]=n}return t}A(ix,"_merge");var oB={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},n0;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(n0||(n0={}));var o2,Z5e=(o2=class extends w7{constructor(e=oB){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...oB,...e},this.indentTokenType=Sy({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=Sy({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!_7(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of o)f.name===p?f.PUSH_MODE=n0.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===s?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[n0.REGULAR]:[l,u,...d,h],[n0.IGNORE_INDENTATION]:[...d,h]},defaultMode:n0.REGULAR}:[l,u,h,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r +`.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:(a==null?void 0:a[0].length)??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,r,n,i){const a=this.getLineNumber(r,i);return GS(e,n,i,i+n.length,a,a,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:((d=o==null?void 0:o[0])==null?void 0:d.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,h=((f=e.substring(0,r).match(/[\r\n]+$/))==null?void 0:f[0].length)??1;for(let p=0;p1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},A(o2,"IndentationAwareTokenBuilder"),o2),l2,B4t=(l2=class extends Zq{constructor(e){if(super(e),e.parser.TokenBuilder instanceof Z5e)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=Kq){const n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},A(l2,"IndentationAwareLexer"),l2),sU={};Df(sU,{AstUtils:()=>RW,BiMap:()=>d6,Cancellation:()=>Vn,ContextCache:()=>E7,CstUtils:()=>EW,DONE_RESULT:()=>Is,Deferred:()=>Mh,Disposable:()=>p0,DisposableCache:()=>S7,DocumentCache:()=>x5e,EMPTY_STREAM:()=>Xb,ErrorWithLocation:()=>IL,GrammarUtils:()=>aH,MultiMap:()=>Ih,OperationCancelled:()=>Vc,Reduction:()=>hk,RegExpUtils:()=>oH,SimpleCache:()=>qq,StreamImpl:()=>zc,TreeStreamImpl:()=>jb,URI:()=>Bo,UriTrie:()=>Wq,UriUtils:()=>Fs,WorkspaceCache:()=>Uq,assertCondition:()=>sH,assertUnreachable:()=>Of,delayNextTick:()=>C7,interruptAndCheck:()=>ba,isOperationCancelled:()=>Pg,loadGrammarFromJson:()=>Ia,setInterruptionPeriod:()=>zq,startCancelableOperation:()=>k7,stream:()=>Sn});TL(sU,A7);var c2,Q5e=(c2=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},A(c2,"EmptyFileSystemProvider"),c2),ns={fileSystemProvider:A(()=>new Q5e,"fileSystemProvider")},F4t={Grammar:A(()=>{},"Grammar"),LanguageMetaData:A(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},z4t={AstReflection:A(()=>new KW,"AstReflection")};function J5e(){const t=tn(Ma(ns),z4t),e=tn(La({shared:t}),F4t);return t.ServiceRegistry.register(e),e}A(J5e,"createMinimalGrammarServices");function Ia(t){const e=J5e(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Bo.parse(`memory:/${r.name??"grammar"}.langium`)),r}A(Ia,"loadGrammarFromJson");TL(ube,sU);var u2,V4t=(u2=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new Ih}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new eAe(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);const n=[];for(const s of r.entries.keys()){const o=r.entries.get(s),l=o.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${s}`,count:o.length,duration:l})}const i=r.duration-n.map(s=>s.duration).reduce((s,o)=>s+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return A(a,"Round"),console.table(n.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/r.duration),"Time (ms)":a(s.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},A(u2,"DefaultLangiumProfiler"),u2),h2,eAe=(h2=class{constructor(e,r){this.stack=[],this.entries=new Ih,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);const n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);const i=n-r.content;this.entries.add(e,i)}},A(h2,"ProfilingTask"),h2),lB;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(lB||(lB={}));var cB;(t=>{t.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(cB||(cB={}));var uB;(t=>{t.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(uB||(uB={}));var hB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(hB||(hB={}));var dB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(dB||(dB={}));var fB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(fB||(fB={}));var pB;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(pB||(pB={}));var gB;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(gB||(gB={}));var mB;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(mB||(mB={}));var yB;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(yB||(yB={}));var vB;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(vB||(vB={}));var bB;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(bB||(bB={}));var xB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(xB||(xB={}));var TB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(TB||(TB={}));var wB;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(wB||(wB={}));({...lB.Terminals,...cB.Terminals,...uB.Terminals,...hB.Terminals,...dB.Terminals,...fB.Terminals,...pB.Terminals,...gB.Terminals,...mB.Terminals,...yB.Terminals,...vB.Terminals,...bB.Terminals,...TB.Terminals,...xB.Terminals,...wB.Terminals});var rne={$type:"AbnfAlternation",alternatives:"alternatives"},nne={$type:"AbnfConcatenation",elements:"elements"},vN={$type:"AbnfElement",primary:"primary",repeat:"repeat"},ine={$type:"AbnfGroup",element:"element"},ane={$type:"AbnfNumVal",value:"value"},sne={$type:"AbnfOptionalGroup",element:"element"},nm={$type:"AbnfPrimary"},bN={$type:"AbnfRule",definition:"definition",name:"name"},one={$type:"AbnfRuleName",name:"name"},lne={$type:"AbnfStringLiteral",value:"value"},h4={$type:"Accelerator",name:"name",x:"x",y:"y"},xN={$type:"Alignment",direction:"direction",members:"members"},d4={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},kT={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},TN={$type:"Annotations",x:"x",y:"y"},Sc={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function G4t(t){return Pi.isInstance(t,Sc.$type)}A(G4t,"isArchitecture");var f4={$type:"Axis",label:"label",name:"name"},G3={$type:"Branch",name:"name",order:"order"};function W4t(t){return Pi.isInstance(t,G3.$type)}A(W4t,"isBranch");var cne={$type:"Checkout",branch:"branch"},p4={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},wN={$type:"ClassDefStatement",className:"className",styleText:"styleText"},_m={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function H4t(t){return Pi.isInstance(t,_m.$type)}A(H4t,"isCommit");var g4={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Qf={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},m4={$type:"Curve",entries:"entries",label:"label",name:"name"},yp={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function q4t(t){return Pi.isInstance(t,yp.$type)}A(q4t,"isCynefin");var y4={$type:"Deaccelerator",name:"name",x:"x",y:"y"},une={$type:"Decorator",strategy:"strategy"},im={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},W3={$type:"DomainBlock",domain:"domain",items:"items"};function U4t(t){return Pi.isInstance(t,W3.$type)}A(U4t,"isDomainBlock");var CB={$type:"DomainItem",label:"label"};function Y4t(t){return Pi.isInstance(t,CB.$type)}A(Y4t,"isDomainItem");var hne={$type:"EbnfChoice",alternatives:"alternatives"},dne={$type:"EbnfExceptionPostfix",except:"except"},fne={$type:"EbnfGroup",element:"element"},pne={$type:"EbnfNonTerminal",name:"name"},gne={$type:"EbnfOneOrMorePostfix",operator:"operator"},mne={$type:"EbnfOptional",element:"element"},yne={$type:"EbnfOptionalPostfix",operator:"operator"},ST={$type:"EbnfPostfix"},Jf={$type:"EbnfPrimary"},vne={$type:"EbnfRepetition",element:"element"},CN={$type:"EbnfRule",definition:"definition",name:"name"},bne={$type:"EbnfSequence",elements:"elements"},xne={$type:"EbnfSpecial",text:"text"},kN={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},Tne={$type:"EbnfTerminal",value:"value"},wne={$type:"EbnfZeroOrMorePostfix",operator:"operator"},bc={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},am={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},ep={$type:"EmFrame"},ET={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},Cne={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},SN={$type:"EmModelEntity",name:"name"};function X4t(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}A(X4t,"isEmModelEntityType");var v4={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},zu={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function tAe(t){return Pi.isInstance(t,zu.$type)}A(tAe,"isEmResetFrame");var od={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},EN={$type:"Entry",axis:"axis",value:"value"},Mu={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},kne={$type:"Evolution",stages:"stages"},b4={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},AN={$type:"Evolve",component:"component",target:"target"},vp={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function j4t(t){return Pi.isInstance(t,vp.$type)}A(j4t,"isGitGraph");var AT={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},fw={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function K4t(t){return Pi.isInstance(t,fw.$type)}A(K4t,"isInfo");var _T={$type:"Item",classSelector:"classSelector",name:"name"},_N={$type:"Junction",id:"id",in:"in"},RT={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},x4={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},tp={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},Rm={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function Z4t(t){return Pi.isInstance(t,Rm.$type)}A(Z4t,"isMerge");var T4={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},RN={$type:"Option",name:"name",value:"value"},Lm={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function Q4t(t){return Pi.isInstance(t,Lm.$type)}A(Q4t,"isPacket");var Mm={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function J4t(t){return Pi.isInstance(t,Mm.$type)}A(J4t,"isPacketBlock");var Sne={$type:"PegAny",dot:"dot"},Ene={$type:"PegGroup",element:"element"},Ane={$type:"PegIdentifier",name:"name"},_ne={$type:"PegLiteral",value:"value"},Rne={$type:"PegOrderedChoice",alternatives:"alternatives"},LN={$type:"PegPrefix",operator:"operator",suffix:"suffix"},LT={$type:"PegPrimary"},MN={$type:"PegRule",definition:"definition",name:"name"},Lne={$type:"PegSequence",elements:"elements"},IN={$type:"PegSuffix",operator:"operator",primary:"primary"},bp={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function e3t(t){return Pi.isInstance(t,bp.$type)}A(e3t,"isPie");var H3={$type:"PieSection",label:"label",value:"value"};function t3t(t){return Pi.isInstance(t,H3.$type)}A(t3t,"isPieSection");var NN={$type:"Pipeline",components:"components",parent:"parent"},w4={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},rp={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},Im={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function r3t(t){return Pi.isInstance(t,Im.$type)}A(r3t,"isRailroad");var Nm={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function n3t(t){return Pi.isInstance(t,Nm.$type)}A(n3t,"isRailroadAbnf");var Mne={$type:"RailroadChoiceExpr",alternatives:"alternatives"},Dm={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function i3t(t){return Pi.isInstance(t,Dm.$type)}A(i3t,"isRailroadEbnf");var Iu={$type:"RailroadExpression"},Ine={$type:"RailroadNonTerminalExpr",name:"name"},Nne={$type:"RailroadOneOrMoreExpr",element:"element"},Dne={$type:"RailroadOptionalExpr",element:"element"},Om={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function a3t(t){return Pi.isInstance(t,Om.$type)}A(a3t,"isRailroadPeg");var DN={$type:"RailroadRule",definition:"definition",name:"name"},One={$type:"RailroadSequenceExpr",elements:"elements"},$ne={$type:"RailroadSpecialExpr",text:"text"},Pne={$type:"RailroadTerminalExpr",value:"value"},Bne={$type:"RailroadZeroOrMoreExpr",element:"element"},ON={$type:"Section",classSelector:"classSelector",name:"name"},sm={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},$N={$type:"Size",height:"height",width:"width"},om={$type:"Statement"},pw={$type:"Transition",from:"from",label:"label",to:"to"};function s3t(t){return Pi.isInstance(t,pw.$type)}A(s3t,"isTransition");var $m={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function o3t(t){return Pi.isInstance(t,$m.$type)}A(o3t,"isTreemap");var PN={$type:"TreemapRow",indent:"indent",item:"item"},lm={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},MT={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Fa={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function l3t(t){return Pi.isInstance(t,Fa.$type)}A(l3t,"isWardley");var d2,rAe=(d2=class extends _W{constructor(){super(...arguments),this.types={AbnfAlternation:{name:rne.$type,properties:{alternatives:{name:rne.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:nne.$type,properties:{elements:{name:nne.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:vN.$type,properties:{primary:{name:vN.primary},repeat:{name:vN.repeat}},superTypes:[]},AbnfGroup:{name:ine.$type,properties:{element:{name:ine.element}},superTypes:[nm.$type]},AbnfNumVal:{name:ane.$type,properties:{value:{name:ane.value}},superTypes:[nm.$type]},AbnfOptionalGroup:{name:sne.$type,properties:{element:{name:sne.element}},superTypes:[nm.$type]},AbnfPrimary:{name:nm.$type,properties:{},superTypes:[]},AbnfRule:{name:bN.$type,properties:{definition:{name:bN.definition},name:{name:bN.name}},superTypes:[]},AbnfRuleName:{name:one.$type,properties:{name:{name:one.name}},superTypes:[nm.$type]},AbnfStringLiteral:{name:lne.$type,properties:{value:{name:lne.value}},superTypes:[nm.$type]},Accelerator:{name:h4.$type,properties:{name:{name:h4.name},x:{name:h4.x},y:{name:h4.y}},superTypes:[]},Alignment:{name:xN.$type,properties:{direction:{name:xN.direction},members:{name:xN.members,defaultValue:[]}},superTypes:[]},Anchor:{name:d4.$type,properties:{evolution:{name:d4.evolution},name:{name:d4.name},visibility:{name:d4.visibility}},superTypes:[]},Annotation:{name:kT.$type,properties:{number:{name:kT.number},text:{name:kT.text},x:{name:kT.x},y:{name:kT.y}},superTypes:[]},Annotations:{name:TN.$type,properties:{x:{name:TN.x},y:{name:TN.y}},superTypes:[]},Architecture:{name:Sc.$type,properties:{accDescr:{name:Sc.accDescr},accTitle:{name:Sc.accTitle},alignments:{name:Sc.alignments,defaultValue:[]},edges:{name:Sc.edges,defaultValue:[]},groups:{name:Sc.groups,defaultValue:[]},junctions:{name:Sc.junctions,defaultValue:[]},services:{name:Sc.services,defaultValue:[]},title:{name:Sc.title}},superTypes:[]},Axis:{name:f4.$type,properties:{label:{name:f4.label},name:{name:f4.name}},superTypes:[]},Branch:{name:G3.$type,properties:{name:{name:G3.name},order:{name:G3.order}},superTypes:[om.$type]},Checkout:{name:cne.$type,properties:{branch:{name:cne.branch}},superTypes:[om.$type]},CherryPicking:{name:p4.$type,properties:{id:{name:p4.id},parent:{name:p4.parent},tags:{name:p4.tags,defaultValue:[]}},superTypes:[om.$type]},ClassDefStatement:{name:wN.$type,properties:{className:{name:wN.className},styleText:{name:wN.styleText}},superTypes:[]},Commit:{name:_m.$type,properties:{id:{name:_m.id},message:{name:_m.message},tags:{name:_m.tags,defaultValue:[]},type:{name:_m.type}},superTypes:[om.$type]},Common:{name:g4.$type,properties:{accDescr:{name:g4.accDescr},accTitle:{name:g4.accTitle},title:{name:g4.title}},superTypes:[]},Component:{name:Qf.$type,properties:{decorator:{name:Qf.decorator},evolution:{name:Qf.evolution},inertia:{name:Qf.inertia,defaultValue:!1},label:{name:Qf.label},name:{name:Qf.name},visibility:{name:Qf.visibility}},superTypes:[]},Curve:{name:m4.$type,properties:{entries:{name:m4.entries,defaultValue:[]},label:{name:m4.label},name:{name:m4.name}},superTypes:[]},Cynefin:{name:yp.$type,properties:{accDescr:{name:yp.accDescr},accTitle:{name:yp.accTitle},domains:{name:yp.domains,defaultValue:[]},title:{name:yp.title},transitions:{name:yp.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:y4.$type,properties:{name:{name:y4.name},x:{name:y4.x},y:{name:y4.y}},superTypes:[]},Decorator:{name:une.$type,properties:{strategy:{name:une.strategy}},superTypes:[]},Direction:{name:im.$type,properties:{accDescr:{name:im.accDescr},accTitle:{name:im.accTitle},dir:{name:im.dir},statements:{name:im.statements,defaultValue:[]},title:{name:im.title}},superTypes:[vp.$type]},DomainBlock:{name:W3.$type,properties:{domain:{name:W3.domain},items:{name:W3.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:CB.$type,properties:{label:{name:CB.label}},superTypes:[]},EbnfChoice:{name:hne.$type,properties:{alternatives:{name:hne.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:dne.$type,properties:{except:{name:dne.except}},superTypes:[ST.$type]},EbnfGroup:{name:fne.$type,properties:{element:{name:fne.element}},superTypes:[Jf.$type]},EbnfNonTerminal:{name:pne.$type,properties:{name:{name:pne.name}},superTypes:[Jf.$type]},EbnfOneOrMorePostfix:{name:gne.$type,properties:{operator:{name:gne.operator}},superTypes:[ST.$type]},EbnfOptional:{name:mne.$type,properties:{element:{name:mne.element}},superTypes:[Jf.$type]},EbnfOptionalPostfix:{name:yne.$type,properties:{operator:{name:yne.operator}},superTypes:[ST.$type]},EbnfPostfix:{name:ST.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Jf.$type,properties:{},superTypes:[]},EbnfRepetition:{name:vne.$type,properties:{element:{name:vne.element}},superTypes:[Jf.$type]},EbnfRule:{name:CN.$type,properties:{definition:{name:CN.definition},name:{name:CN.name}},superTypes:[]},EbnfSequence:{name:bne.$type,properties:{elements:{name:bne.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:xne.$type,properties:{text:{name:xne.text}},superTypes:[Jf.$type]},EbnfTerm:{name:kN.$type,properties:{base:{name:kN.base},postfixes:{name:kN.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:Tne.$type,properties:{value:{name:Tne.value}},superTypes:[Jf.$type]},EbnfZeroOrMorePostfix:{name:wne.$type,properties:{operator:{name:wne.operator}},superTypes:[ST.$type]},Edge:{name:bc.$type,properties:{lhsDir:{name:bc.lhsDir},lhsGroup:{name:bc.lhsGroup,defaultValue:!1},lhsId:{name:bc.lhsId},lhsInto:{name:bc.lhsInto,defaultValue:!1},rhsDir:{name:bc.rhsDir},rhsGroup:{name:bc.rhsGroup,defaultValue:!1},rhsId:{name:bc.rhsId},rhsInto:{name:bc.rhsInto,defaultValue:!1},title:{name:bc.title}},superTypes:[]},EmDataEntity:{name:am.$type,properties:{dataBlockValue:{name:am.dataBlockValue},dataType:{name:am.dataType},name:{name:am.name}},superTypes:[]},EmFrame:{name:ep.$type,properties:{},superTypes:[]},EmGwt:{name:ET.$type,properties:{givenStatements:{name:ET.givenStatements,defaultValue:[]},sourceFrame:{name:ET.sourceFrame,referenceType:ep.$type},thenStatements:{name:ET.thenStatements,defaultValue:[]},whenStatements:{name:ET.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:Cne.$type,properties:{entityIdentifier:{name:Cne.entityIdentifier,referenceType:SN.$type}},superTypes:[]},EmModelEntity:{name:SN.$type,properties:{name:{name:SN.name}},superTypes:[]},EmNoteEntity:{name:v4.$type,properties:{dataBlockValue:{name:v4.dataBlockValue},dataType:{name:v4.dataType},sourceFrame:{name:v4.sourceFrame,referenceType:ep.$type}},superTypes:[]},EmResetFrame:{name:zu.$type,properties:{dataInlineValue:{name:zu.dataInlineValue},dataReference:{name:zu.dataReference,referenceType:am.$type},dataType:{name:zu.dataType},entityIdentifier:{name:zu.entityIdentifier},modelEntityType:{name:zu.modelEntityType},name:{name:zu.name},sourceFrames:{name:zu.sourceFrames,defaultValue:[],referenceType:ep.$type}},superTypes:[ep.$type]},EmTimeFrame:{name:od.$type,properties:{dataInlineValue:{name:od.dataInlineValue},dataReference:{name:od.dataReference,referenceType:am.$type},dataType:{name:od.dataType},entityIdentifier:{name:od.entityIdentifier},modelEntityType:{name:od.modelEntityType},name:{name:od.name},sourceFrames:{name:od.sourceFrames,defaultValue:[],referenceType:ep.$type}},superTypes:[ep.$type]},Entry:{name:EN.$type,properties:{axis:{name:EN.axis,referenceType:f4.$type},value:{name:EN.value}},superTypes:[]},EventModel:{name:Mu.$type,properties:{accDescr:{name:Mu.accDescr},accTitle:{name:Mu.accTitle},dataEntities:{name:Mu.dataEntities,defaultValue:[]},frames:{name:Mu.frames,defaultValue:[]},gwtEntities:{name:Mu.gwtEntities,defaultValue:[]},modelEntities:{name:Mu.modelEntities,defaultValue:[]},noteEntities:{name:Mu.noteEntities,defaultValue:[]},title:{name:Mu.title}},superTypes:[]},Evolution:{name:kne.$type,properties:{stages:{name:kne.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:b4.$type,properties:{boundary:{name:b4.boundary},name:{name:b4.name},secondName:{name:b4.secondName}},superTypes:[]},Evolve:{name:AN.$type,properties:{component:{name:AN.component},target:{name:AN.target}},superTypes:[]},GitGraph:{name:vp.$type,properties:{accDescr:{name:vp.accDescr},accTitle:{name:vp.accTitle},statements:{name:vp.statements,defaultValue:[]},title:{name:vp.title}},superTypes:[]},Group:{name:AT.$type,properties:{icon:{name:AT.icon},id:{name:AT.id},in:{name:AT.in},title:{name:AT.title}},superTypes:[]},Info:{name:fw.$type,properties:{accDescr:{name:fw.accDescr},accTitle:{name:fw.accTitle},title:{name:fw.title}},superTypes:[]},Item:{name:_T.$type,properties:{classSelector:{name:_T.classSelector},name:{name:_T.name}},superTypes:[]},Junction:{name:_N.$type,properties:{id:{name:_N.id},in:{name:_N.in}},superTypes:[]},Label:{name:RT.$type,properties:{negX:{name:RT.negX,defaultValue:!1},negY:{name:RT.negY,defaultValue:!1},offsetX:{name:RT.offsetX},offsetY:{name:RT.offsetY}},superTypes:[]},Leaf:{name:x4.$type,properties:{classSelector:{name:x4.classSelector},name:{name:x4.name},value:{name:x4.value}},superTypes:[_T.$type]},Link:{name:tp.$type,properties:{arrow:{name:tp.arrow},from:{name:tp.from},fromPort:{name:tp.fromPort},linkLabel:{name:tp.linkLabel},to:{name:tp.to},toPort:{name:tp.toPort}},superTypes:[]},Merge:{name:Rm.$type,properties:{branch:{name:Rm.branch},id:{name:Rm.id},tags:{name:Rm.tags,defaultValue:[]},type:{name:Rm.type}},superTypes:[om.$type]},Note:{name:T4.$type,properties:{evolution:{name:T4.evolution},text:{name:T4.text},visibility:{name:T4.visibility}},superTypes:[]},Option:{name:RN.$type,properties:{name:{name:RN.name},value:{name:RN.value,defaultValue:!1}},superTypes:[]},Packet:{name:Lm.$type,properties:{accDescr:{name:Lm.accDescr},accTitle:{name:Lm.accTitle},blocks:{name:Lm.blocks,defaultValue:[]},title:{name:Lm.title}},superTypes:[]},PacketBlock:{name:Mm.$type,properties:{bits:{name:Mm.bits},end:{name:Mm.end},label:{name:Mm.label},start:{name:Mm.start}},superTypes:[]},PegAny:{name:Sne.$type,properties:{dot:{name:Sne.dot}},superTypes:[LT.$type]},PegGroup:{name:Ene.$type,properties:{element:{name:Ene.element}},superTypes:[LT.$type]},PegIdentifier:{name:Ane.$type,properties:{name:{name:Ane.name}},superTypes:[LT.$type]},PegLiteral:{name:_ne.$type,properties:{value:{name:_ne.value}},superTypes:[LT.$type]},PegOrderedChoice:{name:Rne.$type,properties:{alternatives:{name:Rne.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:LN.$type,properties:{operator:{name:LN.operator},suffix:{name:LN.suffix}},superTypes:[]},PegPrimary:{name:LT.$type,properties:{},superTypes:[]},PegRule:{name:MN.$type,properties:{definition:{name:MN.definition},name:{name:MN.name}},superTypes:[]},PegSequence:{name:Lne.$type,properties:{elements:{name:Lne.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:IN.$type,properties:{operator:{name:IN.operator},primary:{name:IN.primary}},superTypes:[]},Pie:{name:bp.$type,properties:{accDescr:{name:bp.accDescr},accTitle:{name:bp.accTitle},sections:{name:bp.sections,defaultValue:[]},showData:{name:bp.showData,defaultValue:!1},title:{name:bp.title}},superTypes:[]},PieSection:{name:H3.$type,properties:{label:{name:H3.label},value:{name:H3.value}},superTypes:[]},Pipeline:{name:NN.$type,properties:{components:{name:NN.components,defaultValue:[]},parent:{name:NN.parent}},superTypes:[]},PipelineComponent:{name:w4.$type,properties:{evolution:{name:w4.evolution},label:{name:w4.label},name:{name:w4.name}},superTypes:[]},Radar:{name:rp.$type,properties:{accDescr:{name:rp.accDescr},accTitle:{name:rp.accTitle},axes:{name:rp.axes,defaultValue:[]},curves:{name:rp.curves,defaultValue:[]},options:{name:rp.options,defaultValue:[]},title:{name:rp.title}},superTypes:[]},Railroad:{name:Im.$type,properties:{accDescr:{name:Im.accDescr},accTitle:{name:Im.accTitle},rules:{name:Im.rules,defaultValue:[]},title:{name:Im.title}},superTypes:[]},RailroadAbnf:{name:Nm.$type,properties:{accDescr:{name:Nm.accDescr},accTitle:{name:Nm.accTitle},rules:{name:Nm.rules,defaultValue:[]},title:{name:Nm.title}},superTypes:[]},RailroadChoiceExpr:{name:Mne.$type,properties:{alternatives:{name:Mne.alternatives,defaultValue:[]}},superTypes:[Iu.$type]},RailroadEbnf:{name:Dm.$type,properties:{accDescr:{name:Dm.accDescr},accTitle:{name:Dm.accTitle},rules:{name:Dm.rules,defaultValue:[]},title:{name:Dm.title}},superTypes:[]},RailroadExpression:{name:Iu.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:Ine.$type,properties:{name:{name:Ine.name}},superTypes:[Iu.$type]},RailroadOneOrMoreExpr:{name:Nne.$type,properties:{element:{name:Nne.element}},superTypes:[Iu.$type]},RailroadOptionalExpr:{name:Dne.$type,properties:{element:{name:Dne.element}},superTypes:[Iu.$type]},RailroadPeg:{name:Om.$type,properties:{accDescr:{name:Om.accDescr},accTitle:{name:Om.accTitle},rules:{name:Om.rules,defaultValue:[]},title:{name:Om.title}},superTypes:[]},RailroadRule:{name:DN.$type,properties:{definition:{name:DN.definition},name:{name:DN.name}},superTypes:[]},RailroadSequenceExpr:{name:One.$type,properties:{elements:{name:One.elements,defaultValue:[]}},superTypes:[Iu.$type]},RailroadSpecialExpr:{name:$ne.$type,properties:{text:{name:$ne.text}},superTypes:[Iu.$type]},RailroadTerminalExpr:{name:Pne.$type,properties:{value:{name:Pne.value}},superTypes:[Iu.$type]},RailroadZeroOrMoreExpr:{name:Bne.$type,properties:{element:{name:Bne.element}},superTypes:[Iu.$type]},Section:{name:ON.$type,properties:{classSelector:{name:ON.classSelector},name:{name:ON.name}},superTypes:[_T.$type]},Service:{name:sm.$type,properties:{icon:{name:sm.icon},iconText:{name:sm.iconText},id:{name:sm.id},in:{name:sm.in},title:{name:sm.title}},superTypes:[]},Size:{name:$N.$type,properties:{height:{name:$N.height},width:{name:$N.width}},superTypes:[]},Statement:{name:om.$type,properties:{},superTypes:[]},Transition:{name:pw.$type,properties:{from:{name:pw.from},label:{name:pw.label},to:{name:pw.to}},superTypes:[]},TreeNode:{name:lm.$type,properties:{classAnnotation:{name:lm.classAnnotation},descAnnotation:{name:lm.descAnnotation},iconAnnotation:{name:lm.iconAnnotation},indent:{name:lm.indent},name:{name:lm.name}},superTypes:[]},TreeView:{name:MT.$type,properties:{accDescr:{name:MT.accDescr},accTitle:{name:MT.accTitle},nodes:{name:MT.nodes,defaultValue:[]},title:{name:MT.title}},superTypes:[]},Treemap:{name:$m.$type,properties:{accDescr:{name:$m.accDescr},accTitle:{name:$m.accTitle},title:{name:$m.title},TreemapRows:{name:$m.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:PN.$type,properties:{indent:{name:PN.indent},item:{name:PN.item}},superTypes:[]},Wardley:{name:Fa.$type,properties:{accDescr:{name:Fa.accDescr},accelerators:{name:Fa.accelerators,defaultValue:[]},accTitle:{name:Fa.accTitle},anchors:{name:Fa.anchors,defaultValue:[]},annotation:{name:Fa.annotation,defaultValue:[]},annotations:{name:Fa.annotations,defaultValue:[]},components:{name:Fa.components,defaultValue:[]},deaccelerators:{name:Fa.deaccelerators,defaultValue:[]},evolution:{name:Fa.evolution},evolves:{name:Fa.evolves,defaultValue:[]},links:{name:Fa.links,defaultValue:[]},notes:{name:Fa.notes,defaultValue:[]},pipelines:{name:Fa.pipelines,defaultValue:[]},size:{name:Fa.size},title:{name:Fa.title}},superTypes:[]}}}},A(d2,"MermaidAstReflection"),d2),Pi=new rAe,Fne,c3t=A(()=>Fne??(Fne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),zne,u3t=A(()=>zne??(zne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),Vne,h3t=A(()=>Vne??(Vne=Ia('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),Gne,d3t=A(()=>Gne??(Gne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),Wne,f3t=A(()=>Wne??(Wne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),Hne,p3t=A(()=>Hne??(Hne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),qne,g3t=A(()=>qne??(qne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),Une,m3t=A(()=>Une??(Une=Ia(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),Yne,y3t=A(()=>Yne??(Yne=Ia('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),Xne,v3t=A(()=>Xne??(Xne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),jne,b3t=A(()=>jne??(jne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),Kne,x3t=A(()=>Kne??(Kne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),Zne,T3t=A(()=>Zne??(Zne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),Qne,w3t=A(()=>Qne??(Qne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),Jne,C3t=A(()=>Jne??(Jne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),k3t={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},S3t={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},E3t={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},A3t={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},_3t={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},R3t={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},L3t={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},M3t={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},I3t={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},N3t={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},D3t={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},O3t={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},$3t={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},P3t={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},B3t={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ro={AstReflection:A(()=>new rAe,"AstReflection")},F3t={Grammar:A(()=>c3t(),"Grammar"),LanguageMetaData:A(()=>k3t,"LanguageMetaData"),parser:{}},z3t={Grammar:A(()=>u3t(),"Grammar"),LanguageMetaData:A(()=>S3t,"LanguageMetaData"),parser:{}},V3t={Grammar:A(()=>h3t(),"Grammar"),LanguageMetaData:A(()=>E3t,"LanguageMetaData"),parser:{}},G3t={Grammar:A(()=>d3t(),"Grammar"),LanguageMetaData:A(()=>A3t,"LanguageMetaData"),parser:{}},W3t={Grammar:A(()=>f3t(),"Grammar"),LanguageMetaData:A(()=>_3t,"LanguageMetaData"),parser:{}},H3t={Grammar:A(()=>p3t(),"Grammar"),LanguageMetaData:A(()=>R3t,"LanguageMetaData"),parser:{}},q3t={Grammar:A(()=>g3t(),"Grammar"),LanguageMetaData:A(()=>L3t,"LanguageMetaData"),parser:{}},U3t={Grammar:A(()=>m3t(),"Grammar"),LanguageMetaData:A(()=>M3t,"LanguageMetaData"),parser:{}},Y3t={Grammar:A(()=>y3t(),"Grammar"),LanguageMetaData:A(()=>I3t,"LanguageMetaData"),parser:{}},X3t={Grammar:A(()=>v3t(),"Grammar"),LanguageMetaData:A(()=>N3t,"LanguageMetaData"),parser:{}},j3t={Grammar:A(()=>b3t(),"Grammar"),LanguageMetaData:A(()=>D3t,"LanguageMetaData"),parser:{}},K3t={Grammar:A(()=>x3t(),"Grammar"),LanguageMetaData:A(()=>O3t,"LanguageMetaData"),parser:{}},Z3t={Grammar:A(()=>T3t(),"Grammar"),LanguageMetaData:A(()=>$3t,"LanguageMetaData"),parser:{}},Q3t={Grammar:A(()=>w3t(),"Grammar"),LanguageMetaData:A(()=>P3t,"LanguageMetaData"),parser:{}},J3t={Grammar:A(()=>C3t(),"Grammar"),LanguageMetaData:A(()=>B3t,"LanguageMetaData"),parser:{}},e5t=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,t5t=/accTitle[\t ]*:([^\n\r]*)/,r5t=/title([\t ][^\n\r]*|)/,n5t={ACC_DESCR:e5t,ACC_TITLE:t5t,TITLE:r5t},f2,vu=(f2=class extends Fq{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=n5t[e.name];if(i===void 0)return;const a=i.exec(r);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` `)}}},A(f2,"AbstractMermaidValueConverter"),f2),p2,Ux=(p2=class extends vu{runCustomConverter(e,r,n){}},A(p2,"CommonValueConverter"),p2),g2,no=(g2=class extends w7{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},A(g2,"AbstractMermaidTokenBuilder"),g2),m2;m2=class extends no{},A(m2,"CommonTokenBuilder");/*! Bundled license information: lodash-es/lodash.js: @@ -1565,12 +1567,12 @@ lodash-es/lodash.js: * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) -*/var y2,t5t=(y2=class extends no{constructor(){super(["radar-beta"])}},A(y2,"RadarTokenBuilder"),y2),rAe={parser:{TokenBuilder:A(()=>new t5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")}};function nAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),W3t,rAe);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}A(nAe,"createRadarServices");var v2,r5t=(v2=class extends no{constructor(){super(["railroad-beta"])}},A(v2,"RailroadTokenBuilder"),v2),Jne=A(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew r5t,"TokenBuilder"),ValueConverter:A(()=>new n5t,"ValueConverter")}};function oU(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),U3t,iAe);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}A(oU,"createRailroadServices");var x2,i5t=(x2=class extends no{constructor(){super(["railroad-ebnf-beta"])}},A(x2,"RailroadEbnfTokenBuilder"),x2),eie=A(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew i5t,"TokenBuilder"),ValueConverter:A(()=>new a5t,"ValueConverter")}};function lU(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),q3t,aAe);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}A(lU,"createRailroadEbnfServices");var w2,s5t=(w2=class extends no{constructor(){super(["railroad-abnf-beta"])}},A(w2,"RailroadAbnfTokenBuilder"),w2),C2,o5t=(C2=class extends vu{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const a=i.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return a.slice(1,-1)}return i}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},A(C2,"RailroadAbnfValueConverter"),C2),sAe={parser:{TokenBuilder:A(()=>new s5t,"TokenBuilder"),ValueConverter:A(()=>new o5t,"ValueConverter")}};function cU(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),H3t,sAe);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}A(cU,"createRailroadAbnfServices");var k2,l5t=(k2=class extends no{constructor(){super(["railroad-peg-beta"])}},A(k2,"RailroadPegTokenBuilder"),k2),tie=A(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew l5t,"TokenBuilder"),ValueConverter:A(()=>new c5t,"ValueConverter")}};function uU(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),Y3t,oAe);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}A(uU,"createRailroadPegServices");var E2,u5t=(E2=class extends no{constructor(){super(["treemap"])}},A(E2,"TreemapTokenBuilder"),E2),h5t=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,A2,d5t=(A2=class extends vu{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=h5t.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},A(A2,"TreemapValueConverter"),A2);function lAe(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}A(lAe,"registerValidationChecks");var _2,f5t=(_2=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},A(_2,"TreemapValidator"),_2),cAe={parser:{TokenBuilder:A(()=>new u5t,"TokenBuilder"),ValueConverter:A(()=>new d5t,"ValueConverter")},validation:{TreemapValidator:A(()=>new f5t,"TreemapValidator")}};function uAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),X3t,cAe);return e.ServiceRegistry.register(r),lAe(r),{shared:e,Treemap:r}}A(uAe,"createTreemapServices");var R2,p5t=(R2=class extends vu{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},A(R2,"WardleyValueConverter"),R2),hAe={parser:{ValueConverter:A(()=>new p5t,"ValueConverter")}};function dAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),K3t,hAe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}A(dAe,"createWardleyServices");var L2,g5t=(L2=class extends no{constructor(){super(["cynefin-beta"])}},A(L2,"CynefinTokenBuilder"),L2),fAe={parser:{TokenBuilder:A(()=>new g5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")}};function pAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),P3t,fAe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}A(pAe,"createCynefinServices");var M2,m5t=(M2=class extends no{constructor(){super(["gitGraph"])}},A(M2,"GitGraphTokenBuilder"),M2),gAe={parser:{TokenBuilder:A(()=>new m5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")}};function mAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),F3t,gAe);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}A(mAe,"createGitGraphServices");var I2,y5t=(I2=class extends no{constructor(){super(["info","showInfo"])}},A(I2,"InfoTokenBuilder"),I2),yAe={parser:{TokenBuilder:A(()=>new y5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")}};function vAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),z3t,yAe);return e.ServiceRegistry.register(r),{shared:e,Info:r}}A(vAe,"createInfoServices");var N2,v5t=(N2=class extends no{constructor(){super(["packet"])}},A(N2,"PacketTokenBuilder"),N2),bAe={parser:{TokenBuilder:A(()=>new v5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")}};function xAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),V3t,bAe);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}A(xAe,"createPacketServices");var D2,b5t=(D2=class extends no{constructor(){super(["pie","showData"])}},A(D2,"PieTokenBuilder"),D2),O2,x5t=(O2=class extends vu{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},A(O2,"PieValueConverter"),O2),TAe={parser:{TokenBuilder:A(()=>new b5t,"TokenBuilder"),ValueConverter:A(()=>new x5t,"ValueConverter")}};function wAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),G3t,TAe);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}A(wAe,"createPieServices");var $2,T5t=($2=class extends vu{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},A($2,"TreeViewValueConverter"),$2),P2,w5t=(P2=class extends no{constructor(){super(["treeView-beta"])}},A(P2,"TreeViewTokenBuilder"),P2),CAe={parser:{TokenBuilder:A(()=>new w5t,"TokenBuilder"),ValueConverter:A(()=>new T5t,"ValueConverter")}};function kAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),j3t,CAe);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}A(kAe,"createTreeViewServices");var B2,C5t=(B2=class extends no{constructor(){super(["architecture"])}},A(B2,"ArchitectureTokenBuilder"),B2),F2,k5t=(F2=class extends vu{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},A(F2,"ArchitectureValueConverter"),F2),SAe={parser:{TokenBuilder:A(()=>new C5t,"TokenBuilder"),ValueConverter:A(()=>new k5t,"ValueConverter")}};function EAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),$3t,SAe);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}A(EAe,"createArchitectureServices");var z2,S5t=(z2=class extends no{constructor(){super(["eventmodeling"])}},A(z2,"EventModelingTokenBuilder"),z2),rie=new Set(["cmd","command"]),nie=new Set(["evt","event"]),BN=new Set(["rmo","readmodel"]),iie=new Set(["pcr","processor"]),aie=new Set(["ui"]);function AAe(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}A(AAe,"registerValidationChecks");var V2,E5t=(V2=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(rie.has(e.modelEntityType)?this.validateSources(e,new Set([...aie,...iie]),"command","ui or processor",r):nie.has(e.modelEntityType)?this.validateSources(e,rie,"event","command",r):BN.has(e.modelEntityType)?this.validateSources(e,nie,"read model","event",r):iie.has(e.modelEntityType)?this.validateSources(e,BN,"processor","read model",r):aie.has(e.modelEntityType)&&this.validateSources(e,BN,"ui","read model",r))}validateSources(e,r,n,i,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!r.has(o.modelEntityType)&&a("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},A(V2,"EventModelingValidator"),V2),_Ae={parser:{TokenBuilder:A(()=>new S5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")},validation:{EventModelingValidator:A(()=>new E5t,"EventModelingValidator")}};function RAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),B3t,_Ae);return e.ServiceRegistry.register(r),AAe(r),{shared:e,EventModel:r}}A(RAe,"createEventModelingServices");var Va={},A5t={info:A(async()=>{const{createInfoServices:t}=await tr(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>oPt);return{createInfoServices:r}},void 0,import.meta.url),e=t().Info.parser.LangiumParser;Va.info=e},"info"),packet:A(async()=>{const{createPacketServices:t}=await tr(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>lPt);return{createPacketServices:r}},void 0,import.meta.url),e=t().Packet.parser.LangiumParser;Va.packet=e},"packet"),pie:A(async()=>{const{createPieServices:t}=await tr(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>cPt);return{createPieServices:r}},void 0,import.meta.url),e=t().Pie.parser.LangiumParser;Va.pie=e},"pie"),treeView:A(async()=>{const{createTreeViewServices:t}=await tr(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>uPt);return{createTreeViewServices:r}},void 0,import.meta.url),e=t().TreeView.parser.LangiumParser;Va.treeView=e},"treeView"),architecture:A(async()=>{const{createArchitectureServices:t}=await tr(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>hPt);return{createArchitectureServices:r}},void 0,import.meta.url),e=t().Architecture.parser.LangiumParser;Va.architecture=e},"architecture"),gitGraph:A(async()=>{const{createGitGraphServices:t}=await tr(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>dPt);return{createGitGraphServices:r}},void 0,import.meta.url),e=t().GitGraph.parser.LangiumParser;Va.gitGraph=e},"gitGraph"),eventmodeling:A(async()=>{const{createEventModelingServices:t}=await tr(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>fPt);return{createEventModelingServices:r}},void 0,import.meta.url),e=t().EventModel.parser.LangiumParser;Va.eventmodeling=e},"eventmodeling"),radar:A(async()=>{const{createRadarServices:t}=await tr(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>pPt);return{createRadarServices:r}},void 0,import.meta.url),e=t().Radar.parser.LangiumParser;Va.radar=e},"radar"),railroad:A(async()=>{const{createRailroadServices:t}=await tr(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>gPt);return{createRailroadServices:r}},void 0,import.meta.url),e=t().Railroad.parser.LangiumParser;Va.railroad=e},"railroad"),railroadEbnf:A(async()=>{const{createRailroadEbnfServices:t}=await tr(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>mPt);return{createRailroadEbnfServices:r}},void 0,import.meta.url),e=t().RailroadEbnf.parser.LangiumParser;Va.railroadEbnf=e},"railroadEbnf"),railroadAbnf:A(async()=>{const{createRailroadAbnfServices:t}=await tr(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>yPt);return{createRailroadAbnfServices:r}},void 0,import.meta.url),e=t().RailroadAbnf.parser.LangiumParser;Va.railroadAbnf=e},"railroadAbnf"),railroadPeg:A(async()=>{const{createRailroadPegServices:t}=await tr(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>vPt);return{createRailroadPegServices:r}},void 0,import.meta.url),e=t().RailroadPeg.parser.LangiumParser;Va.railroadPeg=e},"railroadPeg"),treemap:A(async()=>{const{createTreemapServices:t}=await tr(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>bPt);return{createTreemapServices:r}},void 0,import.meta.url),e=t().Treemap.parser.LangiumParser;Va.treemap=e},"treemap"),wardley:A(async()=>{const{createWardleyServices:t}=await tr(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>xPt);return{createWardleyServices:r}},void 0,import.meta.url),e=t().Wardley.parser.LangiumParser;Va.wardley=e},"wardley"),cynefin:A(async()=>{const{createCynefinServices:t}=await tr(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>TPt);return{createCynefinServices:r}},void 0,import.meta.url),e=t().Cynefin.parser.LangiumParser;Va.cynefin=e},"cynefin")};async function Al(t,e){const r=A5t[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Va[t]||await r();const i=Va[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new US(i);return i.value}A(Al,"parse");var G2,US=(G2=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",s=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${s}: ${i.message}`}).join(` +*/var y2,i5t=(y2=class extends no{constructor(){super(["radar-beta"])}},A(y2,"RadarTokenBuilder"),y2),nAe={parser:{TokenBuilder:A(()=>new i5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")}};function iAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),U3t,nAe);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}A(iAe,"createRadarServices");var v2,a5t=(v2=class extends no{constructor(){super(["railroad-beta"])}},A(v2,"RailroadTokenBuilder"),v2),eie=A(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew a5t,"TokenBuilder"),ValueConverter:A(()=>new s5t,"ValueConverter")}};function oU(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),j3t,aAe);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}A(oU,"createRailroadServices");var x2,o5t=(x2=class extends no{constructor(){super(["railroad-ebnf-beta"])}},A(x2,"RailroadEbnfTokenBuilder"),x2),tie=A(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew o5t,"TokenBuilder"),ValueConverter:A(()=>new l5t,"ValueConverter")}};function lU(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),X3t,sAe);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}A(lU,"createRailroadEbnfServices");var w2,c5t=(w2=class extends no{constructor(){super(["railroad-abnf-beta"])}},A(w2,"RailroadAbnfTokenBuilder"),w2),C2,u5t=(C2=class extends vu{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const a=i.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return a.slice(1,-1)}return i}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},A(C2,"RailroadAbnfValueConverter"),C2),oAe={parser:{TokenBuilder:A(()=>new c5t,"TokenBuilder"),ValueConverter:A(()=>new u5t,"ValueConverter")}};function cU(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),Y3t,oAe);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}A(cU,"createRailroadAbnfServices");var k2,h5t=(k2=class extends no{constructor(){super(["railroad-peg-beta"])}},A(k2,"RailroadPegTokenBuilder"),k2),rie=A(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew h5t,"TokenBuilder"),ValueConverter:A(()=>new d5t,"ValueConverter")}};function uU(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),K3t,lAe);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}A(uU,"createRailroadPegServices");var E2,f5t=(E2=class extends no{constructor(){super(["treemap"])}},A(E2,"TreemapTokenBuilder"),E2),p5t=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,A2,g5t=(A2=class extends vu{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=p5t.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},A(A2,"TreemapValueConverter"),A2);function cAe(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}A(cAe,"registerValidationChecks");var _2,m5t=(_2=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},A(_2,"TreemapValidator"),_2),uAe={parser:{TokenBuilder:A(()=>new f5t,"TokenBuilder"),ValueConverter:A(()=>new g5t,"ValueConverter")},validation:{TreemapValidator:A(()=>new m5t,"TreemapValidator")}};function hAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),Z3t,uAe);return e.ServiceRegistry.register(r),cAe(r),{shared:e,Treemap:r}}A(hAe,"createTreemapServices");var R2,y5t=(R2=class extends vu{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},A(R2,"WardleyValueConverter"),R2),dAe={parser:{ValueConverter:A(()=>new y5t,"ValueConverter")}};function fAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),J3t,dAe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}A(fAe,"createWardleyServices");var L2,v5t=(L2=class extends no{constructor(){super(["cynefin-beta"])}},A(L2,"CynefinTokenBuilder"),L2),pAe={parser:{TokenBuilder:A(()=>new v5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")}};function gAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),z3t,pAe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}A(gAe,"createCynefinServices");var M2,b5t=(M2=class extends no{constructor(){super(["gitGraph"])}},A(M2,"GitGraphTokenBuilder"),M2),mAe={parser:{TokenBuilder:A(()=>new b5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")}};function yAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),G3t,mAe);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}A(yAe,"createGitGraphServices");var I2,x5t=(I2=class extends no{constructor(){super(["info","showInfo"])}},A(I2,"InfoTokenBuilder"),I2),vAe={parser:{TokenBuilder:A(()=>new x5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")}};function bAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),W3t,vAe);return e.ServiceRegistry.register(r),{shared:e,Info:r}}A(bAe,"createInfoServices");var N2,T5t=(N2=class extends no{constructor(){super(["packet"])}},A(N2,"PacketTokenBuilder"),N2),xAe={parser:{TokenBuilder:A(()=>new T5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")}};function TAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),H3t,xAe);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}A(TAe,"createPacketServices");var D2,w5t=(D2=class extends no{constructor(){super(["pie","showData"])}},A(D2,"PieTokenBuilder"),D2),O2,C5t=(O2=class extends vu{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},A(O2,"PieValueConverter"),O2),wAe={parser:{TokenBuilder:A(()=>new w5t,"TokenBuilder"),ValueConverter:A(()=>new C5t,"ValueConverter")}};function CAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),q3t,wAe);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}A(CAe,"createPieServices");var $2,k5t=($2=class extends vu{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},A($2,"TreeViewValueConverter"),$2),P2,S5t=(P2=class extends no{constructor(){super(["treeView-beta"])}},A(P2,"TreeViewTokenBuilder"),P2),kAe={parser:{TokenBuilder:A(()=>new S5t,"TokenBuilder"),ValueConverter:A(()=>new k5t,"ValueConverter")}};function SAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),Q3t,kAe);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}A(SAe,"createTreeViewServices");var B2,E5t=(B2=class extends no{constructor(){super(["architecture"])}},A(B2,"ArchitectureTokenBuilder"),B2),F2,A5t=(F2=class extends vu{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},A(F2,"ArchitectureValueConverter"),F2),EAe={parser:{TokenBuilder:A(()=>new E5t,"TokenBuilder"),ValueConverter:A(()=>new A5t,"ValueConverter")}};function AAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),F3t,EAe);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}A(AAe,"createArchitectureServices");var z2,_5t=(z2=class extends no{constructor(){super(["eventmodeling"])}},A(z2,"EventModelingTokenBuilder"),z2),nie=new Set(["cmd","command"]),iie=new Set(["evt","event"]),BN=new Set(["rmo","readmodel"]),aie=new Set(["pcr","processor"]),sie=new Set(["ui"]);function _Ae(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}A(_Ae,"registerValidationChecks");var V2,R5t=(V2=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(nie.has(e.modelEntityType)?this.validateSources(e,new Set([...sie,...aie]),"command","ui or processor",r):iie.has(e.modelEntityType)?this.validateSources(e,nie,"event","command",r):BN.has(e.modelEntityType)?this.validateSources(e,iie,"read model","event",r):aie.has(e.modelEntityType)?this.validateSources(e,BN,"processor","read model",r):sie.has(e.modelEntityType)&&this.validateSources(e,BN,"ui","read model",r))}validateSources(e,r,n,i,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!r.has(o.modelEntityType)&&a("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},A(V2,"EventModelingValidator"),V2),RAe={parser:{TokenBuilder:A(()=>new _5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")},validation:{EventModelingValidator:A(()=>new R5t,"EventModelingValidator")}};function LAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),V3t,RAe);return e.ServiceRegistry.register(r),_Ae(r),{shared:e,EventModel:r}}A(LAe,"createEventModelingServices");var Va={},L5t={info:A(async()=>{const{createInfoServices:t}=await tr(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>uPt);return{createInfoServices:r}},void 0,import.meta.url),e=t().Info.parser.LangiumParser;Va.info=e},"info"),packet:A(async()=>{const{createPacketServices:t}=await tr(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>hPt);return{createPacketServices:r}},void 0,import.meta.url),e=t().Packet.parser.LangiumParser;Va.packet=e},"packet"),pie:A(async()=>{const{createPieServices:t}=await tr(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>dPt);return{createPieServices:r}},void 0,import.meta.url),e=t().Pie.parser.LangiumParser;Va.pie=e},"pie"),treeView:A(async()=>{const{createTreeViewServices:t}=await tr(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>fPt);return{createTreeViewServices:r}},void 0,import.meta.url),e=t().TreeView.parser.LangiumParser;Va.treeView=e},"treeView"),architecture:A(async()=>{const{createArchitectureServices:t}=await tr(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>pPt);return{createArchitectureServices:r}},void 0,import.meta.url),e=t().Architecture.parser.LangiumParser;Va.architecture=e},"architecture"),gitGraph:A(async()=>{const{createGitGraphServices:t}=await tr(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>gPt);return{createGitGraphServices:r}},void 0,import.meta.url),e=t().GitGraph.parser.LangiumParser;Va.gitGraph=e},"gitGraph"),eventmodeling:A(async()=>{const{createEventModelingServices:t}=await tr(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>mPt);return{createEventModelingServices:r}},void 0,import.meta.url),e=t().EventModel.parser.LangiumParser;Va.eventmodeling=e},"eventmodeling"),radar:A(async()=>{const{createRadarServices:t}=await tr(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>yPt);return{createRadarServices:r}},void 0,import.meta.url),e=t().Radar.parser.LangiumParser;Va.radar=e},"radar"),railroad:A(async()=>{const{createRailroadServices:t}=await tr(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>vPt);return{createRailroadServices:r}},void 0,import.meta.url),e=t().Railroad.parser.LangiumParser;Va.railroad=e},"railroad"),railroadEbnf:A(async()=>{const{createRailroadEbnfServices:t}=await tr(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>bPt);return{createRailroadEbnfServices:r}},void 0,import.meta.url),e=t().RailroadEbnf.parser.LangiumParser;Va.railroadEbnf=e},"railroadEbnf"),railroadAbnf:A(async()=>{const{createRailroadAbnfServices:t}=await tr(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>xPt);return{createRailroadAbnfServices:r}},void 0,import.meta.url),e=t().RailroadAbnf.parser.LangiumParser;Va.railroadAbnf=e},"railroadAbnf"),railroadPeg:A(async()=>{const{createRailroadPegServices:t}=await tr(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>TPt);return{createRailroadPegServices:r}},void 0,import.meta.url),e=t().RailroadPeg.parser.LangiumParser;Va.railroadPeg=e},"railroadPeg"),treemap:A(async()=>{const{createTreemapServices:t}=await tr(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>wPt);return{createTreemapServices:r}},void 0,import.meta.url),e=t().Treemap.parser.LangiumParser;Va.treemap=e},"treemap"),wardley:A(async()=>{const{createWardleyServices:t}=await tr(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>CPt);return{createWardleyServices:r}},void 0,import.meta.url),e=t().Wardley.parser.LangiumParser;Va.wardley=e},"wardley"),cynefin:A(async()=>{const{createCynefinServices:t}=await tr(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>kPt);return{createCynefinServices:r}},void 0,import.meta.url),e=t().Cynefin.parser.LangiumParser;Va.cynefin=e},"cynefin")};async function Al(t,e){const r=L5t[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Va[t]||await r();const i=Va[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new US(i);return i.value}A(Al,"parse");var G2,US=(G2=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",s=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${s}: ${i.message}`}).join(` `),n=e.parserErrors.map(i=>{const a=i.token.startLine!==void 0&&!isNaN(i.token.startLine)?i.token.startLine:"?",s=i.token.startColumn!==void 0&&!isNaN(i.token.startColumn)?i.token.startColumn:"?";return`Parse error on line ${a}, column ${s}: ${i.message}`}).join(` -`);super(`Parsing failed: ${r} ${n}`),this.result=e}},A(G2,"MermaidParseError"),G2),Mn={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},_5t=Vr.gitGraph,Bg=x(()=>ri({..._5t,...Xt().gitGraph}),"getConfig"),Ot=new xW(()=>{const t=Bg(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function M7(){return Ide({length:7})}x(M7,"getID");function LAe(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const a=e(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}x(LAe,"uniqBy");var R5t=x(function(t){Ot.records.direction=t},"setDirection"),L5t=x(function(t){le.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{Ot.records.options=JSON.parse(t)}catch(e){le.error("error while parsing gitGraph options",e.message)}},"setOptions"),M5t=x(function(){return Ot.records.options},"getOptions"),I5t=x(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;le.info("commit",e,r,n,i),le.debug("Entering commit:",e,r,n,i);const a=Bg();r=At.sanitizeText(r,a),e=At.sanitizeText(e,a),i=i==null?void 0:i.map(o=>At.sanitizeText(o,a));const s={id:r||Ot.records.seq+"-"+M7(),message:e,seq:Ot.records.seq++,type:n??Mn.NORMAL,tags:i??[],parents:Ot.records.head==null?[]:[Ot.records.head.id],branch:Ot.records.currBranch};Ot.records.head=s,le.info("main branch",a.mainBranchName),Ot.records.commits.has(s.id)&&le.warn(`Commit ID ${s.id} already exists`),Ot.records.commits.set(s.id,s),Ot.records.branches.set(Ot.records.currBranch,s.id),le.debug("in pushCommit "+s.id)},"commit"),N5t=x(function(t){let e=t.name;const r=t.order;if(e=At.sanitizeText(e,Bg()),Ot.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);Ot.records.branches.set(e,Ot.records.head!=null?Ot.records.head.id:null),Ot.records.branchConfig.set(e,{name:e,order:r}),MAe(e),le.debug("in createBranch")},"branch"),D5t=x(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=Bg();e=At.sanitizeText(e,a),r&&(r=At.sanitizeText(r,a));const s=Ot.records.branches.get(Ot.records.currBranch),o=Ot.records.branches.get(e),l=s?Ot.records.commits.get(s):void 0,u=o?Ot.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Ot.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${Ot.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!Ot.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&Ot.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,token:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i==null?void 0:i.join(" ")}`]},f}const h=o||"",d={id:r||`${Ot.records.seq}-${M7()}`,message:`merged branch ${e} into ${Ot.records.currBranch}`,seq:Ot.records.seq++,parents:Ot.records.head==null?[]:[Ot.records.head.id,h],branch:Ot.records.currBranch,type:Mn.MERGE,customType:n,customId:!!r,tags:i??[]};Ot.records.head=d,Ot.records.commits.set(d.id,d),Ot.records.branches.set(Ot.records.currBranch,d.id),le.debug(Ot.records.branches),le.debug("in mergeBranch")},"merge"),O5t=x(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;le.debug("Entering cherryPick:",e,r,n);const a=Bg();if(e=At.sanitizeText(e,a),r=At.sanitizeText(r,a),n=n==null?void 0:n.map(l=>At.sanitizeText(l,a)),i=At.sanitizeText(i,a),!e||!Ot.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const s=Ot.records.commits.get(e);if(s===void 0||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=s.branch;if(s.type===Mn.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!Ot.records.commits.has(r)){if(o===Ot.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=Ot.records.branches.get(Ot.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Ot.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=Ot.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Ot.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:Ot.records.seq+"-"+M7(),message:`cherry-picked ${s==null?void 0:s.message} into ${Ot.records.currBranch}`,seq:Ot.records.seq++,parents:Ot.records.head==null?[]:[Ot.records.head.id,s.id],branch:Ot.records.currBranch,type:Mn.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===Mn.MERGE?`|parent:${i}`:""}`]};Ot.records.head=h,Ot.records.commits.set(h.id,h),Ot.records.branches.set(Ot.records.currBranch,h.id),le.debug(Ot.records.branches),le.debug("in cherryPick")}},"cherryPick"),MAe=x(function(t){if(t=At.sanitizeText(t,Bg()),Ot.records.branches.has(t)){Ot.records.currBranch=t;const e=Ot.records.branches.get(Ot.records.currBranch);e===void 0||!e?Ot.records.head=null:Ot.records.head=Ot.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function kB(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}x(kB,"upsert");function hU(t){const e=t.reduce((i,a)=>i.seq>a.seq?i:a,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in Ot.records.branches)Ot.records.branches.get(i)===e.id&&n.push(i);if(le.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=Ot.records.commits.get(e.parents[0]);kB(t,e,i),e.parents[1]&&t.push(Ot.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=Ot.records.commits.get(e.parents[0]);kB(t,e,i)}}t=LAe(t,i=>i.id),hU(t)}x(hU,"prettyPrintCommitHistory");var $5t=x(function(){le.debug(Ot.records.commits);const t=IAe()[0];hU([t])},"prettyPrint"),P5t=x(function(){Ot.reset(),On()},"clear"),B5t=x(function(){return[...Ot.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),F5t=x(function(){return Ot.records.branches},"getBranches"),z5t=x(function(){return Ot.records.commits},"getCommits"),IAe=x(function(){const t=[...Ot.records.commits.values()];return t.forEach(function(e){le.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),V5t=x(function(){return Ot.records.currBranch},"getCurrentBranch"),G5t=x(function(){return Ot.records.direction},"getDirection"),W5t=x(function(){return Ot.records.head},"getHead"),NAe={commitType:Mn,getConfig:Bg,setDirection:R5t,setOptions:L5t,getOptions:M5t,commit:I5t,branch:N5t,merge:D5t,cherryPick:O5t,checkout:MAe,prettyPrint:$5t,clear:P5t,getBranchesAsObjArray:B5t,getBranches:F5t,getCommits:z5t,getCommitsArray:IAe,getCurrentBranch:V5t,getDirection:G5t,getHead:W5t,setAccTitle:Hn,getAccTitle:ni,getAccDescription:ai,setAccDescription:ii,setDiagramTitle:ti,getDiagramTitle:Yn},H5t=x((t,e)=>{eo(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)q5t(r,e)},"populate"),q5t=x((t,e)=>{const n={Commit:x(i=>e.commit(U5t(i)),"Commit"),Branch:x(i=>e.branch(Y5t(i)),"Branch"),Merge:x(i=>e.merge(X5t(i)),"Merge"),Checkout:x(i=>e.checkout(j5t(i)),"Checkout"),CherryPicking:x(i=>e.cherryPick(K5t(i)),"CherryPicking")}[t.$type];n?n(t):le.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),U5t=x(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Mn[t.type]:Mn.NORMAL,tags:t.tags??void 0}),"parseCommit"),Y5t=x(t=>({name:t.name,order:t.order??0}),"parseBranch"),X5t=x(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Mn[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),j5t=x(t=>t.branch,"parseCheckout"),K5t=x(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),Z5t={parse:x(async t=>{const e=await Al("gitGraph",t);le.debug(e),H5t(e,NAe)},"parse")},$d=10,Pd=40,Rc=4,qu=2,zp=8,I7=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),SB=12,dU=new Set(["redux-color","redux-dark-color"]),Q5t=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Vp=x((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),go=new Map,bo=new Map,m6=30,gw=new Map,y6=[],Uu=0,Hr="LR",J5t=x(()=>{go.clear(),bo.clear(),gw.clear(),Uu=0,y6=[],Hr="LR"},"clear"),DAe=x(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),OAe=x(t=>{let e,r,n;return Hr==="BT"?(r=x((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=x((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var s,o;const a=Hr==="TB"||Hr=="BT"?(s=bo.get(i))==null?void 0:s.y:(o=bo.get(i))==null?void 0:o.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),eAt=x(t=>{let e="",r=1/0;return t.forEach(n=>{const i=bo.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),tAt=x((t,e,r)=>{let n=r,i=r;const a=[];t.forEach(s=>{const o=e.get(s);if(!o)throw new Error(`Commit not found for key ${s}`);o.parents.length?(n=nAt(o),i=Math.max(n,i)):a.push(o),iAt(o,n)}),n=i,a.forEach(s=>{aAt(s,n,r)}),t.forEach(s=>{const o=e.get(s);if(o!=null&&o.parents.length){const l=eAt(o.parents);n=bo.get(l).y-Pd,n<=i&&(i=n);const u=go.get(o.branch).pos,h=n-$d;bo.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),rAt=x(t=>{var n;const e=OAe(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=bo.get(e))==null?void 0:n.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),nAt=x(t=>rAt(t)+Pd,"calculateCommitPosition"),iAt=x((t,e)=>{const r=go.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+$d;return bo.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),aAt=x((t,e,r)=>{const n=go.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;bo.set(t.id,{x:a,y:i})},"setRootPosition"),sAt=x((t,e,r,n,i,a)=>{const{theme:s}=Fe(),o=I7.has(s??""),l=dU.has(s??""),u=Q5t.has(s??"");if(a===Mn.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(o?3:0)).attr("y",r.y-10+(o?3:0)).attr("width",o?14:20).attr("height",o?14:20).attr("class",`commit ${e.id} commit-highlight${Vp(i,zp,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(o?2:0)).attr("y",r.y-6+(o?2:0)).attr("width",o?8:12).attr("height",o?8:12).attr("class",`commit ${e.id} commit${Vp(i,zp,l)} ${n}-inner`);else if(a===Mn.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",o?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`);else{const h=t.append("circle");if(h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",o?7:10),h.attr("class",`commit ${e.id} commit${Vp(i,zp,l)}`),a===Mn.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",o?5:6),d.attr("class",`commit ${n} ${e.id} commit${Vp(i,zp,l)}`)}if(a===Mn.REVERSE){const d=t.append("path"),f=o?4:5;d.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${e.id} commit${Vp(i,zp,l)}`)}}},"drawCommitBullet"),oAt=x((t,e,r,n,i)=>{var a;if(e.type!==Mn.CHERRY_PICK&&(e.customId&&e.type===Mn.MERGE||e.type!==Mn.MERGE)&&i.showCommitLabel){const s=t.append("g"),o=s.insert("rect").attr("class","commit-label-bkg"),l=s.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(a=l.node())==null?void 0:a.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-qu).attr("y",r.y+13.5).attr("width",u.width+2*qu).attr("height",u.height+2*qu),Hr==="TB"||Hr==="BT"?(o.attr("x",r.x-(u.width+4*Rc+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*Rc)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(Hr==="TB"||Hr==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const h=-7.5-(u.width+10)/25*9.5,d=10+u.width/25*8.5;s.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),lAt=x((t,e,r,n)=>{var i;if(e.tags.length>0){let a=0,s=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-a).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");s=Math.max(s,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:a}),a+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",` +`);super(`Parsing failed: ${r} ${n}`),this.result=e}},A(G2,"MermaidParseError"),G2),Mn={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},M5t=Vr.gitGraph,Bg=x(()=>ri({...M5t,...Xt().gitGraph}),"getConfig"),Ot=new xW(()=>{const t=Bg(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function M7(){return Nde({length:7})}x(M7,"getID");function MAe(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const a=e(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}x(MAe,"uniqBy");var I5t=x(function(t){Ot.records.direction=t},"setDirection"),N5t=x(function(t){le.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{Ot.records.options=JSON.parse(t)}catch(e){le.error("error while parsing gitGraph options",e.message)}},"setOptions"),D5t=x(function(){return Ot.records.options},"getOptions"),O5t=x(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;le.info("commit",e,r,n,i),le.debug("Entering commit:",e,r,n,i);const a=Bg();r=At.sanitizeText(r,a),e=At.sanitizeText(e,a),i=i==null?void 0:i.map(o=>At.sanitizeText(o,a));const s={id:r||Ot.records.seq+"-"+M7(),message:e,seq:Ot.records.seq++,type:n??Mn.NORMAL,tags:i??[],parents:Ot.records.head==null?[]:[Ot.records.head.id],branch:Ot.records.currBranch};Ot.records.head=s,le.info("main branch",a.mainBranchName),Ot.records.commits.has(s.id)&&le.warn(`Commit ID ${s.id} already exists`),Ot.records.commits.set(s.id,s),Ot.records.branches.set(Ot.records.currBranch,s.id),le.debug("in pushCommit "+s.id)},"commit"),$5t=x(function(t){let e=t.name;const r=t.order;if(e=At.sanitizeText(e,Bg()),Ot.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);Ot.records.branches.set(e,Ot.records.head!=null?Ot.records.head.id:null),Ot.records.branchConfig.set(e,{name:e,order:r}),IAe(e),le.debug("in createBranch")},"branch"),P5t=x(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=Bg();e=At.sanitizeText(e,a),r&&(r=At.sanitizeText(r,a));const s=Ot.records.branches.get(Ot.records.currBranch),o=Ot.records.branches.get(e),l=s?Ot.records.commits.get(s):void 0,u=o?Ot.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Ot.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${Ot.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!Ot.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&Ot.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,token:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i==null?void 0:i.join(" ")}`]},f}const h=o||"",d={id:r||`${Ot.records.seq}-${M7()}`,message:`merged branch ${e} into ${Ot.records.currBranch}`,seq:Ot.records.seq++,parents:Ot.records.head==null?[]:[Ot.records.head.id,h],branch:Ot.records.currBranch,type:Mn.MERGE,customType:n,customId:!!r,tags:i??[]};Ot.records.head=d,Ot.records.commits.set(d.id,d),Ot.records.branches.set(Ot.records.currBranch,d.id),le.debug(Ot.records.branches),le.debug("in mergeBranch")},"merge"),B5t=x(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;le.debug("Entering cherryPick:",e,r,n);const a=Bg();if(e=At.sanitizeText(e,a),r=At.sanitizeText(r,a),n=n==null?void 0:n.map(l=>At.sanitizeText(l,a)),i=At.sanitizeText(i,a),!e||!Ot.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const s=Ot.records.commits.get(e);if(s===void 0||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=s.branch;if(s.type===Mn.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!Ot.records.commits.has(r)){if(o===Ot.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=Ot.records.branches.get(Ot.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Ot.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=Ot.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Ot.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:Ot.records.seq+"-"+M7(),message:`cherry-picked ${s==null?void 0:s.message} into ${Ot.records.currBranch}`,seq:Ot.records.seq++,parents:Ot.records.head==null?[]:[Ot.records.head.id,s.id],branch:Ot.records.currBranch,type:Mn.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===Mn.MERGE?`|parent:${i}`:""}`]};Ot.records.head=h,Ot.records.commits.set(h.id,h),Ot.records.branches.set(Ot.records.currBranch,h.id),le.debug(Ot.records.branches),le.debug("in cherryPick")}},"cherryPick"),IAe=x(function(t){if(t=At.sanitizeText(t,Bg()),Ot.records.branches.has(t)){Ot.records.currBranch=t;const e=Ot.records.branches.get(Ot.records.currBranch);e===void 0||!e?Ot.records.head=null:Ot.records.head=Ot.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function kB(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}x(kB,"upsert");function hU(t){const e=t.reduce((i,a)=>i.seq>a.seq?i:a,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in Ot.records.branches)Ot.records.branches.get(i)===e.id&&n.push(i);if(le.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=Ot.records.commits.get(e.parents[0]);kB(t,e,i),e.parents[1]&&t.push(Ot.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=Ot.records.commits.get(e.parents[0]);kB(t,e,i)}}t=MAe(t,i=>i.id),hU(t)}x(hU,"prettyPrintCommitHistory");var F5t=x(function(){le.debug(Ot.records.commits);const t=NAe()[0];hU([t])},"prettyPrint"),z5t=x(function(){Ot.reset(),$n()},"clear"),V5t=x(function(){return[...Ot.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),G5t=x(function(){return Ot.records.branches},"getBranches"),W5t=x(function(){return Ot.records.commits},"getCommits"),NAe=x(function(){const t=[...Ot.records.commits.values()];return t.forEach(function(e){le.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),H5t=x(function(){return Ot.records.currBranch},"getCurrentBranch"),q5t=x(function(){return Ot.records.direction},"getDirection"),U5t=x(function(){return Ot.records.head},"getHead"),DAe={commitType:Mn,getConfig:Bg,setDirection:I5t,setOptions:N5t,getOptions:D5t,commit:O5t,branch:$5t,merge:P5t,cherryPick:B5t,checkout:IAe,prettyPrint:F5t,clear:z5t,getBranchesAsObjArray:V5t,getBranches:G5t,getCommits:W5t,getCommitsArray:NAe,getCurrentBranch:H5t,getDirection:q5t,getHead:U5t,setAccTitle:Hn,getAccTitle:ni,getAccDescription:ai,setAccDescription:ii,setDiagramTitle:ti,getDiagramTitle:Yn},Y5t=x((t,e)=>{eo(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)X5t(r,e)},"populate"),X5t=x((t,e)=>{const n={Commit:x(i=>e.commit(j5t(i)),"Commit"),Branch:x(i=>e.branch(K5t(i)),"Branch"),Merge:x(i=>e.merge(Z5t(i)),"Merge"),Checkout:x(i=>e.checkout(Q5t(i)),"Checkout"),CherryPicking:x(i=>e.cherryPick(J5t(i)),"CherryPicking")}[t.$type];n?n(t):le.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),j5t=x(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Mn[t.type]:Mn.NORMAL,tags:t.tags??void 0}),"parseCommit"),K5t=x(t=>({name:t.name,order:t.order??0}),"parseBranch"),Z5t=x(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Mn[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Q5t=x(t=>t.branch,"parseCheckout"),J5t=x(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),eAt={parse:x(async t=>{const e=await Al("gitGraph",t);le.debug(e),Y5t(e,DAe)},"parse")},$d=10,Pd=40,Rc=4,qu=2,zp=8,I7=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),SB=12,dU=new Set(["redux-color","redux-dark-color"]),tAt=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Vp=x((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),go=new Map,bo=new Map,m6=30,gw=new Map,y6=[],Uu=0,Hr="LR",rAt=x(()=>{go.clear(),bo.clear(),gw.clear(),Uu=0,y6=[],Hr="LR"},"clear"),OAe=x(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),$Ae=x(t=>{let e,r,n;return Hr==="BT"?(r=x((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=x((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var s,o;const a=Hr==="TB"||Hr=="BT"?(s=bo.get(i))==null?void 0:s.y:(o=bo.get(i))==null?void 0:o.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),nAt=x(t=>{let e="",r=1/0;return t.forEach(n=>{const i=bo.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),iAt=x((t,e,r)=>{let n=r,i=r;const a=[];t.forEach(s=>{const o=e.get(s);if(!o)throw new Error(`Commit not found for key ${s}`);o.parents.length?(n=sAt(o),i=Math.max(n,i)):a.push(o),oAt(o,n)}),n=i,a.forEach(s=>{lAt(s,n,r)}),t.forEach(s=>{const o=e.get(s);if(o!=null&&o.parents.length){const l=nAt(o.parents);n=bo.get(l).y-Pd,n<=i&&(i=n);const u=go.get(o.branch).pos,h=n-$d;bo.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),aAt=x(t=>{var n;const e=$Ae(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=bo.get(e))==null?void 0:n.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),sAt=x(t=>aAt(t)+Pd,"calculateCommitPosition"),oAt=x((t,e)=>{const r=go.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+$d;return bo.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),lAt=x((t,e,r)=>{const n=go.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;bo.set(t.id,{x:a,y:i})},"setRootPosition"),cAt=x((t,e,r,n,i,a)=>{const{theme:s}=Fe(),o=I7.has(s??""),l=dU.has(s??""),u=tAt.has(s??"");if(a===Mn.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(o?3:0)).attr("y",r.y-10+(o?3:0)).attr("width",o?14:20).attr("height",o?14:20).attr("class",`commit ${e.id} commit-highlight${Vp(i,zp,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(o?2:0)).attr("y",r.y-6+(o?2:0)).attr("width",o?8:12).attr("height",o?8:12).attr("class",`commit ${e.id} commit${Vp(i,zp,l)} ${n}-inner`);else if(a===Mn.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",o?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`);else{const h=t.append("circle");if(h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",o?7:10),h.attr("class",`commit ${e.id} commit${Vp(i,zp,l)}`),a===Mn.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",o?5:6),d.attr("class",`commit ${n} ${e.id} commit${Vp(i,zp,l)}`)}if(a===Mn.REVERSE){const d=t.append("path"),f=o?4:5;d.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${e.id} commit${Vp(i,zp,l)}`)}}},"drawCommitBullet"),uAt=x((t,e,r,n,i)=>{var a;if(e.type!==Mn.CHERRY_PICK&&(e.customId&&e.type===Mn.MERGE||e.type!==Mn.MERGE)&&i.showCommitLabel){const s=t.append("g"),o=s.insert("rect").attr("class","commit-label-bkg"),l=s.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(a=l.node())==null?void 0:a.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-qu).attr("y",r.y+13.5).attr("width",u.width+2*qu).attr("height",u.height+2*qu),Hr==="TB"||Hr==="BT"?(o.attr("x",r.x-(u.width+4*Rc+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*Rc)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(Hr==="TB"||Hr==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const h=-7.5-(u.width+10)/25*9.5,d=10+u.width/25*8.5;s.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),hAt=x((t,e,r,n)=>{var i;if(e.tags.length>0){let a=0,s=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-a).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");s=Math.max(s,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:a}),a+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",` ${n-s/2-Rc/2},${g+qu} ${n-s/2-Rc/2},${g-qu} ${r.posWithOffset-s/2-Rc},${g-p-qu} @@ -1582,22 +1584,22 @@ lodash-es/lodash.js: ${r.x+$d},${m-p-2} ${r.x+$d+s+4},${m-p-2} ${r.x+$d+s+4},${m+p+2} - ${r.x+$d},${m+p+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),h.attr("cx",r.x+Rc/2).attr("cy",m).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),u.attr("x",r.x+5).attr("y",m+3).attr("transform","translate(14,14) rotate(45, "+r.x+","+n+")")}}}},"drawCommitTags"),cAt=x(t=>{switch(t.customType??t.type){case Mn.NORMAL:return"commit-normal";case Mn.REVERSE:return"commit-reverse";case Mn.HIGHLIGHT:return"commit-highlight";case Mn.MERGE:return"commit-merge";case Mn.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),uAt=x((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=OAe(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+Pd:e==="BT"?(n.get(t.id)??i).y-Pd:s.x+Pd}}else return e==="TB"?m6:e==="BT"?(n.get(t.id)??i).y-Pd:0;return 0},"calculatePosition"),hAt=x((t,e,r)=>{var l,u;const n=Hr==="BT"&&r?e:e+$d,i=(l=go.get(t.branch))==null?void 0:l.pos,a=Hr==="TB"||Hr==="BT"?(u=go.get(t.branch))==null?void 0:u.pos:n;if(a===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);const s=I7.has(Fe().theme??""),o=Hr==="TB"||Hr==="BT"?n:i+(s?SB/2+1:-2);return{x:a,y:o,posWithOffset:n}},"getCommitPosition"),sie=x((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=Hr==="TB"||Hr==="BT"?m6:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=x((d,f)=>{var m,y;const p=(m=e.get(d))==null?void 0:m.seq,g=(y=e.get(f))==null?void 0:y.seq;return p!==void 0&&g!==void 0?p-g:0},"sortKeys");let h=o.sort(u);Hr==="BT"&&(l&&tAt(h,e,s),h=h.reverse()),h.forEach(d=>{var g;const f=e.get(d);if(!f)throw new Error(`Commit not found for key ${d}`);l&&(s=uAt(f,Hr,s,bo));const p=hAt(f,s,l);if(r){const m=cAt(f),y=f.customType??f.type,v=((g=go.get(f.branch))==null?void 0:g.index)??0;sAt(i,f,p,m,v,y),oAt(a,f,p,s,n),lAt(a,f,p,s)}Hr==="TB"||Hr==="BT"?bo.set(f.id,{x:p.x,y:p.posWithOffset}):bo.set(f.id,{x:p.posWithOffset,y:p.y}),s=Hr==="BT"&&l?s+Pd:s+Pd+$d,s>Uu&&(Uu=s)})},"drawCommits"),dAt=x((t,e,r,n,i)=>{const s=(Hr==="TB"||Hr==="BT"?r.xu.branch===s,"isOnBranchToGetCurve"),l=x(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),mw=x((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(y6.every(s=>Math.abs(s-n)>=10))return y6.push(n),n;const a=Math.abs(t-e);return mw(t,e-a/5,r+1)},"findLane"),fAt=x((t,e,r,n)=>{var m,y,v,T,b;const{theme:i}=Fe(),a=dU.has(i??""),s=bo.get(e.id),o=bo.get(r.id);if(s===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=dAt(e,r,s,o,n);let u="",h="",d=0,f=0,p=(m=go.get(r.branch))==null?void 0:m.index;r.type===Mn.MERGE&&e.id!==r.parents[0]&&(p=(y=go.get(e.branch))==null?void 0:y.index);let g;if(l){u="A 10 10, 0, 0, 0,",h="A 10 10, 0, 0, 1,",d=10,f=10;const w=s.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Mn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y-d} ${h} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${u} ${o.x} ${s.y+f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):Hr==="BT"?(s.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Mn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${u} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${h} ${o.x} ${s.y-f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):(s.yo.y&&(r.type===Mn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${o.x-d} ${s.y} ${u} ${o.x} ${s.y-f} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${h} ${s.x+f} ${o.y} L ${o.x} ${o.y}`),s.y===o.y&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+Vp(p,zp,a))},"drawArrow"),pAt=x((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{fAt(r,e.get(a),i,e)})})},"drawArrows"),gAt=x((t,e,r,n)=>{const{look:i,theme:a,themeVariables:s}=Fe(),{dropShadow:o,THEME_COLOR_LIMIT:l}=s,u=I7.has(a??""),h=dU.has(a??""),d=t.append("g");e.forEach((f,p)=>{var L;const g=Vp(p,u?l:zp,h),m=(L=go.get(f.name))==null?void 0:L.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const y=Hr==="TB"||Hr==="BT"?m:u?m+SB/2+1:m-2,v=d.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",Uu),v.attr("y2",y),v.attr("class","branch branch"+g),Hr==="TB"?(v.attr("y1",m6),v.attr("x1",m),v.attr("y2",Uu),v.attr("x2",m)):Hr==="BT"&&(v.attr("y1",Uu),v.attr("x1",m),v.attr("y2",m6),v.attr("x2",m)),y6.push(y);const T=f.name,b=DAe(T),w=d.insert("rect"),S=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);S.node().appendChild(b);const k=b.getBBox(),E=u?0:4,_=u?16:0,M=u?SB:0;i==="neo"&&w.attr("data-look","neo"),w.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",E).attr("ry",E).attr("x",-k.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-k.height/2+10).attr("width",k.width+18+_).attr("height",k.height+4+M),S.attr("transform","translate("+(-k.width-14-(r.rotateCommitLabel===!0?30:0)+_/2)+", "+(y-k.height/2-2)+")"),Hr==="TB"?(w.attr("x",m-k.width/2-10).attr("y",0),S.attr("transform","translate("+(m-k.width/2-5)+", 0)"),u&&(w.attr("transform",`translate(${-_/2-3}, ${-M-10})`),S.attr("transform","translate("+(m-k.width/2-5)+", "+(-M*2+7)+")"))):Hr==="BT"?(w.attr("x",m-k.width/2-10).attr("y",Uu),S.attr("transform","translate("+(m-k.width/2-5)+", "+Uu+")"),u&&(w.attr("transform",`translate(${-_/2-3}, ${M+10})`),S.attr("transform","translate("+(m-k.width/2-5)+", "+(Uu+M*2+4)+")"))):w.attr("transform","translate(-19, "+(y-12-M/2)+")")})},"drawBranches"),mAt=x(function(t,e,r,n,i){return go.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(Hr==="TB"||Hr==="BT"?n.width/2:0),e},"setBranchPosition"),yAt=x(function(t,e,r,n){J5t(),le.debug("in gitgraph renderer",t+` -`,"id:",e,r);const i=n.db;if(!i.getConfig){le.error("getConfig method is not available on db");return}const a=i.getConfig(),s=a.rotateCommitLabel??!1;gw=i.getCommits();const o=i.getBranchesAsObjArray();Hr=i.getDirection();const l=ut(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=Fe(),{useGradient:f,gradientStart:p,gradientStop:g,filterColor:m}=d;if(f){const v=l.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");v.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),v.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}u==="neo"&&I7.has(h??"")&&l.append("defs").append("filter").attr("id",e+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",m);let y=0;o.forEach((v,T)=>{var E;const b=DAe(v.name),w=l.append("g"),C=w.insert("g").attr("class","branchLabel"),S=C.insert("g").attr("class","label branch-label");(E=S.node())==null||E.appendChild(b);const k=b.getBBox();y=mAt(v.name,y,T,k,s),S.remove(),C.remove(),w.remove()}),sie(l,gw,!1,a),a.showBranches&&gAt(l,o,a,e),pAt(l,gw),sie(l,gw,!0,a),yr.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),Mz(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),vAt={draw:yAt},$Ae=8,PAe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),bAt=new Set(["redux-color","redux-dark-color"]),xAt=new Set(["neo","neo-dark"]),TAt=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),wAt=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),CAt=x(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{switch(t.customType??t.type){case Mn.NORMAL:return"commit-normal";case Mn.REVERSE:return"commit-reverse";case Mn.HIGHLIGHT:return"commit-highlight";case Mn.MERGE:return"commit-merge";case Mn.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),fAt=x((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=$Ae(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+Pd:e==="BT"?(n.get(t.id)??i).y-Pd:s.x+Pd}}else return e==="TB"?m6:e==="BT"?(n.get(t.id)??i).y-Pd:0;return 0},"calculatePosition"),pAt=x((t,e,r)=>{var l,u;const n=Hr==="BT"&&r?e:e+$d,i=(l=go.get(t.branch))==null?void 0:l.pos,a=Hr==="TB"||Hr==="BT"?(u=go.get(t.branch))==null?void 0:u.pos:n;if(a===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);const s=I7.has(Fe().theme??""),o=Hr==="TB"||Hr==="BT"?n:i+(s?SB/2+1:-2);return{x:a,y:o,posWithOffset:n}},"getCommitPosition"),oie=x((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=Hr==="TB"||Hr==="BT"?m6:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=x((d,f)=>{var m,y;const p=(m=e.get(d))==null?void 0:m.seq,g=(y=e.get(f))==null?void 0:y.seq;return p!==void 0&&g!==void 0?p-g:0},"sortKeys");let h=o.sort(u);Hr==="BT"&&(l&&iAt(h,e,s),h=h.reverse()),h.forEach(d=>{var g;const f=e.get(d);if(!f)throw new Error(`Commit not found for key ${d}`);l&&(s=fAt(f,Hr,s,bo));const p=pAt(f,s,l);if(r){const m=dAt(f),y=f.customType??f.type,v=((g=go.get(f.branch))==null?void 0:g.index)??0;cAt(i,f,p,m,v,y),uAt(a,f,p,s,n),hAt(a,f,p,s)}Hr==="TB"||Hr==="BT"?bo.set(f.id,{x:p.x,y:p.posWithOffset}):bo.set(f.id,{x:p.posWithOffset,y:p.y}),s=Hr==="BT"&&l?s+Pd:s+Pd+$d,s>Uu&&(Uu=s)})},"drawCommits"),gAt=x((t,e,r,n,i)=>{const s=(Hr==="TB"||Hr==="BT"?r.xu.branch===s,"isOnBranchToGetCurve"),l=x(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),mw=x((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(y6.every(s=>Math.abs(s-n)>=10))return y6.push(n),n;const a=Math.abs(t-e);return mw(t,e-a/5,r+1)},"findLane"),mAt=x((t,e,r,n)=>{var m,y,v,T,b;const{theme:i}=Fe(),a=dU.has(i??""),s=bo.get(e.id),o=bo.get(r.id);if(s===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=gAt(e,r,s,o,n);let u="",h="",d=0,f=0,p=(m=go.get(r.branch))==null?void 0:m.index;r.type===Mn.MERGE&&e.id!==r.parents[0]&&(p=(y=go.get(e.branch))==null?void 0:y.index);let g;if(l){u="A 10 10, 0, 0, 0,",h="A 10 10, 0, 0, 1,",d=10,f=10;const w=s.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Mn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y-d} ${h} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${u} ${o.x} ${s.y+f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):Hr==="BT"?(s.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Mn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${u} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${h} ${o.x} ${s.y-f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):(s.yo.y&&(r.type===Mn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${o.x-d} ${s.y} ${u} ${o.x} ${s.y-f} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${h} ${s.x+f} ${o.y} L ${o.x} ${o.y}`),s.y===o.y&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+Vp(p,zp,a))},"drawArrow"),yAt=x((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{mAt(r,e.get(a),i,e)})})},"drawArrows"),vAt=x((t,e,r,n)=>{const{look:i,theme:a,themeVariables:s}=Fe(),{dropShadow:o,THEME_COLOR_LIMIT:l}=s,u=I7.has(a??""),h=dU.has(a??""),d=t.append("g");e.forEach((f,p)=>{var L;const g=Vp(p,u?l:zp,h),m=(L=go.get(f.name))==null?void 0:L.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const y=Hr==="TB"||Hr==="BT"?m:u?m+SB/2+1:m-2,v=d.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",Uu),v.attr("y2",y),v.attr("class","branch branch"+g),Hr==="TB"?(v.attr("y1",m6),v.attr("x1",m),v.attr("y2",Uu),v.attr("x2",m)):Hr==="BT"&&(v.attr("y1",Uu),v.attr("x1",m),v.attr("y2",m6),v.attr("x2",m)),y6.push(y);const T=f.name,b=OAe(T),w=d.insert("rect"),S=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);S.node().appendChild(b);const k=b.getBBox(),E=u?0:4,_=u?16:0,M=u?SB:0;i==="neo"&&w.attr("data-look","neo"),w.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",E).attr("ry",E).attr("x",-k.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-k.height/2+10).attr("width",k.width+18+_).attr("height",k.height+4+M),S.attr("transform","translate("+(-k.width-14-(r.rotateCommitLabel===!0?30:0)+_/2)+", "+(y-k.height/2-2)+")"),Hr==="TB"?(w.attr("x",m-k.width/2-10).attr("y",0),S.attr("transform","translate("+(m-k.width/2-5)+", 0)"),u&&(w.attr("transform",`translate(${-_/2-3}, ${-M-10})`),S.attr("transform","translate("+(m-k.width/2-5)+", "+(-M*2+7)+")"))):Hr==="BT"?(w.attr("x",m-k.width/2-10).attr("y",Uu),S.attr("transform","translate("+(m-k.width/2-5)+", "+Uu+")"),u&&(w.attr("transform",`translate(${-_/2-3}, ${M+10})`),S.attr("transform","translate("+(m-k.width/2-5)+", "+(Uu+M*2+4)+")"))):w.attr("transform","translate(-19, "+(y-12-M/2)+")")})},"drawBranches"),bAt=x(function(t,e,r,n,i){return go.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(Hr==="TB"||Hr==="BT"?n.width/2:0),e},"setBranchPosition"),xAt=x(function(t,e,r,n){rAt(),le.debug("in gitgraph renderer",t+` +`,"id:",e,r);const i=n.db;if(!i.getConfig){le.error("getConfig method is not available on db");return}const a=i.getConfig(),s=a.rotateCommitLabel??!1;gw=i.getCommits();const o=i.getBranchesAsObjArray();Hr=i.getDirection();const l=ut(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=Fe(),{useGradient:f,gradientStart:p,gradientStop:g,filterColor:m}=d;if(f){const v=l.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");v.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),v.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}u==="neo"&&I7.has(h??"")&&l.append("defs").append("filter").attr("id",e+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",m);let y=0;o.forEach((v,T)=>{var E;const b=OAe(v.name),w=l.append("g"),C=w.insert("g").attr("class","branchLabel"),S=C.insert("g").attr("class","label branch-label");(E=S.node())==null||E.appendChild(b);const k=b.getBBox();y=bAt(v.name,y,T,k,s),S.remove(),C.remove(),w.remove()}),oie(l,gw,!1,a),a.showBranches&&vAt(l,o,a,e),yAt(l,gw),oie(l,gw,!0,a),yr.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),Mz(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),TAt={draw:xAt},PAe=8,BAe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),wAt=new Set(["redux-color","redux-dark-color"]),CAt=new Set(["neo","neo-dark"]),kAt=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),SAt=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),EAt=x(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{const e=Xt(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,a=PAe.has(r);if(xAt.has(r)){let s="";for(let o=0;o{const e=Xt(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,a=BAe.has(r);if(CAt.has(r)){let s="";for(let o=0;o`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%$Ae;return` + `;return s}},"genColor"),_At=x(t=>`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%PAe;return` .branch-label${e} { fill: ${t["gitBranchLabel"+r]}; } .commit${e} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; } .commit-highlight${e} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; } .label${e} { fill: ${t["git"+r]}; } .arrow${e} { stroke: ${t["git"+r]}; } `}).join(` -`)}`,"normalTheme"),EAt=x(t=>{const e=Xt(),{theme:r}=e,n=wAt.has(r);return` +`)}`,"normalTheme"),RAt=x(t=>{const e=Xt(),{theme:r}=e,n=SAt.has(r);return` .commit-id, .commit-msg, .branch-label { @@ -1635,7 +1637,7 @@ lodash-es/lodash.js: font-family: var(--mermaid-font-family); } - ${n?kAt(t):SAt(t)} + ${n?AAt(t):_At(t)} .branch { stroke-width: ${t.strokeWidth}; @@ -1666,7 +1668,7 @@ lodash-es/lodash.js: .arrow { /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ - stroke-width: ${PAe.has(r)?t.strokeWidth:8}; + stroke-width: ${BAe.has(r)?t.strokeWidth:8}; stroke-linecap: round; fill: none } @@ -1675,12 +1677,12 @@ lodash-es/lodash.js: font-size: 18px; fill: ${t.textColor}; } -`},"getStyles"),AAt=EAt,_At={parser:Z5t,db:NAe,renderer:vAt,styles:AAt};const RAt=Object.freeze(Object.defineProperty({__proto__:null,diagram:_At},Symbol.toStringTag,{value:"Module"}));var q3={exports:{}},LAt=q3.exports,oie;function MAt(){return oie||(oie=1,(function(t,e){(function(r,n){t.exports=n()})(LAt,(function(){var r="day";return function(n,i,a){var s=function(u){return u.add(4-u.isoWeekday(),r)},o=i.prototype;o.isoWeekYear=function(){return s(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=s(this),m=(h=this.isoWeekYear(),d=this.$u,f=(d?a.utc:a)().year(h).startOf("year"),p=4-f.isoWeekday(),f.isoWeekday()>4&&(p+=7),f.add(p,r));return g.diff(m,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,h){var d=this.$utils(),f=!!d.u(h)||h;return d.p(u)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,h)}}}))})(q3)),q3.exports}var IAt=MAt();const NAt=eg(IAt);var U3={exports:{}},DAt=U3.exports,lie;function OAt(){return lie||(lie=1,(function(t,e){(function(r,n){t.exports=n()})(DAt,(function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,s=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,l={},u=function(y){return(y=+y)+(y>68?1900:2e3)},h=function(y){return function(v){this[y]=+v}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var T=v.match(/([+-]|\d\d)/g),b=60*T[1]+(+T[2]||0);return b===0?0:T[0]==="+"?-b:b})(y)}],f=function(y){var v=l[y];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(y,v){var T,b=l.meridiem;if(b){for(var w=1;w<=24;w+=1)if(y.indexOf(b(w,0,v))>-1){T=w>12;break}}else T=y===(v?"pm":"PM");return T},g={A:[o,function(y){this.afternoon=p(y,!1)}],a:[o,function(y){this.afternoon=p(y,!0)}],Q:[i,function(y){this.month=3*(y-1)+1}],S:[i,function(y){this.milliseconds=100*+y}],SS:[a,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[s,h("seconds")],ss:[s,h("seconds")],m:[s,h("minutes")],mm:[s,h("minutes")],H:[s,h("hours")],h:[s,h("hours")],HH:[s,h("hours")],hh:[s,h("hours")],D:[s,h("day")],DD:[a,h("day")],Do:[o,function(y){var v=l.ordinal,T=y.match(/\d+/);if(this.day=T[0],v)for(var b=1;b<=31;b+=1)v(b).replace(/\[|\]/g,"")===y&&(this.day=b)}],w:[s,h("week")],ww:[a,h("week")],M:[s,h("month")],MM:[a,h("month")],MMM:[o,function(y){var v=f("months"),T=(f("monthsShort")||v.map((function(b){return b.slice(0,3)}))).indexOf(y)+1;if(T<1)throw new Error;this.month=T%12||T}],MMMM:[o,function(y){var v=f("months").indexOf(y)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,h("year")],YY:[a,function(y){this.year=u(y)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(y){var v,T;v=y,T=l&&l.formats;for(var b=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(M,L,P){var D=P&&P.toUpperCase();return L||T[P]||r[P]||T[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(R,I,$){return I||$.slice(1)}))}))).match(n),w=b.length,C=0;C-1)return new Date((N==="X"?1e3:1)*O);var V=m(N)(O),B=V.year,G=V.month,H=V.day,q=V.hours,Z=V.minutes,Y=V.seconds,ie=V.milliseconds,K=V.zone,Q=V.week,te=new Date,J=H||(B||G?1:te.getDate()),ge=B||te.getFullYear(),ee=0;B&&!G||(ee=G>0?G-1:te.getMonth());var Re,Ie=q||0,Be=Z||0,ce=Y||0,oe=ie||0;return K?new Date(Date.UTC(ge,ee,J,Ie,Be,ce,oe+60*K.offset*1e3)):F?new Date(Date.UTC(ge,ee,J,Ie,Be,ce,oe)):(Re=new Date(ge,ee,J,Ie,Be,ce,oe),Q&&(Re=z(Re).week(Q).toDate()),Re)}catch{return new Date("")}})(S,_,k,T),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),P&&S!=this.format(_)&&(this.$d=new Date("")),l={}}else if(_ instanceof Array)for(var R=_.length,I=1;I<=R;I+=1){E[1]=_[I-1];var $=T.apply(this,E);if($.isValid()){this.$d=$.$d,this.$L=$.$L,this.init();break}I===R&&(this.$d=new Date(""))}else w.call(this,C)}}}))})(U3)),U3.exports}var $At=OAt();const PAt=eg($At);var Y3={exports:{}},BAt=Y3.exports,cie;function FAt(){return cie||(cie=1,(function(t,e){(function(r,n){t.exports=n()})(BAt,(function(){return function(r,n){var i=n.prototype,a=i.format;i.format=function(s){var o=this,l=this.$locale();if(!this.isValid())return a.bind(this)(s);var u=this.$utils(),h=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return u.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}}));return a.bind(this)(h)}}}))})(Y3)),Y3.exports}var zAt=FAt();const VAt=eg(zAt);var X3={exports:{}},GAt=X3.exports,uie;function WAt(){return uie||(uie=1,(function(t,e){(function(r,n){t.exports=n()})(GAt,(function(){var r,n,i=1e3,a=6e4,s=36e5,o=864e5,l=31536e6,u=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,f={years:l,months:u,days:o,hours:s,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},p=function(S){return S instanceof w},g=function(S,k,E){return new w(S,E,k.$l)},m=function(S){return n.p(S)+"s"},y=function(S){return S<0},v=function(S){return y(S)?Math.ceil(S):Math.floor(S)},T=function(S){return Math.abs(S)},b=function(S,k){return S?y(S)?{negative:!0,format:""+T(S)+k}:{negative:!1,format:""+S+k}:{negative:!1,format:""}},w=(function(){function S(E,_,M){var L=this;if(this.$d={},this.$l=M,E===void 0&&(this.$ms=0,this.parseFromMilliseconds()),_)return g(E*f[m(_)],this);if(typeof E=="number")return this.$ms=E,this.parseFromMilliseconds(),this;if(typeof E=="object")return Object.keys(E).forEach((function(R){L.$d[m(R)]=E[R]})),this.calMilliseconds(),this;if(typeof E=="string"){var P=E.match(h);if(P){var D=P.slice(2).map((function(R){return R!=null?Number(R):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=S.prototype;return k.calMilliseconds=function(){var E=this;this.$ms=Object.keys(this.$d).reduce((function(_,M){return _+(E.$d[M]||0)*f[M]}),0)},k.parseFromMilliseconds=function(){var E=this.$ms;this.$d.years=v(E/l),E%=l,this.$d.months=v(E/u),E%=u,this.$d.days=v(E/o),E%=o,this.$d.hours=v(E/s),E%=s,this.$d.minutes=v(E/a),E%=a,this.$d.seconds=v(E/i),E%=i,this.$d.milliseconds=E},k.toISOString=function(){var E=b(this.$d.years,"Y"),_=b(this.$d.months,"M"),M=+this.$d.days||0;this.$d.weeks&&(M+=7*this.$d.weeks);var L=b(M,"D"),P=b(this.$d.hours,"H"),D=b(this.$d.minutes,"M"),R=this.$d.seconds||0;this.$d.milliseconds&&(R+=this.$d.milliseconds/1e3,R=Math.round(1e3*R)/1e3);var I=b(R,"S"),$=E.negative||_.negative||L.negative||P.negative||D.negative||I.negative,O=P.format||D.format||I.format?"T":"",N=($?"-":"")+"P"+E.format+_.format+L.format+O+P.format+D.format+I.format;return N==="P"||N==="-P"?"P0D":N},k.toJSON=function(){return this.toISOString()},k.format=function(E){var _=E||"YYYY-MM-DDTHH:mm:ss",M={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return _.replace(d,(function(L,P){return P||String(M[L])}))},k.as=function(E){return this.$ms/f[m(E)]},k.get=function(E){var _=this.$ms,M=m(E);return M==="milliseconds"?_%=1e3:_=M==="weeks"?v(_/f[M]):this.$d[M],_||0},k.add=function(E,_,M){var L;return L=_?E*f[m(_)]:p(E)?E.$ms:g(E,this).$ms,g(this.$ms+L*(M?-1:1),this)},k.subtract=function(E,_){return this.add(E,_,!0)},k.locale=function(E){var _=this.clone();return _.$l=E,_},k.clone=function(){return g(this.$ms,this)},k.humanize=function(E){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!E)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},S})(),C=function(S,k,E){return S.add(k.years()*E,"y").add(k.months()*E,"M").add(k.days()*E,"d").add(k.hours()*E,"h").add(k.minutes()*E,"m").add(k.seconds()*E,"s").add(k.milliseconds()*E,"ms")};return function(S,k,E){r=E,n=E().$utils(),E.duration=function(L,P){var D=E.locale();return g(L,{$l:D},P)},E.isDuration=p;var _=k.prototype.add,M=k.prototype.subtract;k.prototype.add=function(L,P){return p(L)?C(this,L,1):_.bind(this)(L,P)},k.prototype.subtract=function(L,P){return p(L)?C(this,L,-1):M.bind(this)(L,P)}}}))})(X3)),X3.exports}var HAt=WAt();const qAt=eg(HAt);var EB=(function(){var t=x(function(D,R,I,$){for(I=I||{},$=D.length;$--;I[D[$]]=R);return I},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],o=[1,31],l=[1,32],u=[1,33],h=[1,34],d=[1,9],f=[1,10],p=[1,11],g=[1,12],m=[1,13],y=[1,14],v=[1,15],T=[1,16],b=[1,19],w=[1,20],C=[1,21],S=[1,22],k=[1,23],E=[1,25],_=[1,35],M={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:x(function(R,I,$,O,N,F,z){var V=F.length-1;switch(N){case 1:return F[V-1];case 2:this.$=[];break;case 3:F[V-1].push(F[V]),this.$=F[V-1];break;case 4:case 5:this.$=F[V];break;case 6:case 7:this.$=[];break;case 8:O.setWeekday("monday");break;case 9:O.setWeekday("tuesday");break;case 10:O.setWeekday("wednesday");break;case 11:O.setWeekday("thursday");break;case 12:O.setWeekday("friday");break;case 13:O.setWeekday("saturday");break;case 14:O.setWeekday("sunday");break;case 15:O.setWeekend("friday");break;case 16:O.setWeekend("saturday");break;case 17:O.setDateFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 18:O.enableInclusiveEndDates(),this.$=F[V].substr(18);break;case 19:O.TopAxis(),this.$=F[V].substr(8);break;case 20:O.setAxisFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 21:O.setTickInterval(F[V].substr(13)),this.$=F[V].substr(13);break;case 22:O.setExcludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 23:O.setIncludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 24:O.setTodayMarker(F[V].substr(12)),this.$=F[V].substr(12);break;case 27:O.setDiagramTitle(F[V].substr(6)),this.$=F[V].substr(6);break;case 28:this.$=F[V].trim(),O.setAccTitle(this.$);break;case 29:case 30:this.$=F[V].trim(),O.setAccDescription(this.$);break;case 31:O.addSection(F[V].substr(8)),this.$=F[V].substr(8);break;case 33:O.addTask(F[V-1],F[V]),this.$="task";break;case 34:this.$=F[V-1],O.setClickEvent(F[V-1],F[V],null);break;case 35:this.$=F[V-2],O.setClickEvent(F[V-2],F[V-1],F[V]);break;case 36:this.$=F[V-2],O.setClickEvent(F[V-2],F[V-1],null),O.setLink(F[V-2],F[V]);break;case 37:this.$=F[V-3],O.setClickEvent(F[V-3],F[V-2],F[V-1]),O.setLink(F[V-3],F[V]);break;case 38:this.$=F[V-2],O.setClickEvent(F[V-2],F[V],null),O.setLink(F[V-2],F[V-1]);break;case 39:this.$=F[V-3],O.setClickEvent(F[V-3],F[V-1],F[V]),O.setLink(F[V-3],F[V-2]);break;case 40:this.$=F[V-1],O.setLink(F[V-1],F[V]);break;case 41:case 47:this.$=F[V-1]+" "+F[V];break;case 42:case 43:case 45:this.$=F[V-2]+" "+F[V-1]+" "+F[V];break;case 44:case 46:this.$=F[V-3]+" "+F[V-2]+" "+F[V-1]+" "+F[V];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:T,30:b,31:w,33:C,35:S,36:k,37:24,38:E,40:_},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:T,30:b,31:w,33:C,35:S,36:k,37:24,38:E,40:_},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:x(function(R,I){if(I.recoverable)this.trace(R);else{var $=new Error(R);throw $.hash=I,$}},"parseError"),parse:x(function(R){var I=this,$=[0],O=[],N=[null],F=[],z=this.table,V="",B=0,G=0,H=2,q=1,Z=F.slice.call(arguments,1),Y=Object.create(this.lexer),ie={yy:{}};for(var K in this.yy)Object.prototype.hasOwnProperty.call(this.yy,K)&&(ie.yy[K]=this.yy[K]);Y.setInput(R,ie.yy),ie.yy.lexer=Y,ie.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var Q=Y.yylloc;F.push(Q);var te=Y.options&&Y.options.ranges;typeof ie.yy.parseError=="function"?this.parseError=ie.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function J(Ce){$.length=$.length-2*Ce,N.length=N.length-Ce,F.length=F.length-Ce}x(J,"popStack");function ge(){var Ce;return Ce=O.pop()||Y.lex()||q,typeof Ce!="number"&&(Ce instanceof Array&&(O=Ce,Ce=O.pop()),Ce=I.symbols_[Ce]||Ce),Ce}x(ge,"lex");for(var ee,Re,Ie,Be,ce={},oe,be,fe,Pe;;){if(Re=$[$.length-1],this.defaultActions[Re]?Ie=this.defaultActions[Re]:((ee===null||typeof ee>"u")&&(ee=ge()),Ie=z[Re]&&z[Re][ee]),typeof Ie>"u"||!Ie.length||!Ie[0]){var ve="";Pe=[];for(oe in z[Re])this.terminals_[oe]&&oe>H&&Pe.push("'"+this.terminals_[oe]+"'");Y.showPosition?ve="Parse error on line "+(B+1)+`: +`},"getStyles"),LAt=RAt,MAt={parser:eAt,db:DAe,renderer:TAt,styles:LAt};const IAt=Object.freeze(Object.defineProperty({__proto__:null,diagram:MAt},Symbol.toStringTag,{value:"Module"}));var q3={exports:{}},NAt=q3.exports,lie;function DAt(){return lie||(lie=1,(function(t,e){(function(r,n){t.exports=n()})(NAt,(function(){var r="day";return function(n,i,a){var s=function(u){return u.add(4-u.isoWeekday(),r)},o=i.prototype;o.isoWeekYear=function(){return s(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=s(this),m=(h=this.isoWeekYear(),d=this.$u,f=(d?a.utc:a)().year(h).startOf("year"),p=4-f.isoWeekday(),f.isoWeekday()>4&&(p+=7),f.add(p,r));return g.diff(m,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,h){var d=this.$utils(),f=!!d.u(h)||h;return d.p(u)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,h)}}}))})(q3)),q3.exports}var OAt=DAt();const $At=eg(OAt);var U3={exports:{}},PAt=U3.exports,cie;function BAt(){return cie||(cie=1,(function(t,e){(function(r,n){t.exports=n()})(PAt,(function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,s=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,l={},u=function(y){return(y=+y)+(y>68?1900:2e3)},h=function(y){return function(v){this[y]=+v}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var T=v.match(/([+-]|\d\d)/g),b=60*T[1]+(+T[2]||0);return b===0?0:T[0]==="+"?-b:b})(y)}],f=function(y){var v=l[y];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(y,v){var T,b=l.meridiem;if(b){for(var w=1;w<=24;w+=1)if(y.indexOf(b(w,0,v))>-1){T=w>12;break}}else T=y===(v?"pm":"PM");return T},g={A:[o,function(y){this.afternoon=p(y,!1)}],a:[o,function(y){this.afternoon=p(y,!0)}],Q:[i,function(y){this.month=3*(y-1)+1}],S:[i,function(y){this.milliseconds=100*+y}],SS:[a,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[s,h("seconds")],ss:[s,h("seconds")],m:[s,h("minutes")],mm:[s,h("minutes")],H:[s,h("hours")],h:[s,h("hours")],HH:[s,h("hours")],hh:[s,h("hours")],D:[s,h("day")],DD:[a,h("day")],Do:[o,function(y){var v=l.ordinal,T=y.match(/\d+/);if(this.day=T[0],v)for(var b=1;b<=31;b+=1)v(b).replace(/\[|\]/g,"")===y&&(this.day=b)}],w:[s,h("week")],ww:[a,h("week")],M:[s,h("month")],MM:[a,h("month")],MMM:[o,function(y){var v=f("months"),T=(f("monthsShort")||v.map((function(b){return b.slice(0,3)}))).indexOf(y)+1;if(T<1)throw new Error;this.month=T%12||T}],MMMM:[o,function(y){var v=f("months").indexOf(y)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,h("year")],YY:[a,function(y){this.year=u(y)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(y){var v,T;v=y,T=l&&l.formats;for(var b=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(M,L,P){var D=P&&P.toUpperCase();return L||T[P]||r[P]||T[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(R,I,$){return I||$.slice(1)}))}))).match(n),w=b.length,C=0;C-1)return new Date((N==="X"?1e3:1)*O);var V=m(N)(O),B=V.year,G=V.month,H=V.day,q=V.hours,Z=V.minutes,Y=V.seconds,ie=V.milliseconds,K=V.zone,Q=V.week,te=new Date,J=H||(B||G?1:te.getDate()),ge=B||te.getFullYear(),ee=0;B&&!G||(ee=G>0?G-1:te.getMonth());var Re,Ie=q||0,Be=Z||0,ce=Y||0,oe=ie||0;return K?new Date(Date.UTC(ge,ee,J,Ie,Be,ce,oe+60*K.offset*1e3)):F?new Date(Date.UTC(ge,ee,J,Ie,Be,ce,oe)):(Re=new Date(ge,ee,J,Ie,Be,ce,oe),Q&&(Re=z(Re).week(Q).toDate()),Re)}catch{return new Date("")}})(S,_,k,T),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),P&&S!=this.format(_)&&(this.$d=new Date("")),l={}}else if(_ instanceof Array)for(var R=_.length,I=1;I<=R;I+=1){E[1]=_[I-1];var $=T.apply(this,E);if($.isValid()){this.$d=$.$d,this.$L=$.$L,this.init();break}I===R&&(this.$d=new Date(""))}else w.call(this,C)}}}))})(U3)),U3.exports}var FAt=BAt();const zAt=eg(FAt);var Y3={exports:{}},VAt=Y3.exports,uie;function GAt(){return uie||(uie=1,(function(t,e){(function(r,n){t.exports=n()})(VAt,(function(){return function(r,n){var i=n.prototype,a=i.format;i.format=function(s){var o=this,l=this.$locale();if(!this.isValid())return a.bind(this)(s);var u=this.$utils(),h=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return u.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}}));return a.bind(this)(h)}}}))})(Y3)),Y3.exports}var WAt=GAt();const HAt=eg(WAt);var X3={exports:{}},qAt=X3.exports,hie;function UAt(){return hie||(hie=1,(function(t,e){(function(r,n){t.exports=n()})(qAt,(function(){var r,n,i=1e3,a=6e4,s=36e5,o=864e5,l=31536e6,u=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,f={years:l,months:u,days:o,hours:s,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},p=function(S){return S instanceof w},g=function(S,k,E){return new w(S,E,k.$l)},m=function(S){return n.p(S)+"s"},y=function(S){return S<0},v=function(S){return y(S)?Math.ceil(S):Math.floor(S)},T=function(S){return Math.abs(S)},b=function(S,k){return S?y(S)?{negative:!0,format:""+T(S)+k}:{negative:!1,format:""+S+k}:{negative:!1,format:""}},w=(function(){function S(E,_,M){var L=this;if(this.$d={},this.$l=M,E===void 0&&(this.$ms=0,this.parseFromMilliseconds()),_)return g(E*f[m(_)],this);if(typeof E=="number")return this.$ms=E,this.parseFromMilliseconds(),this;if(typeof E=="object")return Object.keys(E).forEach((function(R){L.$d[m(R)]=E[R]})),this.calMilliseconds(),this;if(typeof E=="string"){var P=E.match(h);if(P){var D=P.slice(2).map((function(R){return R!=null?Number(R):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=S.prototype;return k.calMilliseconds=function(){var E=this;this.$ms=Object.keys(this.$d).reduce((function(_,M){return _+(E.$d[M]||0)*f[M]}),0)},k.parseFromMilliseconds=function(){var E=this.$ms;this.$d.years=v(E/l),E%=l,this.$d.months=v(E/u),E%=u,this.$d.days=v(E/o),E%=o,this.$d.hours=v(E/s),E%=s,this.$d.minutes=v(E/a),E%=a,this.$d.seconds=v(E/i),E%=i,this.$d.milliseconds=E},k.toISOString=function(){var E=b(this.$d.years,"Y"),_=b(this.$d.months,"M"),M=+this.$d.days||0;this.$d.weeks&&(M+=7*this.$d.weeks);var L=b(M,"D"),P=b(this.$d.hours,"H"),D=b(this.$d.minutes,"M"),R=this.$d.seconds||0;this.$d.milliseconds&&(R+=this.$d.milliseconds/1e3,R=Math.round(1e3*R)/1e3);var I=b(R,"S"),$=E.negative||_.negative||L.negative||P.negative||D.negative||I.negative,O=P.format||D.format||I.format?"T":"",N=($?"-":"")+"P"+E.format+_.format+L.format+O+P.format+D.format+I.format;return N==="P"||N==="-P"?"P0D":N},k.toJSON=function(){return this.toISOString()},k.format=function(E){var _=E||"YYYY-MM-DDTHH:mm:ss",M={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return _.replace(d,(function(L,P){return P||String(M[L])}))},k.as=function(E){return this.$ms/f[m(E)]},k.get=function(E){var _=this.$ms,M=m(E);return M==="milliseconds"?_%=1e3:_=M==="weeks"?v(_/f[M]):this.$d[M],_||0},k.add=function(E,_,M){var L;return L=_?E*f[m(_)]:p(E)?E.$ms:g(E,this).$ms,g(this.$ms+L*(M?-1:1),this)},k.subtract=function(E,_){return this.add(E,_,!0)},k.locale=function(E){var _=this.clone();return _.$l=E,_},k.clone=function(){return g(this.$ms,this)},k.humanize=function(E){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!E)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},S})(),C=function(S,k,E){return S.add(k.years()*E,"y").add(k.months()*E,"M").add(k.days()*E,"d").add(k.hours()*E,"h").add(k.minutes()*E,"m").add(k.seconds()*E,"s").add(k.milliseconds()*E,"ms")};return function(S,k,E){r=E,n=E().$utils(),E.duration=function(L,P){var D=E.locale();return g(L,{$l:D},P)},E.isDuration=p;var _=k.prototype.add,M=k.prototype.subtract;k.prototype.add=function(L,P){return p(L)?C(this,L,1):_.bind(this)(L,P)},k.prototype.subtract=function(L,P){return p(L)?C(this,L,-1):M.bind(this)(L,P)}}}))})(X3)),X3.exports}var YAt=UAt();const XAt=eg(YAt);var EB=(function(){var t=x(function(D,R,I,$){for(I=I||{},$=D.length;$--;I[D[$]]=R);return I},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],o=[1,31],l=[1,32],u=[1,33],h=[1,34],d=[1,9],f=[1,10],p=[1,11],g=[1,12],m=[1,13],y=[1,14],v=[1,15],T=[1,16],b=[1,19],w=[1,20],C=[1,21],S=[1,22],k=[1,23],E=[1,25],_=[1,35],M={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:x(function(R,I,$,O,N,F,z){var V=F.length-1;switch(N){case 1:return F[V-1];case 2:this.$=[];break;case 3:F[V-1].push(F[V]),this.$=F[V-1];break;case 4:case 5:this.$=F[V];break;case 6:case 7:this.$=[];break;case 8:O.setWeekday("monday");break;case 9:O.setWeekday("tuesday");break;case 10:O.setWeekday("wednesday");break;case 11:O.setWeekday("thursday");break;case 12:O.setWeekday("friday");break;case 13:O.setWeekday("saturday");break;case 14:O.setWeekday("sunday");break;case 15:O.setWeekend("friday");break;case 16:O.setWeekend("saturday");break;case 17:O.setDateFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 18:O.enableInclusiveEndDates(),this.$=F[V].substr(18);break;case 19:O.TopAxis(),this.$=F[V].substr(8);break;case 20:O.setAxisFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 21:O.setTickInterval(F[V].substr(13)),this.$=F[V].substr(13);break;case 22:O.setExcludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 23:O.setIncludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 24:O.setTodayMarker(F[V].substr(12)),this.$=F[V].substr(12);break;case 27:O.setDiagramTitle(F[V].substr(6)),this.$=F[V].substr(6);break;case 28:this.$=F[V].trim(),O.setAccTitle(this.$);break;case 29:case 30:this.$=F[V].trim(),O.setAccDescription(this.$);break;case 31:O.addSection(F[V].substr(8)),this.$=F[V].substr(8);break;case 33:O.addTask(F[V-1],F[V]),this.$="task";break;case 34:this.$=F[V-1],O.setClickEvent(F[V-1],F[V],null);break;case 35:this.$=F[V-2],O.setClickEvent(F[V-2],F[V-1],F[V]);break;case 36:this.$=F[V-2],O.setClickEvent(F[V-2],F[V-1],null),O.setLink(F[V-2],F[V]);break;case 37:this.$=F[V-3],O.setClickEvent(F[V-3],F[V-2],F[V-1]),O.setLink(F[V-3],F[V]);break;case 38:this.$=F[V-2],O.setClickEvent(F[V-2],F[V],null),O.setLink(F[V-2],F[V-1]);break;case 39:this.$=F[V-3],O.setClickEvent(F[V-3],F[V-1],F[V]),O.setLink(F[V-3],F[V-2]);break;case 40:this.$=F[V-1],O.setLink(F[V-1],F[V]);break;case 41:case 47:this.$=F[V-1]+" "+F[V];break;case 42:case 43:case 45:this.$=F[V-2]+" "+F[V-1]+" "+F[V];break;case 44:case 46:this.$=F[V-3]+" "+F[V-2]+" "+F[V-1]+" "+F[V];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:T,30:b,31:w,33:C,35:S,36:k,37:24,38:E,40:_},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:T,30:b,31:w,33:C,35:S,36:k,37:24,38:E,40:_},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:x(function(R,I){if(I.recoverable)this.trace(R);else{var $=new Error(R);throw $.hash=I,$}},"parseError"),parse:x(function(R){var I=this,$=[0],O=[],N=[null],F=[],z=this.table,V="",B=0,G=0,H=2,q=1,Z=F.slice.call(arguments,1),Y=Object.create(this.lexer),ie={yy:{}};for(var K in this.yy)Object.prototype.hasOwnProperty.call(this.yy,K)&&(ie.yy[K]=this.yy[K]);Y.setInput(R,ie.yy),ie.yy.lexer=Y,ie.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var Q=Y.yylloc;F.push(Q);var te=Y.options&&Y.options.ranges;typeof ie.yy.parseError=="function"?this.parseError=ie.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function J(Ce){$.length=$.length-2*Ce,N.length=N.length-Ce,F.length=F.length-Ce}x(J,"popStack");function ge(){var Ce;return Ce=O.pop()||Y.lex()||q,typeof Ce!="number"&&(Ce instanceof Array&&(O=Ce,Ce=O.pop()),Ce=I.symbols_[Ce]||Ce),Ce}x(ge,"lex");for(var ee,Re,Ie,Be,ce={},oe,be,fe,Pe;;){if(Re=$[$.length-1],this.defaultActions[Re]?Ie=this.defaultActions[Re]:((ee===null||typeof ee>"u")&&(ee=ge()),Ie=z[Re]&&z[Re][ee]),typeof Ie>"u"||!Ie.length||!Ie[0]){var ve="";Pe=[];for(oe in z[Re])this.terminals_[oe]&&oe>H&&Pe.push("'"+this.terminals_[oe]+"'");Y.showPosition?ve="Parse error on line "+(B+1)+`: `+Y.showPosition()+` Expecting `+Pe.join(", ")+", got '"+(this.terminals_[ee]||ee)+"'":ve="Parse error on line "+(B+1)+": Unexpected "+(ee==q?"end of input":"'"+(this.terminals_[ee]||ee)+"'"),this.parseError(ve,{text:Y.match,token:this.terminals_[ee]||ee,line:Y.yylineno,loc:Q,expected:Pe})}if(Ie[0]instanceof Array&&Ie.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Re+", token: "+ee);switch(Ie[0]){case 1:$.push(ee),N.push(Y.yytext),F.push(Y.yylloc),$.push(Ie[1]),ee=null,G=Y.yyleng,V=Y.yytext,B=Y.yylineno,Q=Y.yylloc;break;case 2:if(be=this.productions_[Ie[1]][1],ce.$=N[N.length-be],ce._$={first_line:F[F.length-(be||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(be||1)].first_column,last_column:F[F.length-1].last_column},te&&(ce._$.range=[F[F.length-(be||1)].range[0],F[F.length-1].range[1]]),Be=this.performAction.apply(ce,[V,G,B,ie.yy,Ie[1],N,F].concat(Z)),typeof Be<"u")return Be;be&&($=$.slice(0,-1*be*2),N=N.slice(0,-1*be),F=F.slice(0,-1*be)),$.push(this.productions_[Ie[1]][0]),N.push(ce.$),F.push(ce._$),fe=z[$[$.length-2]][$[$.length-1]],$.push(fe);break;case 3:return!0}}return!0},"parse")},L=(function(){var D={EOF:1,parseError:x(function(I,$){if(this.yy.parser)this.yy.parser.parseError(I,$);else throw new Error(I)},"parseError"),setInput:x(function(R,I){return this.yy=I||this.yy||{},this._input=R,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var R=this._input[0];this.yytext+=R,this.yyleng++,this.offset++,this.match+=R,this.matched+=R;var I=R.match(/(?:\r\n?|\n).*/g);return I?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),R},"input"),unput:x(function(R){var I=R.length,$=R.split(/(?:\r\n?|\n)/g);this._input=R+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-I),this.offset-=I;var O=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),$.length-1&&(this.yylineno-=$.length-1);var N=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:$?($.length===O.length?this.yylloc.first_column:0)+O[O.length-$.length].length-$[0].length:this.yylloc.first_column-I},this.options.ranges&&(this.yylloc.range=[N[0],N[0]+this.yyleng-I]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(R){this.unput(this.match.slice(R))},"less"),pastInput:x(function(){var R=this.matched.substr(0,this.matched.length-this.match.length);return(R.length>20?"...":"")+R.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var R=this.match;return R.length<20&&(R+=this._input.substr(0,20-R.length)),(R.substr(0,20)+(R.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var R=this.pastInput(),I=new Array(R.length+1).join("-");return R+this.upcomingInput()+` `+I+"^"},"showPosition"),test_match:x(function(R,I){var $,O,N;if(this.options.backtrack_lexer&&(N={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(N.yylloc.range=this.yylloc.range.slice(0))),O=R[0].match(/(?:\r\n?|\n).*/g),O&&(this.yylineno+=O.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:O?O[O.length-1].length-O[O.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+R[0].length},this.yytext+=R[0],this.match+=R[0],this.matches=R,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(R[0].length),this.matched+=R[0],$=this.performAction.call(this,this.yy,this,I,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),$)return $;if(this._backtrack){for(var F in N)this[F]=N[F];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var R,I,$,O;this._more||(this.yytext="",this.match="");for(var N=this._currentRules(),F=0;FI[0].length)){if(I=$,O=F,this.options.backtrack_lexer){if(R=this.test_match($,N[F]),R!==!1)return R;if(this._backtrack){I=!1;continue}else return!1}else if(!this.options.flex)break}return I?(R=this.test_match(I,N[O]),R!==!1?R:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var I=this.next();return I||this.lex()},"lex"),begin:x(function(I){this.conditionStack.push(I)},"begin"),popState:x(function(){var I=this.conditionStack.length-1;return I>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(I){return I=this.conditionStack.length-1-Math.abs(I||0),I>=0?this.conditionStack[I]:"INITIAL"},"topState"),pushState:x(function(I){this.begin(I)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(I,$,O,N){switch(O){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return D})();M.lexer=L;function P(){this.yy={}}return x(P,"Parser"),P.prototype=M,M.Parser=P,new P})();EB.parser=EB;var UAt=EB;xa.extend(NAt);xa.extend(PAt);xa.extend(VAt);var hie={friday:5,saturday:6},Gc="",fU="",pU=void 0,gU="",ax=[],sx=[],mU=new Map,yU=[],v6=[],ox="",vU="",BAe=["active","done","crit","milestone","vert"],bU=[],ay="",YS=!1,xU=!1,TU="sunday",b6="saturday",AB=0,YAt=x(function(){yU=[],v6=[],ox="",bU=[],j3=0,RB=void 0,K3=void 0,ea=[],Gc="",fU="",vU="",pU=void 0,gU="",ax=[],sx=[],YS=!1,xU=!1,AB=0,mU=new Map,ay="",On(),TU="sunday",b6="saturday"},"clear"),XAt=x(function(t){ay=t},"setDiagramId"),jAt=x(function(t){fU=t},"setAxisFormat"),KAt=x(function(){return fU},"getAxisFormat"),ZAt=x(function(t){pU=t},"setTickInterval"),QAt=x(function(){return pU},"getTickInterval"),JAt=x(function(t){gU=t},"setTodayMarker"),e_t=x(function(){return gU},"getTodayMarker"),t_t=x(function(t){Gc=t},"setDateFormat"),r_t=x(function(){YS=!0},"enableInclusiveEndDates"),n_t=x(function(){return YS},"endDatesAreInclusive"),i_t=x(function(){xU=!0},"enableTopAxis"),a_t=x(function(){return xU},"topAxisEnabled"),s_t=x(function(t){vU=t},"setDisplayMode"),o_t=x(function(){return vU},"getDisplayMode"),l_t=x(function(){return Gc},"getDateFormat"),FAe=x((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),c_t=x(function(t){ax=FAe(ax,t)},"setIncludes"),u_t=x(function(){return ax},"getIncludes"),h_t=x(function(t){sx=FAe(sx,t)},"setExcludes"),d_t=x(function(){return sx},"getExcludes"),f_t=x(function(){return mU},"getLinks"),p_t=x(function(t){ox=t,yU.push(t)},"addSection"),g_t=x(function(){return yU},"getSections"),m_t=x(function(){let t=die();const e=10;let r=0;for(;!t&&ro))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,s]},"fixTaskDates"),_B=x(function(t,e,r){if(r=r.trim(),x(o=>{const l=o.trim();return l==="x"||l==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(r))return new Date(Number(r));const a=/^after\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let o=null;for(const u of a.groups.ids.split(" ")){let h=Fg(u);h!==void 0&&(!o||h.endTime>o.endTime)&&(o=h)}if(o)return o.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let s=xa(r,e.trim(),!0);if(s.isValid())return s.toDate();{le.debug("Invalid date:"+r),le.debug("With date format:"+e.trim());const o=new Date(r);if(o===void 0||isNaN(o.getTime())||o.getFullYear()<-1e4||o.getFullYear()>1e4)throw new Error("Invalid date:"+r);return o}},"getStartDate"),GAe=x(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),WAe=x(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let h=null;for(const f of a.groups.ids.split(" ")){let p=Fg(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),mU.set(n,r))}),qAe(t,"clickable")},"setLink"),qAe=x(function(t,e){t.split(",").forEach(function(r){let n=Fg(r);n!==void 0&&n.classes.push(e)})},"setClass"),E_t=x(function(t,e,r){if(Fe().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{yr.runFunc(e,...n)})},"setClickFun"),UAe=x(function(t,e){bU.push(function(){const r=ay?`${ay}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=ay?`${ay}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),A_t=x(function(t,e,r){t.split(",").forEach(function(n){E_t(n,e,r)}),qAe(t,"clickable")},"setClickEvent"),__t=x(function(t){bU.forEach(function(e){e(t)})},"bindFunctions"),R_t={getConfig:x(()=>Fe().gantt,"getConfig"),clear:YAt,setDateFormat:t_t,getDateFormat:l_t,enableInclusiveEndDates:r_t,endDatesAreInclusive:n_t,enableTopAxis:i_t,topAxisEnabled:a_t,setAxisFormat:jAt,getAxisFormat:KAt,setTickInterval:ZAt,getTickInterval:QAt,setTodayMarker:JAt,getTodayMarker:e_t,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,setDiagramId:XAt,setDisplayMode:s_t,getDisplayMode:o_t,setAccDescription:ii,getAccDescription:ai,addSection:p_t,getSections:g_t,getTasks:m_t,addTask:C_t,findTaskById:Fg,addTaskOrg:k_t,setIncludes:c_t,getIncludes:u_t,setExcludes:h_t,getExcludes:d_t,setClickEvent:A_t,setLink:S_t,getLinks:f_t,bindFunctions:__t,parseDuration:GAe,isInvalidDate:zAe,setWeekday:y_t,getWeekday:v_t,setWeekend:b_t};function wU(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",s=new RegExp(a);t[0].match(s)&&(e[i]=!0,t.shift(1),n=!0)})}x(wU,"getTaskTags");xa.extend(qAt);var L_t=x(function(){le.debug("Something is calling, setConf, remove the call")},"setConf"),fie={monday:LC,tuesday:Wce,wednesday:Hce,thursday:M0,friday:qce,saturday:Uce,sunday:Kk},M_t=x((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,s)=>a.startTime-s.startTime||a.order-s.order),i=0;for(const a of n)for(let s=0;s=r[s]){r[s]=a.endTime,a.order=s+e,s>i&&(i=s);break}return i},"getMaxIntersections"),Nu,FN=1e4,I_t=x(function(t,e,r,n){const i=Fe().gantt;n.db.setDiagramId(e);const a=Fe().securityLevel;let s;a==="sandbox"&&(s=ut("#i"+e));const o=ut(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);Nu=u.parentElement.offsetWidth,Nu===void 0&&(Nu=1200),i.useWidth!==void 0&&(Nu=i.useWidth);const h=n.db.getTasks(),d=h.filter(M=>!M.vert);let f=[];for(const M of d)f.push(M.type);f=_(f);const p={};let g=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const M={};for(const P of d)M[P.section]===void 0?M[P.section]=[P]:M[P.section].push(P);let L=0;for(const P of Object.keys(M)){const D=M_t(M[P],L)+1;L+=D,g+=D*(i.barHeight+i.barGap),p[P]=D}}else{g+=d.length*(i.barHeight+i.barGap);for(const M of f)p[M]=d.filter(L=>L.type===M).length}u.setAttribute("viewBox","0 0 "+Nu+" "+g);const m=o.select(`[id="${e}"]`),y=Kqe().domain([nze(h,function(M){return M.startTime}),rze(h,function(M){return M.endTime})]).rangeRound([0,Nu-i.leftPadding-i.rightPadding]);function v(M,L){const P=M.startTime,D=L.startTime;let R=0;return P>D?R=1:PG.vert===H.vert?0:G.vert?1:-1);const O=M.filter(G=>!G.vert),F=[...new Set(O.map(G=>G.order))].map(G=>O.find(H=>H.order===G));m.append("g").selectAll("rect").data(F).enter().append("rect").attr("x",0).attr("y",function(G,H){return H=G.order,H*L+P-2}).attr("width",function(){return $-i.rightPadding/2}).attr("height",L).attr("class",function(G){for(const[H,q]of f.entries())if(G.type===q)return"section section"+H%i.numberSectionStyles;return"section section0"}).enter();const z=m.append("g").selectAll("rect").data(M).enter(),V=n.db.getLinks();if(z.append("rect").attr("id",function(G){return e+"-"+G.id}).attr("rx",3).attr("ry",3).attr("x",function(G){return G.milestone?y(G.startTime)+D+.5*(y(G.endTime)-y(G.startTime))-.5*R:y(G.startTime)+D}).attr("y",function(G,H){return H=G.order,G.vert?i.gridLineStartPadding:H*L+P}).attr("width",function(G){return G.milestone?R:G.vert?.08*R:y(G.renderEndTime||G.endTime)-y(G.startTime)}).attr("height",function(G){return G.vert?O.length*(i.barHeight+i.barGap)+i.barHeight*2:R}).attr("transform-origin",function(G,H){return H=G.order,(y(G.startTime)+D+.5*(y(G.endTime)-y(G.startTime))).toString()+"px "+(H*L+P+.5*R).toString()+"px"}).attr("class",function(G){const H="task";let q="";G.classes.length>0&&(q=G.classes.join(" "));let Z=0;for(const[ie,K]of f.entries())G.type===K&&(Z=ie%i.numberSectionStyles);let Y="";return G.active?G.crit?Y+=" activeCrit":Y=" active":G.done?G.crit?Y=" doneCrit":Y=" done":G.crit&&(Y+=" crit"),Y.length===0&&(Y=" task"),G.milestone&&(Y=" milestone "+Y),G.vert&&(Y=" vert "+Y),Y+=Z,Y+=" "+q,H+Y}),z.append("text").attr("id",function(G){return e+"-"+G.id+"-text"}).text(function(G){return G.task}).attr("font-size",i.fontSize).attr("x",function(G){let H=y(G.startTime),q=y(G.renderEndTime||G.endTime);if(G.milestone&&(H+=.5*(y(G.endTime)-y(G.startTime))-.5*R,q=H+R),G.vert)return y(G.startTime)+D;const Z=this.getBBox().width;return Z>q-H?q+Z+1.5*i.leftPadding>$?H+D-5:q+D+5:(q-H)/2+H+D}).attr("y",function(G,H){return G.vert?i.gridLineStartPadding+O.length*(i.barHeight+i.barGap)+60:(H=G.order,H*L+i.barHeight/2+(i.fontSize/2-2)+P)}).attr("text-height",R).attr("class",function(G){const H=y(G.startTime);let q=y(G.endTime);G.milestone&&(q=H+R);const Z=this.getBBox().width;let Y="";G.classes.length>0&&(Y=G.classes.join(" "));let ie=0;for(const[Q,te]of f.entries())G.type===te&&(ie=Q%i.numberSectionStyles);let K="";return G.active&&(G.crit?K="activeCritText"+ie:K="activeText"+ie),G.done?G.crit?K=K+" doneCritText"+ie:K=K+" doneText"+ie:G.crit&&(K=K+" critText"+ie),G.milestone&&(K+=" milestoneText"),G.vert&&(K+=" vertText"),Z>q-H?q+Z+1.5*i.leftPadding>$?Y+" taskTextOutsideLeft taskTextOutside"+ie+" "+K:Y+" taskTextOutsideRight taskTextOutside"+ie+" "+K+" width-"+Z:Y+" taskText taskText"+ie+" "+K+" width-"+Z}),Fe().securityLevel==="sandbox"){let G;G=ut("#i"+e);const H=G.nodes()[0].contentDocument;z.filter(function(q){return V.has(q.id)}).each(function(q){var Z=H.querySelector("#"+CSS.escape(e+"-"+q.id)),Y=H.querySelector("#"+CSS.escape(e+"-"+q.id+"-text"));const ie=Z.parentNode;var K=H.createElement("a");K.setAttribute("xlink:href",V.get(q.id)),K.setAttribute("target","_top"),ie.appendChild(K),K.appendChild(Z),K.appendChild(Y)})}}x(b,"drawRects");function w(M,L,P,D,R,I,$,O){if($.length===0&&O.length===0)return;let N,F;for(const{startTime:q,endTime:Z}of I)(N===void 0||qF)&&(F=Z);if(!N||!F)return;if(xa(F).diff(xa(N),"year")>5){le.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const z=n.db.getDateFormat(),V=[];let B=null,G=xa(N);for(;G.valueOf()<=F;)n.db.isInvalidDate(G,z,$,O)?B?B.end=G:B={start:G,end:G}:B&&(V.push(B),B=null),G=G.add(1,"d");m.append("g").selectAll("rect").data(V).enter().append("rect").attr("id",q=>e+"-exclude-"+q.start.format("YYYY-MM-DD")).attr("x",q=>y(q.start.startOf("day"))+P).attr("y",i.gridLineStartPadding).attr("width",q=>y(q.end.endOf("day"))-y(q.start.startOf("day"))).attr("height",R-L-i.gridLineStartPadding).attr("transform-origin",function(q,Z){return(y(q.start)+P+.5*(y(q.end)-y(q.start))).toString()+"px "+(Z*M+.5*R).toString()+"px"}).attr("class","exclude-range")}x(w,"drawExcludeDays");function C(M,L,P,D){if(P<=0||M>L)return 1/0;const R=L-M,I=xa.duration({[D??"day"]:P}).asMilliseconds();return I<=0?1/0:Math.ceil(R/I)}x(C,"getEstimatedTickCount");function S(M,L,P,D){const R=n.db.getDateFormat(),I=n.db.getAxisFormat();let $;I?$=I:R==="D"?$="%d":$=i.axisFormat??"%Y-%m-%d";let O=dze(y).tickSize(-D+L+i.gridLineStartPadding).tickFormat(vA($));const F=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(F!==null){const z=parseInt(F[1],10);if(isNaN(z)||z<=0)le.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const V=F[2],B=n.db.getWeekday()||i.weekday,G=y.domain(),H=G[0],q=G[1],Z=C(H,q,z,V);if(Z>FN)le.warn(`The tick interval "${z}${V}" would generate ${Z} ticks, which exceeds the maximum allowed (${FN}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(V){case"millisecond":O.ticks(Eb.every(z));break;case"second":O.ticks(_d.every(z));break;case"minute":O.ticks(_C.every(z));break;case"hour":O.ticks(RC.every(z));break;case"day":O.ticks(L0.every(z));break;case"week":O.ticks(fie[B].every(z));break;case"month":O.ticks(MC.every(z));break}}}if(m.append("g").attr("class","grid").attr("transform","translate("+M+", "+(D-50)+")").call(O).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let z=hze(y).tickSize(-D+L+i.gridLineStartPadding).tickFormat(vA($));if(F!==null){const V=parseInt(F[1],10);if(isNaN(V)||V<=0)le.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const B=F[2],G=n.db.getWeekday()||i.weekday,H=y.domain(),q=H[0],Z=H[1];if(C(q,Z,V,B)<=FN)switch(B){case"millisecond":z.ticks(Eb.every(V));break;case"second":z.ticks(_d.every(V));break;case"minute":z.ticks(_C.every(V));break;case"hour":z.ticks(RC.every(V));break;case"day":z.ticks(L0.every(V));break;case"week":z.ticks(fie[G].every(V));break;case"month":z.ticks(MC.every(V));break}}}m.append("g").attr("class","grid").attr("transform","translate("+M+", "+L+")").call(z).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}x(S,"makeGrid");function k(M,L){let P=0;const D=Object.keys(p).map(R=>[R,p[R]]);m.append("g").selectAll("text").data(D).enter().append(function(R){const I=R[0].split(At.lineBreakRegex),$=-(I.length-1)/2,O=l.createElementNS("http://www.w3.org/2000/svg","text");O.setAttribute("dy",$+"em");for(const[N,F]of I.entries()){const z=l.createElementNS("http://www.w3.org/2000/svg","tspan");z.setAttribute("alignment-baseline","central"),z.setAttribute("x","10"),N>0&&z.setAttribute("dy","1em"),z.textContent=F,O.appendChild(z)}return O}).attr("x",10).attr("y",function(R,I){if(I>0)for(let $=0;$` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var I=this.next();return I||this.lex()},"lex"),begin:x(function(I){this.conditionStack.push(I)},"begin"),popState:x(function(){var I=this.conditionStack.length-1;return I>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(I){return I=this.conditionStack.length-1-Math.abs(I||0),I>=0?this.conditionStack[I]:"INITIAL"},"topState"),pushState:x(function(I){this.begin(I)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(I,$,O,N){switch(O){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return D})();M.lexer=L;function P(){this.yy={}}return x(P,"Parser"),P.prototype=M,M.Parser=P,new P})();EB.parser=EB;var jAt=EB;Ta.extend($At);Ta.extend(zAt);Ta.extend(HAt);var die={friday:5,saturday:6},Gc="",fU="",pU=void 0,gU="",ax=[],sx=[],mU=new Map,yU=[],v6=[],ox="",vU="",FAe=["active","done","crit","milestone","vert"],bU=[],ay="",YS=!1,xU=!1,TU="sunday",b6="saturday",AB=0,KAt=x(function(){yU=[],v6=[],ox="",bU=[],j3=0,RB=void 0,K3=void 0,ea=[],Gc="",fU="",vU="",pU=void 0,gU="",ax=[],sx=[],YS=!1,xU=!1,AB=0,mU=new Map,ay="",$n(),TU="sunday",b6="saturday"},"clear"),ZAt=x(function(t){ay=t},"setDiagramId"),QAt=x(function(t){fU=t},"setAxisFormat"),JAt=x(function(){return fU},"getAxisFormat"),e_t=x(function(t){pU=t},"setTickInterval"),t_t=x(function(){return pU},"getTickInterval"),r_t=x(function(t){gU=t},"setTodayMarker"),n_t=x(function(){return gU},"getTodayMarker"),i_t=x(function(t){Gc=t},"setDateFormat"),a_t=x(function(){YS=!0},"enableInclusiveEndDates"),s_t=x(function(){return YS},"endDatesAreInclusive"),o_t=x(function(){xU=!0},"enableTopAxis"),l_t=x(function(){return xU},"topAxisEnabled"),c_t=x(function(t){vU=t},"setDisplayMode"),u_t=x(function(){return vU},"getDisplayMode"),h_t=x(function(){return Gc},"getDateFormat"),zAe=x((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),d_t=x(function(t){ax=zAe(ax,t)},"setIncludes"),f_t=x(function(){return ax},"getIncludes"),p_t=x(function(t){sx=zAe(sx,t)},"setExcludes"),g_t=x(function(){return sx},"getExcludes"),m_t=x(function(){return mU},"getLinks"),y_t=x(function(t){ox=t,yU.push(t)},"addSection"),v_t=x(function(){return yU},"getSections"),b_t=x(function(){let t=fie();const e=10;let r=0;for(;!t&&ro))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,s]},"fixTaskDates"),_B=x(function(t,e,r){if(r=r.trim(),x(o=>{const l=o.trim();return l==="x"||l==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(r))return new Date(Number(r));const a=/^after\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let o=null;for(const u of a.groups.ids.split(" ")){let h=Fg(u);h!==void 0&&(!o||h.endTime>o.endTime)&&(o=h)}if(o)return o.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let s=Ta(r,e.trim(),!0);if(s.isValid())return s.toDate();{le.debug("Invalid date:"+r),le.debug("With date format:"+e.trim());const o=new Date(r);if(o===void 0||isNaN(o.getTime())||o.getFullYear()<-1e4||o.getFullYear()>1e4)throw new Error("Invalid date:"+r);return o}},"getStartDate"),WAe=x(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),HAe=x(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let h=null;for(const f of a.groups.ids.split(" ")){let p=Fg(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),mU.set(n,r))}),UAe(t,"clickable")},"setLink"),UAe=x(function(t,e){t.split(",").forEach(function(r){let n=Fg(r);n!==void 0&&n.classes.push(e)})},"setClass"),R_t=x(function(t,e,r){if(Fe().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{yr.runFunc(e,...n)})},"setClickFun"),YAe=x(function(t,e){bU.push(function(){const r=ay?`${ay}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=ay?`${ay}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),L_t=x(function(t,e,r){t.split(",").forEach(function(n){R_t(n,e,r)}),UAe(t,"clickable")},"setClickEvent"),M_t=x(function(t){bU.forEach(function(e){e(t)})},"bindFunctions"),I_t={getConfig:x(()=>Fe().gantt,"getConfig"),clear:KAt,setDateFormat:i_t,getDateFormat:h_t,enableInclusiveEndDates:a_t,endDatesAreInclusive:s_t,enableTopAxis:o_t,topAxisEnabled:l_t,setAxisFormat:QAt,getAxisFormat:JAt,setTickInterval:e_t,getTickInterval:t_t,setTodayMarker:r_t,getTodayMarker:n_t,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,setDiagramId:ZAt,setDisplayMode:c_t,getDisplayMode:u_t,setAccDescription:ii,getAccDescription:ai,addSection:y_t,getSections:v_t,getTasks:b_t,addTask:E_t,findTaskById:Fg,addTaskOrg:A_t,setIncludes:d_t,getIncludes:f_t,setExcludes:p_t,getExcludes:g_t,setClickEvent:L_t,setLink:__t,getLinks:m_t,bindFunctions:M_t,parseDuration:WAe,isInvalidDate:VAe,setWeekday:x_t,getWeekday:T_t,setWeekend:w_t};function wU(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",s=new RegExp(a);t[0].match(s)&&(e[i]=!0,t.shift(1),n=!0)})}x(wU,"getTaskTags");Ta.extend(XAt);var N_t=x(function(){le.debug("Something is calling, setConf, remove the call")},"setConf"),pie={monday:LC,tuesday:Hce,wednesday:qce,thursday:M0,friday:Uce,saturday:Yce,sunday:Kk},D_t=x((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,s)=>a.startTime-s.startTime||a.order-s.order),i=0;for(const a of n)for(let s=0;s=r[s]){r[s]=a.endTime,a.order=s+e,s>i&&(i=s);break}return i},"getMaxIntersections"),Nu,FN=1e4,O_t=x(function(t,e,r,n){const i=Fe().gantt;n.db.setDiagramId(e);const a=Fe().securityLevel;let s;a==="sandbox"&&(s=ut("#i"+e));const o=ut(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);Nu=u.parentElement.offsetWidth,Nu===void 0&&(Nu=1200),i.useWidth!==void 0&&(Nu=i.useWidth);const h=n.db.getTasks(),d=h.filter(M=>!M.vert);let f=[];for(const M of d)f.push(M.type);f=_(f);const p={};let g=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const M={};for(const P of d)M[P.section]===void 0?M[P.section]=[P]:M[P.section].push(P);let L=0;for(const P of Object.keys(M)){const D=D_t(M[P],L)+1;L+=D,g+=D*(i.barHeight+i.barGap),p[P]=D}}else{g+=d.length*(i.barHeight+i.barGap);for(const M of f)p[M]=d.filter(L=>L.type===M).length}u.setAttribute("viewBox","0 0 "+Nu+" "+g);const m=o.select(`[id="${e}"]`),y=Zqe().domain([ize(h,function(M){return M.startTime}),nze(h,function(M){return M.endTime})]).rangeRound([0,Nu-i.leftPadding-i.rightPadding]);function v(M,L){const P=M.startTime,D=L.startTime;let R=0;return P>D?R=1:PG.vert===H.vert?0:G.vert?1:-1);const O=M.filter(G=>!G.vert),F=[...new Set(O.map(G=>G.order))].map(G=>O.find(H=>H.order===G));m.append("g").selectAll("rect").data(F).enter().append("rect").attr("x",0).attr("y",function(G,H){return H=G.order,H*L+P-2}).attr("width",function(){return $-i.rightPadding/2}).attr("height",L).attr("class",function(G){for(const[H,q]of f.entries())if(G.type===q)return"section section"+H%i.numberSectionStyles;return"section section0"}).enter();const z=m.append("g").selectAll("rect").data(M).enter(),V=n.db.getLinks();if(z.append("rect").attr("id",function(G){return e+"-"+G.id}).attr("rx",3).attr("ry",3).attr("x",function(G){return G.milestone?y(G.startTime)+D+.5*(y(G.endTime)-y(G.startTime))-.5*R:y(G.startTime)+D}).attr("y",function(G,H){return H=G.order,G.vert?i.gridLineStartPadding:H*L+P}).attr("width",function(G){return G.milestone?R:G.vert?.08*R:y(G.renderEndTime||G.endTime)-y(G.startTime)}).attr("height",function(G){return G.vert?O.length*(i.barHeight+i.barGap)+i.barHeight*2:R}).attr("transform-origin",function(G,H){return H=G.order,(y(G.startTime)+D+.5*(y(G.endTime)-y(G.startTime))).toString()+"px "+(H*L+P+.5*R).toString()+"px"}).attr("class",function(G){const H="task";let q="";G.classes.length>0&&(q=G.classes.join(" "));let Z=0;for(const[ie,K]of f.entries())G.type===K&&(Z=ie%i.numberSectionStyles);let Y="";return G.active?G.crit?Y+=" activeCrit":Y=" active":G.done?G.crit?Y=" doneCrit":Y=" done":G.crit&&(Y+=" crit"),Y.length===0&&(Y=" task"),G.milestone&&(Y=" milestone "+Y),G.vert&&(Y=" vert "+Y),Y+=Z,Y+=" "+q,H+Y}),z.append("text").attr("id",function(G){return e+"-"+G.id+"-text"}).text(function(G){return G.task}).attr("font-size",i.fontSize).attr("x",function(G){let H=y(G.startTime),q=y(G.renderEndTime||G.endTime);if(G.milestone&&(H+=.5*(y(G.endTime)-y(G.startTime))-.5*R,q=H+R),G.vert)return y(G.startTime)+D;const Z=this.getBBox().width;return Z>q-H?q+Z+1.5*i.leftPadding>$?H+D-5:q+D+5:(q-H)/2+H+D}).attr("y",function(G,H){return G.vert?i.gridLineStartPadding+O.length*(i.barHeight+i.barGap)+60:(H=G.order,H*L+i.barHeight/2+(i.fontSize/2-2)+P)}).attr("text-height",R).attr("class",function(G){const H=y(G.startTime);let q=y(G.endTime);G.milestone&&(q=H+R);const Z=this.getBBox().width;let Y="";G.classes.length>0&&(Y=G.classes.join(" "));let ie=0;for(const[Q,te]of f.entries())G.type===te&&(ie=Q%i.numberSectionStyles);let K="";return G.active&&(G.crit?K="activeCritText"+ie:K="activeText"+ie),G.done?G.crit?K=K+" doneCritText"+ie:K=K+" doneText"+ie:G.crit&&(K=K+" critText"+ie),G.milestone&&(K+=" milestoneText"),G.vert&&(K+=" vertText"),Z>q-H?q+Z+1.5*i.leftPadding>$?Y+" taskTextOutsideLeft taskTextOutside"+ie+" "+K:Y+" taskTextOutsideRight taskTextOutside"+ie+" "+K+" width-"+Z:Y+" taskText taskText"+ie+" "+K+" width-"+Z}),Fe().securityLevel==="sandbox"){let G;G=ut("#i"+e);const H=G.nodes()[0].contentDocument;z.filter(function(q){return V.has(q.id)}).each(function(q){var Z=H.querySelector("#"+CSS.escape(e+"-"+q.id)),Y=H.querySelector("#"+CSS.escape(e+"-"+q.id+"-text"));const ie=Z.parentNode;var K=H.createElement("a");K.setAttribute("xlink:href",V.get(q.id)),K.setAttribute("target","_top"),ie.appendChild(K),K.appendChild(Z),K.appendChild(Y)})}}x(b,"drawRects");function w(M,L,P,D,R,I,$,O){if($.length===0&&O.length===0)return;let N,F;for(const{startTime:q,endTime:Z}of I)(N===void 0||qF)&&(F=Z);if(!N||!F)return;if(Ta(F).diff(Ta(N),"year")>5){le.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const z=n.db.getDateFormat(),V=[];let B=null,G=Ta(N);for(;G.valueOf()<=F;)n.db.isInvalidDate(G,z,$,O)?B?B.end=G:B={start:G,end:G}:B&&(V.push(B),B=null),G=G.add(1,"d");m.append("g").selectAll("rect").data(V).enter().append("rect").attr("id",q=>e+"-exclude-"+q.start.format("YYYY-MM-DD")).attr("x",q=>y(q.start.startOf("day"))+P).attr("y",i.gridLineStartPadding).attr("width",q=>y(q.end.endOf("day"))-y(q.start.startOf("day"))).attr("height",R-L-i.gridLineStartPadding).attr("transform-origin",function(q,Z){return(y(q.start)+P+.5*(y(q.end)-y(q.start))).toString()+"px "+(Z*M+.5*R).toString()+"px"}).attr("class","exclude-range")}x(w,"drawExcludeDays");function C(M,L,P,D){if(P<=0||M>L)return 1/0;const R=L-M,I=Ta.duration({[D??"day"]:P}).asMilliseconds();return I<=0?1/0:Math.ceil(R/I)}x(C,"getEstimatedTickCount");function S(M,L,P,D){const R=n.db.getDateFormat(),I=n.db.getAxisFormat();let $;I?$=I:R==="D"?$="%d":$=i.axisFormat??"%Y-%m-%d";let O=fze(y).tickSize(-D+L+i.gridLineStartPadding).tickFormat(vA($));const F=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(F!==null){const z=parseInt(F[1],10);if(isNaN(z)||z<=0)le.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const V=F[2],B=n.db.getWeekday()||i.weekday,G=y.domain(),H=G[0],q=G[1],Z=C(H,q,z,V);if(Z>FN)le.warn(`The tick interval "${z}${V}" would generate ${Z} ticks, which exceeds the maximum allowed (${FN}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(V){case"millisecond":O.ticks(Eb.every(z));break;case"second":O.ticks(_d.every(z));break;case"minute":O.ticks(_C.every(z));break;case"hour":O.ticks(RC.every(z));break;case"day":O.ticks(L0.every(z));break;case"week":O.ticks(pie[B].every(z));break;case"month":O.ticks(MC.every(z));break}}}if(m.append("g").attr("class","grid").attr("transform","translate("+M+", "+(D-50)+")").call(O).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let z=dze(y).tickSize(-D+L+i.gridLineStartPadding).tickFormat(vA($));if(F!==null){const V=parseInt(F[1],10);if(isNaN(V)||V<=0)le.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const B=F[2],G=n.db.getWeekday()||i.weekday,H=y.domain(),q=H[0],Z=H[1];if(C(q,Z,V,B)<=FN)switch(B){case"millisecond":z.ticks(Eb.every(V));break;case"second":z.ticks(_d.every(V));break;case"minute":z.ticks(_C.every(V));break;case"hour":z.ticks(RC.every(V));break;case"day":z.ticks(L0.every(V));break;case"week":z.ticks(pie[G].every(V));break;case"month":z.ticks(MC.every(V));break}}}m.append("g").attr("class","grid").attr("transform","translate("+M+", "+L+")").call(z).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}x(S,"makeGrid");function k(M,L){let P=0;const D=Object.keys(p).map(R=>[R,p[R]]);m.append("g").selectAll("text").data(D).enter().append(function(R){const I=R[0].split(At.lineBreakRegex),$=-(I.length-1)/2,O=l.createElementNS("http://www.w3.org/2000/svg","text");O.setAttribute("dy",$+"em");for(const[N,F]of I.entries()){const z=l.createElementNS("http://www.w3.org/2000/svg","tspan");z.setAttribute("alignment-baseline","central"),z.setAttribute("x","10"),N>0&&z.setAttribute("dy","1em"),z.textContent=F,O.appendChild(z)}return O}).attr("x",10).attr("y",function(R,I){if(I>0)for(let $=0;$` .mermaid-main-font { font-family: ${t.fontFamily}; } @@ -1966,8 +1968,8 @@ Expecting `+Pe.join(", ")+", got '"+(this.terminals_[ee]||ee)+"'":ve="Parse erro fill: ${t.titleColor||t.textColor}; font-family: ${t.fontFamily}; } -`,"getStyles"),O_t=D_t,$_t={parser:UAt,db:R_t,renderer:N_t,styles:O_t};const P_t=Object.freeze(Object.defineProperty({__proto__:null,diagram:$_t},Symbol.toStringTag,{value:"Module"}));var B_t={parse:x(async t=>{const e=await Al("info",t);le.debug(e)},"parse")},F_t={version:"11.16.1"},z_t=x(()=>F_t.version,"getVersion"),V_t={getVersion:z_t},G_t=x((t,e,r)=>{le.debug(`rendering info diagram -`+t);const n=xs(e);Ai(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),W_t={draw:G_t},H_t={parser:B_t,db:V_t,renderer:W_t};const q_t=Object.freeze(Object.defineProperty({__proto__:null,diagram:H_t},Symbol.toStringTag,{value:"Module"}));var U_t=Vr.pie,CU={sections:new Map,showData:!1},x6=CU.sections,kU=CU.showData,Y_t=structuredClone(U_t),X_t=x(()=>structuredClone(Y_t),"getConfig"),j_t=x(()=>{x6=new Map,kU=CU.showData,On()},"clear"),K_t=x(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);x6.has(t)||(x6.set(t,e),le.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),Z_t=x(()=>x6,"getSections"),Q_t=x(t=>{kU=t},"setShowData"),J_t=x(()=>kU,"getShowData"),YAe={getConfig:X_t,clear:j_t,setDiagramTitle:ti,getDiagramTitle:Yn,setAccTitle:Hn,getAccTitle:ni,setAccDescription:ii,getAccDescription:ai,addSection:K_t,getSections:Z_t,setShowData:Q_t,getShowData:J_t},e6t=x((t,e)=>{eo(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),t6t={parse:x(async t=>{const e=await Al("pie",t);le.debug(e),e6t(e,YAe)},"parse")},r6t=x(t=>` +`,"getStyles"),B_t=P_t,F_t={parser:jAt,db:I_t,renderer:$_t,styles:B_t};const z_t=Object.freeze(Object.defineProperty({__proto__:null,diagram:F_t},Symbol.toStringTag,{value:"Module"}));var V_t={parse:x(async t=>{const e=await Al("info",t);le.debug(e)},"parse")},G_t={version:"11.16.1"},W_t=x(()=>G_t.version,"getVersion"),H_t={getVersion:W_t},q_t=x((t,e,r)=>{le.debug(`rendering info diagram +`+t);const n=xs(e);Ai(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),U_t={draw:q_t},Y_t={parser:V_t,db:H_t,renderer:U_t};const X_t=Object.freeze(Object.defineProperty({__proto__:null,diagram:Y_t},Symbol.toStringTag,{value:"Module"}));var j_t=Vr.pie,CU={sections:new Map,showData:!1},x6=CU.sections,kU=CU.showData,K_t=structuredClone(j_t),Z_t=x(()=>structuredClone(K_t),"getConfig"),Q_t=x(()=>{x6=new Map,kU=CU.showData,$n()},"clear"),J_t=x(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);x6.has(t)||(x6.set(t,e),le.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),e6t=x(()=>x6,"getSections"),t6t=x(t=>{kU=t},"setShowData"),r6t=x(()=>kU,"getShowData"),XAe={getConfig:Z_t,clear:Q_t,setDiagramTitle:ti,getDiagramTitle:Yn,setAccTitle:Hn,getAccTitle:ni,setAccDescription:ii,getAccDescription:ai,addSection:J_t,getSections:e6t,setShowData:t6t,getShowData:r6t},n6t=x((t,e)=>{eo(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),i6t={parse:x(async t=>{const e=await Al("pie",t);le.debug(e),n6t(e,XAe)},"parse")},a6t=x(t=>` .pieCircle{ stroke: ${t.pieStrokeColor}; stroke-width : ${t.pieStrokeWidth}; @@ -2004,25 +2006,25 @@ Expecting `+Pe.join(", ")+", got '"+(this.terminals_[ee]||ee)+"'":ve="Parse erro font-family: ${t.fontFamily}; font-size: ${t.pieLegendTextSize}; } -`,"getStyles"),n6t=r6t,i6t=x(t=>{const e=[...t.values()].reduce((i,a)=>i+a,0),r=[...t.entries()].map(([i,a])=>({label:i,value:a})).filter(i=>i.value/e*100>=1);return hUe().value(i=>i.value).sort(null)(r)},"createPieArcs"),a6t=x((t,e,r,n)=>{var Y;le.debug(`rendering pie chart -`+t);const i=n.db,a=Fe(),s=ri(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=xs(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=Oh(g.pieOuterStrokeWidth);m??(m=2);const y=s.legendPosition,v=s.textPosition,T=s.donutHole>0&&s.donutHole<=.9?s.donutHole:0,b=Math.min(d,h)/2-o,w=_b().innerRadius(T*b).outerRadius(b),C=_b().innerRadius(b*v).outerRadius(b*v),S=p.append("g");S.append("circle").attr("cx",0).attr("cy",0).attr("r",b+m/2).attr("class","pieOuterCircle");const k=i.getSections(),E=i6t(k),_=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let M=0;k.forEach(ie=>{M+=ie});const L=E.filter(ie=>(ie.data.value/M*100).toFixed(0)!=="0"),P=h0(_).domain([...k.keys()]);S.selectAll("mySlices").data(L).enter().append("path").attr("d",w).attr("fill",ie=>P(ie.data.label)).attr("class",ie=>{let K="pieCircle";return s.highlightSlice==="hover"?K+=" highlightedOnHover":s.highlightSlice===ie.data.label&&(K+=" highlighted"),K}),S.selectAll("mySlices").data(L).enter().append("text").text(ie=>(ie.data.value/M*100).toFixed(0)+"%").attr("transform",ie=>"translate("+C.centroid(ie)+")").style("text-anchor","middle").attr("class","slice");const D=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),R=[...k.entries()].map(([ie,K])=>({label:ie,value:K})),I=p.selectAll(".legend").data(R).enter().append("g").attr("class","legend");I.append("rect").attr("width",l).attr("height",l).style("fill",ie=>P(ie.label)).style("stroke",ie=>P(ie.label)),I.append("text").attr("x",l+u).attr("y",l-u).text(ie=>i.getShowData()?`${ie.label} [${ie.value}]`:ie.label);const $=Math.max(...I.selectAll("text").nodes().map(ie=>(ie==null?void 0:ie.getBoundingClientRect().width)??0));let O=h,N=d+o;const F=l+u,z=R.length*F;switch(y){case"center":I.attr("transform",(ie,K)=>{const Q=F*R.length/2,te=-$/2-(l+u),J=K*F-Q;return"translate("+te+","+J+")"});break;case"top":O+=z,I.attr("transform",(ie,K)=>{const Q=b,te=-$/2-(l+u),J=K*F-Q;return`translate(${te}, ${J})`}),S.attr("transform",()=>`translate(0, ${z+F})`);break;case"bottom":O+=z,I.attr("transform",(ie,K)=>{const Q=-b-F,te=-$/2-(l+u),J=K*F-Q;return"translate("+te+","+J+")"});break;case"left":N+=l+u+$,I.attr("transform",(ie,K)=>{const Q=F*R.length/2,te=-b-(l+u),J=K*F-Q;return"translate("+te+","+J+")"}),S.attr("transform",()=>`translate(${$+l+u}, 0)`);break;case"right":default:N+=l+u+$,I.attr("transform",(ie,K)=>{const Q=F*R.length/2,te=12*l,J=K*F-Q;return"translate("+te+","+J+")"});break}const V=((Y=D.node())==null?void 0:Y.getBoundingClientRect().width)??0,B=d/2-V/2,G=d/2+V/2,H=Math.min(0,B),Z=Math.max(N,G)-H;f.attr("viewBox",`${H} 0 ${Z} ${O}`),Ai(f,O,Z,s.useMaxWidth)},"draw"),s6t={draw:a6t},o6t={parser:t6t,db:YAe,renderer:s6t,styles:n6t};const l6t=Object.freeze(Object.defineProperty({__proto__:null,diagram:o6t},Symbol.toStringTag,{value:"Module"}));var LB=(function(){var t=x(function(j,ue,X,Oe){for(X=X||{},Oe=j.length;Oe--;X[j[Oe]]=ue);return X},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],h=[1,37],d=[1,36],f=[1,38],p=[1,35],g=[1,43],m=[1,41],y=[1,45],v=[1,14],T=[1,23],b=[1,18],w=[1,19],C=[1,20],S=[1,21],k=[1,22],E=[1,24],_=[1,25],M=[1,26],L=[1,27],P=[1,28],D=[1,29],R=[1,32],I=[1,33],$=[1,34],O=[1,39],N=[1,40],F=[1,42],z=[1,44],V=[1,63],B=[1,62],G=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],H=[1,66],q=[1,67],Z=[1,68],Y=[1,69],ie=[1,70],K=[1,71],Q=[1,72],te=[1,73],J=[1,74],ge=[1,75],ee=[1,76],Re=[1,77],Ie=[4,5,6,7,8,9,10,11,12,13,14,15,18],Be=[1,91],ce=[1,92],oe=[1,93],be=[1,100],fe=[1,94],Pe=[1,97],ve=[1,95],Ce=[1,96],Ve=[1,98],se=[1,99],de=[1,103],Te=[10,55,56,57],ae=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],he={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:x(function(ue,X,Oe,xe,Ge,_e,$e){var Me=_e.length-1;switch(Ge){case 23:this.$=_e[Me];break;case 24:this.$=_e[Me-1]+""+_e[Me];break;case 26:this.$=_e[Me-1]+_e[Me];break;case 27:this.$=[_e[Me].trim()];break;case 28:_e[Me-2].push(_e[Me].trim()),this.$=_e[Me-2];break;case 29:this.$=_e[Me-4],xe.addClass(_e[Me-2],_e[Me]);break;case 37:this.$=[];break;case 42:this.$=_e[Me].trim(),xe.setDiagramTitle(this.$);break;case 43:this.$=_e[Me].trim(),xe.setAccTitle(this.$);break;case 44:case 45:this.$=_e[Me].trim(),xe.setAccDescription(this.$);break;case 46:xe.addSection(_e[Me].substr(8)),this.$=_e[Me].substr(8);break;case 47:xe.addPoint(_e[Me-3],"",_e[Me-1],_e[Me],[]);break;case 48:xe.addPoint(_e[Me-4],_e[Me-3],_e[Me-1],_e[Me],[]);break;case 49:xe.addPoint(_e[Me-4],"",_e[Me-2],_e[Me-1],_e[Me]);break;case 50:xe.addPoint(_e[Me-5],_e[Me-4],_e[Me-2],_e[Me-1],_e[Me]);break;case 51:xe.setXAxisLeftText(_e[Me-2]),xe.setXAxisRightText(_e[Me]);break;case 52:_e[Me-1].text+=" ⟶ ",xe.setXAxisLeftText(_e[Me-1]);break;case 53:xe.setXAxisLeftText(_e[Me]);break;case 54:xe.setYAxisBottomText(_e[Me-2]),xe.setYAxisTopText(_e[Me]);break;case 55:_e[Me-1].text+=" ⟶ ",xe.setYAxisBottomText(_e[Me-1]);break;case 56:xe.setYAxisBottomText(_e[Me]);break;case 57:xe.setQuadrant1Text(_e[Me]);break;case 58:xe.setQuadrant2Text(_e[Me]);break;case 59:xe.setQuadrant3Text(_e[Me]);break;case 60:xe.setQuadrant4Text(_e[Me]);break;case 64:this.$={text:_e[Me],type:"text"};break;case 65:this.$={text:_e[Me-1].text+""+_e[Me],type:_e[Me-1].type};break;case 66:this.$={text:_e[Me],type:"text"};break;case 67:this.$={text:_e[Me],type:"markdown"};break;case 68:this.$=_e[Me];break;case 69:this.$=_e[Me-1]+""+_e[Me];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:T,35:b,37:w,39:C,41:S,42:k,48:E,50:_,51:M,52:L,53:P,54:D,60:R,61:I,63:$,64:O,65:N,66:F,67:z}),t(s,[2,34]),{27:46,55:n,56:i,57:a},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:T,35:b,37:w,39:C,41:S,42:k,48:E,50:_,51:M,52:L,53:P,54:D,60:R,61:I,63:$,64:O,65:N,66:F,67:z}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:52,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:53,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:54,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:55,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:56,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:57,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,44:[1,58],47:[1,59],58:61,59:60,63:$,64:O,65:N,66:F,67:z},t(G,[2,64]),t(G,[2,66]),t(G,[2,67]),t(G,[2,70]),t(G,[2,71]),t(G,[2,72]),t(G,[2,73]),t(G,[2,74]),t(G,[2,75]),t(G,[2,76]),t(G,[2,77]),t(G,[2,78]),t(G,[2,79]),t(G,[2,80]),t(G,[2,81]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:H,5:q,6:Z,7:Y,8:ie,9:K,10:Q,11:te,12:J,13:ge,14:ee,15:Re,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,49:[1,78],63:$,64:O,65:N,66:F,67:z}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,49:[1,79],63:$,64:O,65:N,66:F,67:z}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),{45:[1,80]},{44:[1,81]},t(G,[2,65]),t(G,[2,82]),t(G,[2,83]),t(G,[2,84]),{3:83,4:H,5:q,6:Z,7:Y,8:ie,9:K,10:Q,11:te,12:J,13:ge,14:ee,15:Re,18:[1,82]},t(Ie,[2,23]),t(Ie,[2,1]),t(Ie,[2,2]),t(Ie,[2,3]),t(Ie,[2,4]),t(Ie,[2,5]),t(Ie,[2,6]),t(Ie,[2,7]),t(Ie,[2,8]),t(Ie,[2,9]),t(Ie,[2,10]),t(Ie,[2,11]),t(Ie,[2,12]),t(l,[2,52],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:R,61:I,63:$,64:O,65:N,66:F,67:z}),t(l,[2,55],{58:31,43:85,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:R,61:I,63:$,64:O,65:N,66:F,67:z}),{46:[1,86]},{45:[1,87]},{4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,16:90,17:ve,18:Ce,19:Ve,20:se,22:89,23:88},t(Ie,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),t(l,[2,47],{22:89,16:90,23:101,4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,17:ve,18:Ce,19:Ve,20:se}),{46:[1,102]},t(l,[2,29],{10:de}),t(Te,[2,27],{16:104,4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,17:ve,18:Ce,19:Ve,20:se}),t(ae,[2,25]),t(ae,[2,13]),t(ae,[2,14]),t(ae,[2,15]),t(ae,[2,16]),t(ae,[2,17]),t(ae,[2,18]),t(ae,[2,19]),t(ae,[2,20]),t(ae,[2,21]),t(ae,[2,22]),t(l,[2,49],{10:de}),t(l,[2,48],{22:89,16:90,23:105,4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,17:ve,18:Ce,19:Ve,20:se}),{4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,16:90,17:ve,18:Ce,19:Ve,20:se,22:106},t(ae,[2,26]),t(l,[2,50],{10:de}),t(Te,[2,28],{16:104,4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,17:ve,18:Ce,19:Ve,20:se})],defaultActions:{8:[2,30],9:[2,31]},parseError:x(function(ue,X){if(X.recoverable)this.trace(ue);else{var Oe=new Error(ue);throw Oe.hash=X,Oe}},"parseError"),parse:x(function(ue){var X=this,Oe=[0],xe=[],Ge=[null],_e=[],$e=this.table,Me="",He=0,De=0,Ke=2,Ae=1,at=_e.slice.call(arguments,1),Ee=Object.create(this.lexer),pt={yy:{}};for(var ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ht)&&(pt.yy[ht]=this.yy[ht]);Ee.setInput(ue,pt.yy),pt.yy.lexer=Ee,pt.yy.parser=this,typeof Ee.yylloc>"u"&&(Ee.yylloc={});var rt=Ee.yylloc;_e.push(rt);var Et=Ee.options&&Ee.options.ranges;typeof pt.yy.parseError=="function"?this.parseError=pt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function vt(Nt){Oe.length=Oe.length-2*Nt,Ge.length=Ge.length-Nt,_e.length=_e.length-Nt}x(vt,"popStack");function ot(){var Nt;return Nt=xe.pop()||Ee.lex()||Ae,typeof Nt!="number"&&(Nt instanceof Array&&(xe=Nt,Nt=xe.pop()),Nt=X.symbols_[Nt]||Nt),Nt}x(ot,"lex");for(var pe,Ct,lt,st,mt={},_r,Se,Ue,tt;;){if(Ct=Oe[Oe.length-1],this.defaultActions[Ct]?lt=this.defaultActions[Ct]:((pe===null||typeof pe>"u")&&(pe=ot()),lt=$e[Ct]&&$e[Ct][pe]),typeof lt>"u"||!lt.length||!lt[0]){var kt="";tt=[];for(_r in $e[Ct])this.terminals_[_r]&&_r>Ke&&tt.push("'"+this.terminals_[_r]+"'");Ee.showPosition?kt="Parse error on line "+(He+1)+`: +`,"getStyles"),s6t=a6t,o6t=x(t=>{const e=[...t.values()].reduce((i,a)=>i+a,0),r=[...t.entries()].map(([i,a])=>({label:i,value:a})).filter(i=>i.value/e*100>=1);return dUe().value(i=>i.value).sort(null)(r)},"createPieArcs"),l6t=x((t,e,r,n)=>{var Y;le.debug(`rendering pie chart +`+t);const i=n.db,a=Fe(),s=ri(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=xs(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=Oh(g.pieOuterStrokeWidth);m??(m=2);const y=s.legendPosition,v=s.textPosition,T=s.donutHole>0&&s.donutHole<=.9?s.donutHole:0,b=Math.min(d,h)/2-o,w=_b().innerRadius(T*b).outerRadius(b),C=_b().innerRadius(b*v).outerRadius(b*v),S=p.append("g");S.append("circle").attr("cx",0).attr("cy",0).attr("r",b+m/2).attr("class","pieOuterCircle");const k=i.getSections(),E=o6t(k),_=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let M=0;k.forEach(ie=>{M+=ie});const L=E.filter(ie=>(ie.data.value/M*100).toFixed(0)!=="0"),P=h0(_).domain([...k.keys()]);S.selectAll("mySlices").data(L).enter().append("path").attr("d",w).attr("fill",ie=>P(ie.data.label)).attr("class",ie=>{let K="pieCircle";return s.highlightSlice==="hover"?K+=" highlightedOnHover":s.highlightSlice===ie.data.label&&(K+=" highlighted"),K}),S.selectAll("mySlices").data(L).enter().append("text").text(ie=>(ie.data.value/M*100).toFixed(0)+"%").attr("transform",ie=>"translate("+C.centroid(ie)+")").style("text-anchor","middle").attr("class","slice");const D=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),R=[...k.entries()].map(([ie,K])=>({label:ie,value:K})),I=p.selectAll(".legend").data(R).enter().append("g").attr("class","legend");I.append("rect").attr("width",l).attr("height",l).style("fill",ie=>P(ie.label)).style("stroke",ie=>P(ie.label)),I.append("text").attr("x",l+u).attr("y",l-u).text(ie=>i.getShowData()?`${ie.label} [${ie.value}]`:ie.label);const $=Math.max(...I.selectAll("text").nodes().map(ie=>(ie==null?void 0:ie.getBoundingClientRect().width)??0));let O=h,N=d+o;const F=l+u,z=R.length*F;switch(y){case"center":I.attr("transform",(ie,K)=>{const Q=F*R.length/2,te=-$/2-(l+u),J=K*F-Q;return"translate("+te+","+J+")"});break;case"top":O+=z,I.attr("transform",(ie,K)=>{const Q=b,te=-$/2-(l+u),J=K*F-Q;return`translate(${te}, ${J})`}),S.attr("transform",()=>`translate(0, ${z+F})`);break;case"bottom":O+=z,I.attr("transform",(ie,K)=>{const Q=-b-F,te=-$/2-(l+u),J=K*F-Q;return"translate("+te+","+J+")"});break;case"left":N+=l+u+$,I.attr("transform",(ie,K)=>{const Q=F*R.length/2,te=-b-(l+u),J=K*F-Q;return"translate("+te+","+J+")"}),S.attr("transform",()=>`translate(${$+l+u}, 0)`);break;case"right":default:N+=l+u+$,I.attr("transform",(ie,K)=>{const Q=F*R.length/2,te=12*l,J=K*F-Q;return"translate("+te+","+J+")"});break}const V=((Y=D.node())==null?void 0:Y.getBoundingClientRect().width)??0,B=d/2-V/2,G=d/2+V/2,H=Math.min(0,B),Z=Math.max(N,G)-H;f.attr("viewBox",`${H} 0 ${Z} ${O}`),Ai(f,O,Z,s.useMaxWidth)},"draw"),c6t={draw:l6t},u6t={parser:i6t,db:XAe,renderer:c6t,styles:s6t};const h6t=Object.freeze(Object.defineProperty({__proto__:null,diagram:u6t},Symbol.toStringTag,{value:"Module"}));var LB=(function(){var t=x(function(j,ue,X,Oe){for(X=X||{},Oe=j.length;Oe--;X[j[Oe]]=ue);return X},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],h=[1,37],d=[1,36],f=[1,38],p=[1,35],g=[1,43],m=[1,41],y=[1,45],v=[1,14],T=[1,23],b=[1,18],w=[1,19],C=[1,20],S=[1,21],k=[1,22],E=[1,24],_=[1,25],M=[1,26],L=[1,27],P=[1,28],D=[1,29],R=[1,32],I=[1,33],$=[1,34],O=[1,39],N=[1,40],F=[1,42],z=[1,44],V=[1,63],B=[1,62],G=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],H=[1,66],q=[1,67],Z=[1,68],Y=[1,69],ie=[1,70],K=[1,71],Q=[1,72],te=[1,73],J=[1,74],ge=[1,75],ee=[1,76],Re=[1,77],Ie=[4,5,6,7,8,9,10,11,12,13,14,15,18],Be=[1,91],ce=[1,92],oe=[1,93],be=[1,100],fe=[1,94],Pe=[1,97],ve=[1,95],Ce=[1,96],Ve=[1,98],se=[1,99],de=[1,103],Te=[10,55,56,57],ae=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],he={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:x(function(ue,X,Oe,xe,Ge,_e,$e){var Me=_e.length-1;switch(Ge){case 23:this.$=_e[Me];break;case 24:this.$=_e[Me-1]+""+_e[Me];break;case 26:this.$=_e[Me-1]+_e[Me];break;case 27:this.$=[_e[Me].trim()];break;case 28:_e[Me-2].push(_e[Me].trim()),this.$=_e[Me-2];break;case 29:this.$=_e[Me-4],xe.addClass(_e[Me-2],_e[Me]);break;case 37:this.$=[];break;case 42:this.$=_e[Me].trim(),xe.setDiagramTitle(this.$);break;case 43:this.$=_e[Me].trim(),xe.setAccTitle(this.$);break;case 44:case 45:this.$=_e[Me].trim(),xe.setAccDescription(this.$);break;case 46:xe.addSection(_e[Me].substr(8)),this.$=_e[Me].substr(8);break;case 47:xe.addPoint(_e[Me-3],"",_e[Me-1],_e[Me],[]);break;case 48:xe.addPoint(_e[Me-4],_e[Me-3],_e[Me-1],_e[Me],[]);break;case 49:xe.addPoint(_e[Me-4],"",_e[Me-2],_e[Me-1],_e[Me]);break;case 50:xe.addPoint(_e[Me-5],_e[Me-4],_e[Me-2],_e[Me-1],_e[Me]);break;case 51:xe.setXAxisLeftText(_e[Me-2]),xe.setXAxisRightText(_e[Me]);break;case 52:_e[Me-1].text+=" ⟶ ",xe.setXAxisLeftText(_e[Me-1]);break;case 53:xe.setXAxisLeftText(_e[Me]);break;case 54:xe.setYAxisBottomText(_e[Me-2]),xe.setYAxisTopText(_e[Me]);break;case 55:_e[Me-1].text+=" ⟶ ",xe.setYAxisBottomText(_e[Me-1]);break;case 56:xe.setYAxisBottomText(_e[Me]);break;case 57:xe.setQuadrant1Text(_e[Me]);break;case 58:xe.setQuadrant2Text(_e[Me]);break;case 59:xe.setQuadrant3Text(_e[Me]);break;case 60:xe.setQuadrant4Text(_e[Me]);break;case 64:this.$={text:_e[Me],type:"text"};break;case 65:this.$={text:_e[Me-1].text+""+_e[Me],type:_e[Me-1].type};break;case 66:this.$={text:_e[Me],type:"text"};break;case 67:this.$={text:_e[Me],type:"markdown"};break;case 68:this.$=_e[Me];break;case 69:this.$=_e[Me-1]+""+_e[Me];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:T,35:b,37:w,39:C,41:S,42:k,48:E,50:_,51:M,52:L,53:P,54:D,60:R,61:I,63:$,64:O,65:N,66:F,67:z}),t(s,[2,34]),{27:46,55:n,56:i,57:a},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:T,35:b,37:w,39:C,41:S,42:k,48:E,50:_,51:M,52:L,53:P,54:D,60:R,61:I,63:$,64:O,65:N,66:F,67:z}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:52,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:53,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:54,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:55,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:56,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:57,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,44:[1,58],47:[1,59],58:61,59:60,63:$,64:O,65:N,66:F,67:z},t(G,[2,64]),t(G,[2,66]),t(G,[2,67]),t(G,[2,70]),t(G,[2,71]),t(G,[2,72]),t(G,[2,73]),t(G,[2,74]),t(G,[2,75]),t(G,[2,76]),t(G,[2,77]),t(G,[2,78]),t(G,[2,79]),t(G,[2,80]),t(G,[2,81]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:H,5:q,6:Z,7:Y,8:ie,9:K,10:Q,11:te,12:J,13:ge,14:ee,15:Re,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,49:[1,78],63:$,64:O,65:N,66:F,67:z}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,49:[1,79],63:$,64:O,65:N,66:F,67:z}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),{45:[1,80]},{44:[1,81]},t(G,[2,65]),t(G,[2,82]),t(G,[2,83]),t(G,[2,84]),{3:83,4:H,5:q,6:Z,7:Y,8:ie,9:K,10:Q,11:te,12:J,13:ge,14:ee,15:Re,18:[1,82]},t(Ie,[2,23]),t(Ie,[2,1]),t(Ie,[2,2]),t(Ie,[2,3]),t(Ie,[2,4]),t(Ie,[2,5]),t(Ie,[2,6]),t(Ie,[2,7]),t(Ie,[2,8]),t(Ie,[2,9]),t(Ie,[2,10]),t(Ie,[2,11]),t(Ie,[2,12]),t(l,[2,52],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:R,61:I,63:$,64:O,65:N,66:F,67:z}),t(l,[2,55],{58:31,43:85,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:R,61:I,63:$,64:O,65:N,66:F,67:z}),{46:[1,86]},{45:[1,87]},{4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,16:90,17:ve,18:Ce,19:Ve,20:se,22:89,23:88},t(Ie,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),t(l,[2,47],{22:89,16:90,23:101,4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,17:ve,18:Ce,19:Ve,20:se}),{46:[1,102]},t(l,[2,29],{10:de}),t(Te,[2,27],{16:104,4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,17:ve,18:Ce,19:Ve,20:se}),t(ae,[2,25]),t(ae,[2,13]),t(ae,[2,14]),t(ae,[2,15]),t(ae,[2,16]),t(ae,[2,17]),t(ae,[2,18]),t(ae,[2,19]),t(ae,[2,20]),t(ae,[2,21]),t(ae,[2,22]),t(l,[2,49],{10:de}),t(l,[2,48],{22:89,16:90,23:105,4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,17:ve,18:Ce,19:Ve,20:se}),{4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,16:90,17:ve,18:Ce,19:Ve,20:se,22:106},t(ae,[2,26]),t(l,[2,50],{10:de}),t(Te,[2,28],{16:104,4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,17:ve,18:Ce,19:Ve,20:se})],defaultActions:{8:[2,30],9:[2,31]},parseError:x(function(ue,X){if(X.recoverable)this.trace(ue);else{var Oe=new Error(ue);throw Oe.hash=X,Oe}},"parseError"),parse:x(function(ue){var X=this,Oe=[0],xe=[],Ge=[null],_e=[],$e=this.table,Me="",He=0,De=0,Ke=2,Ae=1,at=_e.slice.call(arguments,1),Ee=Object.create(this.lexer),pt={yy:{}};for(var ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ht)&&(pt.yy[ht]=this.yy[ht]);Ee.setInput(ue,pt.yy),pt.yy.lexer=Ee,pt.yy.parser=this,typeof Ee.yylloc>"u"&&(Ee.yylloc={});var rt=Ee.yylloc;_e.push(rt);var Et=Ee.options&&Ee.options.ranges;typeof pt.yy.parseError=="function"?this.parseError=pt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function vt(Nt){Oe.length=Oe.length-2*Nt,Ge.length=Ge.length-Nt,_e.length=_e.length-Nt}x(vt,"popStack");function ot(){var Nt;return Nt=xe.pop()||Ee.lex()||Ae,typeof Nt!="number"&&(Nt instanceof Array&&(xe=Nt,Nt=xe.pop()),Nt=X.symbols_[Nt]||Nt),Nt}x(ot,"lex");for(var pe,Ct,lt,st,mt={},_r,Se,Ue,tt;;){if(Ct=Oe[Oe.length-1],this.defaultActions[Ct]?lt=this.defaultActions[Ct]:((pe===null||typeof pe>"u")&&(pe=ot()),lt=$e[Ct]&&$e[Ct][pe]),typeof lt>"u"||!lt.length||!lt[0]){var kt="";tt=[];for(_r in $e[Ct])this.terminals_[_r]&&_r>Ke&&tt.push("'"+this.terminals_[_r]+"'");Ee.showPosition?kt="Parse error on line "+(He+1)+`: `+Ee.showPosition()+` Expecting `+tt.join(", ")+", got '"+(this.terminals_[pe]||pe)+"'":kt="Parse error on line "+(He+1)+": Unexpected "+(pe==Ae?"end of input":"'"+(this.terminals_[pe]||pe)+"'"),this.parseError(kt,{text:Ee.match,token:this.terminals_[pe]||pe,line:Ee.yylineno,loc:rt,expected:tt})}if(lt[0]instanceof Array&<.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ct+", token: "+pe);switch(lt[0]){case 1:Oe.push(pe),Ge.push(Ee.yytext),_e.push(Ee.yylloc),Oe.push(lt[1]),pe=null,De=Ee.yyleng,Me=Ee.yytext,He=Ee.yylineno,rt=Ee.yylloc;break;case 2:if(Se=this.productions_[lt[1]][1],mt.$=Ge[Ge.length-Se],mt._$={first_line:_e[_e.length-(Se||1)].first_line,last_line:_e[_e.length-1].last_line,first_column:_e[_e.length-(Se||1)].first_column,last_column:_e[_e.length-1].last_column},Et&&(mt._$.range=[_e[_e.length-(Se||1)].range[0],_e[_e.length-1].range[1]]),st=this.performAction.apply(mt,[Me,De,He,pt.yy,lt[1],Ge,_e].concat(at)),typeof st<"u")return st;Se&&(Oe=Oe.slice(0,-1*Se*2),Ge=Ge.slice(0,-1*Se),_e=_e.slice(0,-1*Se)),Oe.push(this.productions_[lt[1]][0]),Ge.push(mt.$),_e.push(mt._$),Ue=$e[Oe[Oe.length-2]][Oe[Oe.length-1]],Oe.push(Ue);break;case 3:return!0}}return!0},"parse")},W=(function(){var j={EOF:1,parseError:x(function(X,Oe){if(this.yy.parser)this.yy.parser.parseError(X,Oe);else throw new Error(X)},"parseError"),setInput:x(function(ue,X){return this.yy=X||this.yy||{},this._input=ue,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var ue=this._input[0];this.yytext+=ue,this.yyleng++,this.offset++,this.match+=ue,this.matched+=ue;var X=ue.match(/(?:\r\n?|\n).*/g);return X?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ue},"input"),unput:x(function(ue){var X=ue.length,Oe=ue.split(/(?:\r\n?|\n)/g);this._input=ue+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-X),this.offset-=X;var xe=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Oe.length-1&&(this.yylineno-=Oe.length-1);var Ge=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Oe?(Oe.length===xe.length?this.yylloc.first_column:0)+xe[xe.length-Oe.length].length-Oe[0].length:this.yylloc.first_column-X},this.options.ranges&&(this.yylloc.range=[Ge[0],Ge[0]+this.yyleng-X]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(ue){this.unput(this.match.slice(ue))},"less"),pastInput:x(function(){var ue=this.matched.substr(0,this.matched.length-this.match.length);return(ue.length>20?"...":"")+ue.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var ue=this.match;return ue.length<20&&(ue+=this._input.substr(0,20-ue.length)),(ue.substr(0,20)+(ue.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var ue=this.pastInput(),X=new Array(ue.length+1).join("-");return ue+this.upcomingInput()+` `+X+"^"},"showPosition"),test_match:x(function(ue,X){var Oe,xe,Ge;if(this.options.backtrack_lexer&&(Ge={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ge.yylloc.range=this.yylloc.range.slice(0))),xe=ue[0].match(/(?:\r\n?|\n).*/g),xe&&(this.yylineno+=xe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:xe?xe[xe.length-1].length-xe[xe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ue[0].length},this.yytext+=ue[0],this.match+=ue[0],this.matches=ue,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(ue[0].length),this.matched+=ue[0],Oe=this.performAction.call(this,this.yy,this,X,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Oe)return Oe;if(this._backtrack){for(var _e in Ge)this[_e]=Ge[_e];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var ue,X,Oe,xe;this._more||(this.yytext="",this.match="");for(var Ge=this._currentRules(),_e=0;_eX[0].length)){if(X=Oe,xe=_e,this.options.backtrack_lexer){if(ue=this.test_match(Oe,Ge[_e]),ue!==!1)return ue;if(this._backtrack){X=!1;continue}else return!1}else if(!this.options.flex)break}return X?(ue=this.test_match(X,Ge[xe]),ue!==!1?ue:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var X=this.next();return X||this.lex()},"lex"),begin:x(function(X){this.conditionStack.push(X)},"begin"),popState:x(function(){var X=this.conditionStack.length-1;return X>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(X){return X=this.conditionStack.length-1-Math.abs(X||0),X>=0?this.conditionStack[X]:"INITIAL"},"topState"),pushState:x(function(X){this.begin(X)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(X,Oe,xe,Ge){switch(xe){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return j})();he.lexer=W;function ne(){this.yy={}}return x(ne,"Parser"),ne.prototype=he,he.Parser=ne,new ne})();LB.parser=LB;var c6t=LB,As=Dh(),W2,u6t=(W2=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=Vr.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=Vr.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=Vr.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=Vr.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=Vr.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((s=Vr.quadrantChart)==null?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:((o=Vr.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=Vr.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=Vr.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=Vr.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=Vr.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=Vr.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=Vr.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=Vr.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=Vr.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((y=Vr.quadrantChart)==null?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((v=Vr.quadrantChart)==null?void 0:v.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((T=Vr.quadrantChart)==null?void 0:T.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:As.quadrant1Fill,quadrant2Fill:As.quadrant2Fill,quadrant3Fill:As.quadrant3Fill,quadrant4Fill:As.quadrant4Fill,quadrant1TextFill:As.quadrant1TextFill,quadrant2TextFill:As.quadrant2TextFill,quadrant3TextFill:As.quadrant3TextFill,quadrant4TextFill:As.quadrant4TextFill,quadrantPointFill:As.quadrantPointFill,quadrantPointTextFill:As.quadrantPointTextFill,quadrantXAxisTextFill:As.quadrantXAxisTextFill,quadrantYAxisTextFill:As.quadrantYAxisTextFill,quadrantTitleFill:As.quadrantTitleFill,quadrantInternalBorderStrokeFill:As.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:As.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,le.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,r){this.classes.set(e,r)}setConfig(e){le.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){le.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const a=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,s={top:e==="top"&&r?a:0,bottom:e==="bottom"&&r?a:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?o:0,right:this.config.yAxisPosition==="right"&&n?o:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+s.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-s.top-s.bottom-h.top,m=p/2,y=g/2;return{xAxisSpace:s,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:y}}}getAxisLabels(e,r,n,i){const{quadrantSpace:a,titleSpace:s}=i,{quadrantHalfHeight:o,quadrantHeight:l,quadrantLeft:u,quadrantHalfWidth:h,quadrantTop:d,quadrantWidth:f}=a,p=!!this.data.xAxisRightText,g=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&r&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&r&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+h+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+l-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+o-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(e){const{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantLeft:i,quadrantHalfWidth:a,quadrantTop:s}=r,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s,width:a,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s,width:a,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of o)l.text.x=l.x+l.width/2,this.data.points.length===0?(l.text.y=l.y+l.height/2,l.text.horizontalPos="middle"):(l.text.y=l.y+this.config.quadrantTextTopPadding,l.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:a,quadrantWidth:s}=r,o=Sb().domain([0,1]).range([i,s+i]),l=Sb().domain([0,1]).range([n+a,a]);return this.data.points.map(h=>{const d=this.classes.get(h.className);return d&&(h={...d,...h}),{x:o(h.x),y:l(h.y),fill:h.color??this.themeConfig.quadrantPointFill,radius:h.radius??this.config.pointRadius,text:{text:h.text,fill:this.themeConfig.quadrantPointTextFill,x:o(h.x),y:l(h.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:h.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:h.strokeWidth??"0px"}})}getBorders(e){const r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:a,quadrantLeft:s,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l,x2:s+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s+u,y1:l+r,x2:s+u,y2:l+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l+a,x2:s+u+r,y2:l+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s,y1:l+r,x2:s,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+o,y1:l+r,x2:s+o,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+r,y1:l+i,x2:s+u-r,y2:l+i}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,a=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(a),quadrants:this.getQuadrants(a),axisLabels:this.getAxisLabels(i,e,r,a),borderLines:this.getBorders(a),title:this.getTitle(n)}}},x(W2,"QuadrantBuilder"),W2),H2,C4=(H2=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},x(H2,"InvalidStyleError"),H2);function MB(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}x(MB,"validateHexCode");function XAe(t){return!/^\d+$/.test(t)}x(XAe,"validateNumber");function jAe(t){return!/^\d+px$/.test(t)}x(jAe,"validateSizeInPixels");function bu(t){return Wr(t.trim(),Fe())}x(bu,"textSanitizer");var ja=new u6t;function KAe(t){ja.setData({quadrant1Text:bu(t.text)})}x(KAe,"setQuadrant1Text");function ZAe(t){ja.setData({quadrant2Text:bu(t.text)})}x(ZAe,"setQuadrant2Text");function QAe(t){ja.setData({quadrant3Text:bu(t.text)})}x(QAe,"setQuadrant3Text");function JAe(t){ja.setData({quadrant4Text:bu(t.text)})}x(JAe,"setQuadrant4Text");function e_e(t){ja.setData({xAxisLeftText:bu(t.text)})}x(e_e,"setXAxisLeftText");function t_e(t){ja.setData({xAxisRightText:bu(t.text)})}x(t_e,"setXAxisRightText");function r_e(t){ja.setData({yAxisTopText:bu(t.text)})}x(r_e,"setYAxisTopText");function n_e(t){ja.setData({yAxisBottomText:bu(t.text)})}x(n_e,"setYAxisBottomText");function N7(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(XAe(i))throw new C4(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(MB(i))throw new C4(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(MB(i))throw new C4(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(jAe(i))throw new C4(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}x(N7,"parseStyles");function i_e(t,e,r,n,i){const a=N7(i);ja.addPoints([{x:r,y:n,text:bu(t.text),className:e,...a}])}x(i_e,"addPoint");function a_e(t,e){ja.addClass(t,N7(e))}x(a_e,"addClass");function s_e(t){ja.setConfig({chartWidth:t})}x(s_e,"setWidth");function o_e(t){ja.setConfig({chartHeight:t})}x(o_e,"setHeight");function l_e(){const t=Fe(),{themeVariables:e,quadrantChart:r}=t;return r&&ja.setConfig(r),ja.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),ja.setData({titleText:Yn()}),ja.build()}x(l_e,"getQuadrantData");var h6t=x(function(){ja.clear(),On()},"clear"),d6t={setWidth:s_e,setHeight:o_e,setQuadrant1Text:KAe,setQuadrant2Text:ZAe,setQuadrant3Text:QAe,setQuadrant4Text:JAe,setXAxisLeftText:e_e,setXAxisRightText:t_e,setYAxisTopText:r_e,setYAxisBottomText:n_e,parseStyles:N7,addPoint:i_e,addClass:a_e,getQuadrantData:l_e,clear:h6t,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii},f6t=x((t,e,r,n)=>{var E,_,M;function i(L){return L==="top"?"hanging":"middle"}x(i,"getDominantBaseLine");function a(L){return L==="left"?"start":"middle"}x(a,"getTextAnchor");function s(L){return`translate(${L.x}, ${L.y}) rotate(${L.rotation||0})`}x(s,"getTransformation");const o=Fe();le.debug(`Rendering quadrant chart -`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=ut("#i"+e));const d=ut(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((E=o.quadrantChart)==null?void 0:E.chartWidth)??500,g=((_=o.quadrantChart)==null?void 0:_.chartHeight)??500;Ai(d,g,p,((M=o.quadrantChart)==null?void 0:M.useMaxWidth)??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),y=f.append("g").attr("class","quadrants"),v=f.append("g").attr("class","border"),T=f.append("g").attr("class","data-points"),b=f.append("g").attr("class","labels"),w=f.append("g").attr("class","title");m.title&&w.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",a(m.title.verticalPos)).attr("transform",s(m.title)).text(m.title.text),m.borderLines&&v.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",L=>L.x1).attr("y1",L=>L.y1).attr("x2",L=>L.x2).attr("y2",L=>L.y2).style("stroke",L=>L.strokeFill).style("stroke-width",L=>L.strokeWidth);const C=y.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");C.append("rect").attr("x",L=>L.x).attr("y",L=>L.y).attr("width",L=>L.width).attr("height",L=>L.height).attr("fill",L=>L.fill),C.append("text").attr("x",0).attr("y",0).attr("fill",L=>L.text.fill).attr("font-size",L=>L.text.fontSize).attr("dominant-baseline",L=>i(L.text.horizontalPos)).attr("text-anchor",L=>a(L.text.verticalPos)).attr("transform",L=>s(L.text)).text(L=>L.text.text),b.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(L=>L.text).attr("fill",L=>L.fill).attr("font-size",L=>L.fontSize).attr("dominant-baseline",L=>i(L.horizontalPos)).attr("text-anchor",L=>a(L.verticalPos)).attr("transform",L=>s(L));const k=T.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");k.append("circle").attr("cx",L=>L.x).attr("cy",L=>L.y).attr("r",L=>L.radius).attr("fill",L=>L.fill).attr("stroke",L=>L.strokeColor).attr("stroke-width",L=>L.strokeWidth),k.append("text").attr("x",0).attr("y",0).text(L=>L.text.text).attr("fill",L=>L.text.fill).attr("font-size",L=>L.text.fontSize).attr("dominant-baseline",L=>i(L.text.horizontalPos)).attr("text-anchor",L=>a(L.text.verticalPos)).attr("transform",L=>s(L.text))},"draw"),p6t={draw:f6t},g6t={parser:c6t,db:d6t,renderer:p6t,styles:x(()=>"","styles")};const m6t=Object.freeze(Object.defineProperty({__proto__:null,diagram:g6t},Symbol.toStringTag,{value:"Module"}));var IB=(function(){var t=x(function($,O,N,F){for(N=N||{},F=$.length;F--;N[$[F]]=O);return N},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],o=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[1,32],m=[1,33],y=[1,34],v=[1,35],T=[1,36],b=[1,37],w=[1,43],C=[1,42],S=[1,47],k=[1,50],E=[1,10,12,14,16,18,19,21,23,36,37,38],_=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],M=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],L=[1,65],P=[26,28],D={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:x(function(O,N,F,z,V,B,G){var H=B.length-1;switch(V){case 5:z.setOrientation(B[H]);break;case 9:z.setDiagramTitle(B[H].text.trim());break;case 12:z.setLineData({text:"",type:"text"},B[H]);break;case 13:z.setLineData(B[H-1],B[H]);break;case 14:z.setBarData({text:"",type:"text"},B[H]);break;case 15:z.setBarData(B[H-1],B[H]);break;case 16:this.$=B[H].trim(),z.setAccTitle(this.$);break;case 17:case 18:this.$=B[H].trim(),z.setAccDescription(this.$);break;case 19:this.$=B[H-1];break;case 20:case 30:this.$=[B[H-2],...B[H]];break;case 21:case 31:this.$=[B[H]];break;case 22:this.$={value:Number(B[H-1]),label:B[H]};break;case 23:this.$={value:Number(B[H]),label:""};break;case 24:z.setXAxisTitle(B[H]);break;case 25:z.setXAxisTitle(B[H-1]);break;case 26:z.setXAxisTitle({type:"text",text:""});break;case 27:z.setXAxisBand(B[H]);break;case 28:z.setXAxisRangeData(Number(B[H-2]),Number(B[H]));break;case 29:this.$=B[H-1];break;case 32:z.setYAxisTitle(B[H]);break;case 33:z.setYAxisTitle(B[H-1]);break;case 34:z.setYAxisTitle({type:"text",text:""});break;case 35:z.setYAxisRangeData(Number(B[H-2]),Number(B[H]));break;case 39:this.$={text:B[H],type:"text"};break;case 40:this.$={text:B[H],type:"text"};break;case 41:this.$={text:B[H],type:"markdown"};break;case 42:this.$=B[H];break;case 43:this.$=B[H-1]+""+B[H];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,36:i,37:a,38:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,36:i,37:a,38:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:i,37:a,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,36]),t(o,[2,37]),t(o,[2,38]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,36:i,37:a,38:s}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,36:i,37:a,38:s}),{11:23,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:39,13:38,24:w,29:C,30:l,31:40,32:41,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:45,15:44,29:S,30:l,35:46,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:49,17:48,24:k,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:52,17:51,24:k,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{20:[1,53]},{22:[1,54]},t(E,[2,18]),{1:[2,2]},t(E,[2,8]),t(E,[2,9]),t(_,[2,39],{41:55,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b}),t(_,[2,40]),t(_,[2,41]),t(M,[2,42]),t(M,[2,44]),t(M,[2,45]),t(M,[2,46]),t(M,[2,47]),t(M,[2,48]),t(M,[2,49]),t(M,[2,50]),t(M,[2,51]),t(M,[2,52]),t(M,[2,53]),t(E,[2,10]),t(E,[2,24],{32:41,31:56,24:w,29:C}),t(E,[2,26]),t(E,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},t(E,[2,11]),t(E,[2,32],{35:60,29:S}),t(E,[2,34]),{33:[1,61]},t(E,[2,12]),{17:62,24:k},{25:63,27:64,29:L},t(E,[2,14]),{17:66,24:k},t(E,[2,16]),t(E,[2,17]),t(M,[2,43]),t(E,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(E,[2,33]),{29:[1,70]},t(E,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(P,[2,23],{30:[1,73]}),t(E,[2,15]),t(E,[2,28]),t(E,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},t(E,[2,35]),t(E,[2,19]),{25:75,27:64,29:L},t(P,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:x(function(O,N){if(N.recoverable)this.trace(O);else{var F=new Error(O);throw F.hash=N,F}},"parseError"),parse:x(function(O){var N=this,F=[0],z=[],V=[null],B=[],G=this.table,H="",q=0,Z=0,Y=2,ie=1,K=B.slice.call(arguments,1),Q=Object.create(this.lexer),te={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(te.yy[J]=this.yy[J]);Q.setInput(O,te.yy),te.yy.lexer=Q,te.yy.parser=this,typeof Q.yylloc>"u"&&(Q.yylloc={});var ge=Q.yylloc;B.push(ge);var ee=Q.options&&Q.options.ranges;typeof te.yy.parseError=="function"?this.parseError=te.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(de){F.length=F.length-2*de,V.length=V.length-de,B.length=B.length-de}x(Re,"popStack");function Ie(){var de;return de=z.pop()||Q.lex()||ie,typeof de!="number"&&(de instanceof Array&&(z=de,de=z.pop()),de=N.symbols_[de]||de),de}x(Ie,"lex");for(var Be,ce,oe,be,fe={},Pe,ve,Ce,Ve;;){if(ce=F[F.length-1],this.defaultActions[ce]?oe=this.defaultActions[ce]:((Be===null||typeof Be>"u")&&(Be=Ie()),oe=G[ce]&&G[ce][Be]),typeof oe>"u"||!oe.length||!oe[0]){var se="";Ve=[];for(Pe in G[ce])this.terminals_[Pe]&&Pe>Y&&Ve.push("'"+this.terminals_[Pe]+"'");Q.showPosition?se="Parse error on line "+(q+1)+`: +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var X=this.next();return X||this.lex()},"lex"),begin:x(function(X){this.conditionStack.push(X)},"begin"),popState:x(function(){var X=this.conditionStack.length-1;return X>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(X){return X=this.conditionStack.length-1-Math.abs(X||0),X>=0?this.conditionStack[X]:"INITIAL"},"topState"),pushState:x(function(X){this.begin(X)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(X,Oe,xe,Ge){switch(xe){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return j})();he.lexer=W;function ne(){this.yy={}}return x(ne,"Parser"),ne.prototype=he,he.Parser=ne,new ne})();LB.parser=LB;var d6t=LB,As=Dh(),W2,f6t=(W2=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=Vr.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=Vr.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=Vr.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=Vr.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=Vr.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((s=Vr.quadrantChart)==null?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:((o=Vr.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=Vr.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=Vr.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=Vr.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=Vr.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=Vr.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=Vr.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=Vr.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=Vr.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((y=Vr.quadrantChart)==null?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((v=Vr.quadrantChart)==null?void 0:v.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((T=Vr.quadrantChart)==null?void 0:T.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:As.quadrant1Fill,quadrant2Fill:As.quadrant2Fill,quadrant3Fill:As.quadrant3Fill,quadrant4Fill:As.quadrant4Fill,quadrant1TextFill:As.quadrant1TextFill,quadrant2TextFill:As.quadrant2TextFill,quadrant3TextFill:As.quadrant3TextFill,quadrant4TextFill:As.quadrant4TextFill,quadrantPointFill:As.quadrantPointFill,quadrantPointTextFill:As.quadrantPointTextFill,quadrantXAxisTextFill:As.quadrantXAxisTextFill,quadrantYAxisTextFill:As.quadrantYAxisTextFill,quadrantTitleFill:As.quadrantTitleFill,quadrantInternalBorderStrokeFill:As.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:As.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,le.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,r){this.classes.set(e,r)}setConfig(e){le.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){le.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const a=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,s={top:e==="top"&&r?a:0,bottom:e==="bottom"&&r?a:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?o:0,right:this.config.yAxisPosition==="right"&&n?o:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+s.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-s.top-s.bottom-h.top,m=p/2,y=g/2;return{xAxisSpace:s,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:y}}}getAxisLabels(e,r,n,i){const{quadrantSpace:a,titleSpace:s}=i,{quadrantHalfHeight:o,quadrantHeight:l,quadrantLeft:u,quadrantHalfWidth:h,quadrantTop:d,quadrantWidth:f}=a,p=!!this.data.xAxisRightText,g=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&r&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&r&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+h+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+l-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+o-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(e){const{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantLeft:i,quadrantHalfWidth:a,quadrantTop:s}=r,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s,width:a,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s,width:a,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of o)l.text.x=l.x+l.width/2,this.data.points.length===0?(l.text.y=l.y+l.height/2,l.text.horizontalPos="middle"):(l.text.y=l.y+this.config.quadrantTextTopPadding,l.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:a,quadrantWidth:s}=r,o=Sb().domain([0,1]).range([i,s+i]),l=Sb().domain([0,1]).range([n+a,a]);return this.data.points.map(h=>{const d=this.classes.get(h.className);return d&&(h={...d,...h}),{x:o(h.x),y:l(h.y),fill:h.color??this.themeConfig.quadrantPointFill,radius:h.radius??this.config.pointRadius,text:{text:h.text,fill:this.themeConfig.quadrantPointTextFill,x:o(h.x),y:l(h.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:h.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:h.strokeWidth??"0px"}})}getBorders(e){const r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:a,quadrantLeft:s,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l,x2:s+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s+u,y1:l+r,x2:s+u,y2:l+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l+a,x2:s+u+r,y2:l+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s,y1:l+r,x2:s,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+o,y1:l+r,x2:s+o,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+r,y1:l+i,x2:s+u-r,y2:l+i}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,a=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(a),quadrants:this.getQuadrants(a),axisLabels:this.getAxisLabels(i,e,r,a),borderLines:this.getBorders(a),title:this.getTitle(n)}}},x(W2,"QuadrantBuilder"),W2),H2,C4=(H2=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},x(H2,"InvalidStyleError"),H2);function MB(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}x(MB,"validateHexCode");function jAe(t){return!/^\d+$/.test(t)}x(jAe,"validateNumber");function KAe(t){return!/^\d+px$/.test(t)}x(KAe,"validateSizeInPixels");function bu(t){return Wr(t.trim(),Fe())}x(bu,"textSanitizer");var ja=new f6t;function ZAe(t){ja.setData({quadrant1Text:bu(t.text)})}x(ZAe,"setQuadrant1Text");function QAe(t){ja.setData({quadrant2Text:bu(t.text)})}x(QAe,"setQuadrant2Text");function JAe(t){ja.setData({quadrant3Text:bu(t.text)})}x(JAe,"setQuadrant3Text");function e_e(t){ja.setData({quadrant4Text:bu(t.text)})}x(e_e,"setQuadrant4Text");function t_e(t){ja.setData({xAxisLeftText:bu(t.text)})}x(t_e,"setXAxisLeftText");function r_e(t){ja.setData({xAxisRightText:bu(t.text)})}x(r_e,"setXAxisRightText");function n_e(t){ja.setData({yAxisTopText:bu(t.text)})}x(n_e,"setYAxisTopText");function i_e(t){ja.setData({yAxisBottomText:bu(t.text)})}x(i_e,"setYAxisBottomText");function N7(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(jAe(i))throw new C4(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(MB(i))throw new C4(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(MB(i))throw new C4(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(KAe(i))throw new C4(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}x(N7,"parseStyles");function a_e(t,e,r,n,i){const a=N7(i);ja.addPoints([{x:r,y:n,text:bu(t.text),className:e,...a}])}x(a_e,"addPoint");function s_e(t,e){ja.addClass(t,N7(e))}x(s_e,"addClass");function o_e(t){ja.setConfig({chartWidth:t})}x(o_e,"setWidth");function l_e(t){ja.setConfig({chartHeight:t})}x(l_e,"setHeight");function c_e(){const t=Fe(),{themeVariables:e,quadrantChart:r}=t;return r&&ja.setConfig(r),ja.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),ja.setData({titleText:Yn()}),ja.build()}x(c_e,"getQuadrantData");var p6t=x(function(){ja.clear(),$n()},"clear"),g6t={setWidth:o_e,setHeight:l_e,setQuadrant1Text:ZAe,setQuadrant2Text:QAe,setQuadrant3Text:JAe,setQuadrant4Text:e_e,setXAxisLeftText:t_e,setXAxisRightText:r_e,setYAxisTopText:n_e,setYAxisBottomText:i_e,parseStyles:N7,addPoint:a_e,addClass:s_e,getQuadrantData:c_e,clear:p6t,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii},m6t=x((t,e,r,n)=>{var E,_,M;function i(L){return L==="top"?"hanging":"middle"}x(i,"getDominantBaseLine");function a(L){return L==="left"?"start":"middle"}x(a,"getTextAnchor");function s(L){return`translate(${L.x}, ${L.y}) rotate(${L.rotation||0})`}x(s,"getTransformation");const o=Fe();le.debug(`Rendering quadrant chart +`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=ut("#i"+e));const d=ut(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((E=o.quadrantChart)==null?void 0:E.chartWidth)??500,g=((_=o.quadrantChart)==null?void 0:_.chartHeight)??500;Ai(d,g,p,((M=o.quadrantChart)==null?void 0:M.useMaxWidth)??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),y=f.append("g").attr("class","quadrants"),v=f.append("g").attr("class","border"),T=f.append("g").attr("class","data-points"),b=f.append("g").attr("class","labels"),w=f.append("g").attr("class","title");m.title&&w.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",a(m.title.verticalPos)).attr("transform",s(m.title)).text(m.title.text),m.borderLines&&v.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",L=>L.x1).attr("y1",L=>L.y1).attr("x2",L=>L.x2).attr("y2",L=>L.y2).style("stroke",L=>L.strokeFill).style("stroke-width",L=>L.strokeWidth);const C=y.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");C.append("rect").attr("x",L=>L.x).attr("y",L=>L.y).attr("width",L=>L.width).attr("height",L=>L.height).attr("fill",L=>L.fill),C.append("text").attr("x",0).attr("y",0).attr("fill",L=>L.text.fill).attr("font-size",L=>L.text.fontSize).attr("dominant-baseline",L=>i(L.text.horizontalPos)).attr("text-anchor",L=>a(L.text.verticalPos)).attr("transform",L=>s(L.text)).text(L=>L.text.text),b.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(L=>L.text).attr("fill",L=>L.fill).attr("font-size",L=>L.fontSize).attr("dominant-baseline",L=>i(L.horizontalPos)).attr("text-anchor",L=>a(L.verticalPos)).attr("transform",L=>s(L));const k=T.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");k.append("circle").attr("cx",L=>L.x).attr("cy",L=>L.y).attr("r",L=>L.radius).attr("fill",L=>L.fill).attr("stroke",L=>L.strokeColor).attr("stroke-width",L=>L.strokeWidth),k.append("text").attr("x",0).attr("y",0).text(L=>L.text.text).attr("fill",L=>L.text.fill).attr("font-size",L=>L.text.fontSize).attr("dominant-baseline",L=>i(L.text.horizontalPos)).attr("text-anchor",L=>a(L.text.verticalPos)).attr("transform",L=>s(L.text))},"draw"),y6t={draw:m6t},v6t={parser:d6t,db:g6t,renderer:y6t,styles:x(()=>"","styles")};const b6t=Object.freeze(Object.defineProperty({__proto__:null,diagram:v6t},Symbol.toStringTag,{value:"Module"}));var IB=(function(){var t=x(function($,O,N,F){for(N=N||{},F=$.length;F--;N[$[F]]=O);return N},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],o=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[1,32],m=[1,33],y=[1,34],v=[1,35],T=[1,36],b=[1,37],w=[1,43],C=[1,42],S=[1,47],k=[1,50],E=[1,10,12,14,16,18,19,21,23,36,37,38],_=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],M=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],L=[1,65],P=[26,28],D={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:x(function(O,N,F,z,V,B,G){var H=B.length-1;switch(V){case 5:z.setOrientation(B[H]);break;case 9:z.setDiagramTitle(B[H].text.trim());break;case 12:z.setLineData({text:"",type:"text"},B[H]);break;case 13:z.setLineData(B[H-1],B[H]);break;case 14:z.setBarData({text:"",type:"text"},B[H]);break;case 15:z.setBarData(B[H-1],B[H]);break;case 16:this.$=B[H].trim(),z.setAccTitle(this.$);break;case 17:case 18:this.$=B[H].trim(),z.setAccDescription(this.$);break;case 19:this.$=B[H-1];break;case 20:case 30:this.$=[B[H-2],...B[H]];break;case 21:case 31:this.$=[B[H]];break;case 22:this.$={value:Number(B[H-1]),label:B[H]};break;case 23:this.$={value:Number(B[H]),label:""};break;case 24:z.setXAxisTitle(B[H]);break;case 25:z.setXAxisTitle(B[H-1]);break;case 26:z.setXAxisTitle({type:"text",text:""});break;case 27:z.setXAxisBand(B[H]);break;case 28:z.setXAxisRangeData(Number(B[H-2]),Number(B[H]));break;case 29:this.$=B[H-1];break;case 32:z.setYAxisTitle(B[H]);break;case 33:z.setYAxisTitle(B[H-1]);break;case 34:z.setYAxisTitle({type:"text",text:""});break;case 35:z.setYAxisRangeData(Number(B[H-2]),Number(B[H]));break;case 39:this.$={text:B[H],type:"text"};break;case 40:this.$={text:B[H],type:"text"};break;case 41:this.$={text:B[H],type:"markdown"};break;case 42:this.$=B[H];break;case 43:this.$=B[H-1]+""+B[H];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,36:i,37:a,38:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,36:i,37:a,38:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:i,37:a,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,36]),t(o,[2,37]),t(o,[2,38]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,36:i,37:a,38:s}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,36:i,37:a,38:s}),{11:23,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:39,13:38,24:w,29:C,30:l,31:40,32:41,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:45,15:44,29:S,30:l,35:46,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:49,17:48,24:k,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:52,17:51,24:k,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{20:[1,53]},{22:[1,54]},t(E,[2,18]),{1:[2,2]},t(E,[2,8]),t(E,[2,9]),t(_,[2,39],{41:55,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b}),t(_,[2,40]),t(_,[2,41]),t(M,[2,42]),t(M,[2,44]),t(M,[2,45]),t(M,[2,46]),t(M,[2,47]),t(M,[2,48]),t(M,[2,49]),t(M,[2,50]),t(M,[2,51]),t(M,[2,52]),t(M,[2,53]),t(E,[2,10]),t(E,[2,24],{32:41,31:56,24:w,29:C}),t(E,[2,26]),t(E,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},t(E,[2,11]),t(E,[2,32],{35:60,29:S}),t(E,[2,34]),{33:[1,61]},t(E,[2,12]),{17:62,24:k},{25:63,27:64,29:L},t(E,[2,14]),{17:66,24:k},t(E,[2,16]),t(E,[2,17]),t(M,[2,43]),t(E,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(E,[2,33]),{29:[1,70]},t(E,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(P,[2,23],{30:[1,73]}),t(E,[2,15]),t(E,[2,28]),t(E,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},t(E,[2,35]),t(E,[2,19]),{25:75,27:64,29:L},t(P,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:x(function(O,N){if(N.recoverable)this.trace(O);else{var F=new Error(O);throw F.hash=N,F}},"parseError"),parse:x(function(O){var N=this,F=[0],z=[],V=[null],B=[],G=this.table,H="",q=0,Z=0,Y=2,ie=1,K=B.slice.call(arguments,1),Q=Object.create(this.lexer),te={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(te.yy[J]=this.yy[J]);Q.setInput(O,te.yy),te.yy.lexer=Q,te.yy.parser=this,typeof Q.yylloc>"u"&&(Q.yylloc={});var ge=Q.yylloc;B.push(ge);var ee=Q.options&&Q.options.ranges;typeof te.yy.parseError=="function"?this.parseError=te.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(de){F.length=F.length-2*de,V.length=V.length-de,B.length=B.length-de}x(Re,"popStack");function Ie(){var de;return de=z.pop()||Q.lex()||ie,typeof de!="number"&&(de instanceof Array&&(z=de,de=z.pop()),de=N.symbols_[de]||de),de}x(Ie,"lex");for(var Be,ce,oe,be,fe={},Pe,ve,Ce,Ve;;){if(ce=F[F.length-1],this.defaultActions[ce]?oe=this.defaultActions[ce]:((Be===null||typeof Be>"u")&&(Be=Ie()),oe=G[ce]&&G[ce][Be]),typeof oe>"u"||!oe.length||!oe[0]){var se="";Ve=[];for(Pe in G[ce])this.terminals_[Pe]&&Pe>Y&&Ve.push("'"+this.terminals_[Pe]+"'");Q.showPosition?se="Parse error on line "+(q+1)+`: `+Q.showPosition()+` Expecting `+Ve.join(", ")+", got '"+(this.terminals_[Be]||Be)+"'":se="Parse error on line "+(q+1)+": Unexpected "+(Be==ie?"end of input":"'"+(this.terminals_[Be]||Be)+"'"),this.parseError(se,{text:Q.match,token:this.terminals_[Be]||Be,line:Q.yylineno,loc:ge,expected:Ve})}if(oe[0]instanceof Array&&oe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ce+", token: "+Be);switch(oe[0]){case 1:F.push(Be),V.push(Q.yytext),B.push(Q.yylloc),F.push(oe[1]),Be=null,Z=Q.yyleng,H=Q.yytext,q=Q.yylineno,ge=Q.yylloc;break;case 2:if(ve=this.productions_[oe[1]][1],fe.$=V[V.length-ve],fe._$={first_line:B[B.length-(ve||1)].first_line,last_line:B[B.length-1].last_line,first_column:B[B.length-(ve||1)].first_column,last_column:B[B.length-1].last_column},ee&&(fe._$.range=[B[B.length-(ve||1)].range[0],B[B.length-1].range[1]]),be=this.performAction.apply(fe,[H,Z,q,te.yy,oe[1],V,B].concat(K)),typeof be<"u")return be;ve&&(F=F.slice(0,-1*ve*2),V=V.slice(0,-1*ve),B=B.slice(0,-1*ve)),F.push(this.productions_[oe[1]][0]),V.push(fe.$),B.push(fe._$),Ce=G[F[F.length-2]][F[F.length-1]],F.push(Ce);break;case 3:return!0}}return!0},"parse")},R=(function(){var $={EOF:1,parseError:x(function(N,F){if(this.yy.parser)this.yy.parser.parseError(N,F);else throw new Error(N)},"parseError"),setInput:x(function(O,N){return this.yy=N||this.yy||{},this._input=O,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var O=this._input[0];this.yytext+=O,this.yyleng++,this.offset++,this.match+=O,this.matched+=O;var N=O.match(/(?:\r\n?|\n).*/g);return N?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),O},"input"),unput:x(function(O){var N=O.length,F=O.split(/(?:\r\n?|\n)/g);this._input=O+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-N),this.offset-=N;var z=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),F.length-1&&(this.yylineno-=F.length-1);var V=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:F?(F.length===z.length?this.yylloc.first_column:0)+z[z.length-F.length].length-F[0].length:this.yylloc.first_column-N},this.options.ranges&&(this.yylloc.range=[V[0],V[0]+this.yyleng-N]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(O){this.unput(this.match.slice(O))},"less"),pastInput:x(function(){var O=this.matched.substr(0,this.matched.length-this.match.length);return(O.length>20?"...":"")+O.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var O=this.match;return O.length<20&&(O+=this._input.substr(0,20-O.length)),(O.substr(0,20)+(O.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var O=this.pastInput(),N=new Array(O.length+1).join("-");return O+this.upcomingInput()+` `+N+"^"},"showPosition"),test_match:x(function(O,N){var F,z,V;if(this.options.backtrack_lexer&&(V={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(V.yylloc.range=this.yylloc.range.slice(0))),z=O[0].match(/(?:\r\n?|\n).*/g),z&&(this.yylineno+=z.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:z?z[z.length-1].length-z[z.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+O[0].length},this.yytext+=O[0],this.match+=O[0],this.matches=O,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(O[0].length),this.matched+=O[0],F=this.performAction.call(this,this.yy,this,N,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),F)return F;if(this._backtrack){for(var B in V)this[B]=V[B];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var O,N,F,z;this._more||(this.yytext="",this.match="");for(var V=this._currentRules(),B=0;BN[0].length)){if(N=F,z=B,this.options.backtrack_lexer){if(O=this.test_match(F,V[B]),O!==!1)return O;if(this._backtrack){N=!1;continue}else return!1}else if(!this.options.flex)break}return N?(O=this.test_match(N,V[z]),O!==!1?O:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var N=this.next();return N||this.lex()},"lex"),begin:x(function(N){this.conditionStack.push(N)},"begin"),popState:x(function(){var N=this.conditionStack.length-1;return N>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(N){return N=this.conditionStack.length-1-Math.abs(N||0),N>=0?this.conditionStack[N]:"INITIAL"},"topState"),pushState:x(function(N){this.begin(N)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(N,F,z,V){switch(z){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return $})();D.lexer=R;function I(){this.yy={}}return x(I,"Parser"),I.prototype=D,D.Parser=I,new I})();IB.parser=IB;var y6t=IB;function NB(t){return t.type==="bar"}x(NB,"isBarPlot");function T6(t){return t.type==="band"}x(T6,"isBandAxisData");function _y(t){return t.type==="linear"}x(_y,"isLinearAxisData");var q2,c_e=(q2=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((a,s)=>Math.max(s.length,a),0)*r,height:r};const n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(const a of e){const s=sfe(i,1,a),o=s?s.width:a.length*r,l=s?s.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},x(q2,"TextDimensionCalculatorWithFont"),q2),pie=.7,gie=.2,U2,u_e=(U2=class{constructor(e,r,n,i){this.axisConfig=e,this.title=r,this.textDimensionCalculator=n,this.axisThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){pie*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(pie*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let r=e.height;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=gie*e.width;this.outerPadding=Math.min(n.width/2,i);let a=n.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),a+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-r}calculateSpaceIfDrawnVertical(e){let r=e.width;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=gie*e.height;this.outerPadding=Math.min(n.height/2,i);const a=n.width+this.axisConfig.labelPadding*2;a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){const r=this.normalizedLabelRotationInRad;return r===0?0:Math.sin(r)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},x(U2,"BaseAxis"),U2),Y2,v6t=(Y2=class extends u_e{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=uO().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=uO().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),le.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},x(Y2,"BandAxis"),Y2),X2,b6t=(X2=class extends u_e{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=Sb().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=Sb().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},x(X2,"LinearAxis"),X2);function DB(t,e,r,n){const i=new c_e(n);return T6(t)?new v6t(e,r,t.categories,t.title,i):new b6t(e,r,[t.min,t.max],t.title,i)}x(DB,"getAxis");var j2,x6t=(j2=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}},x(j2,"ChartTitle"),j2);function h_e(t,e,r,n){const i=new c_e(n);return new x6t(i,t,e,r)}x(h_e,"getChartTitleComponent");var K2,T6t=(K2=class{constructor(e,r,n,i,a){this.plotData=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}getDrawableElement(){const e=this.plotData.data.map(i=>[this.xAxis.getScaleValue(i[0]),this.yAxis.getScaleValue(i[1])]);let r;if(this.orientation==="horizontal"?r=NC().y(i=>i[0]).x(i=>i[1])(e):r=NC().x(i=>i[0]).y(i=>i[1])(e),!r)return[];const n=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const s=[];for(const[o,[l,u]]of e.entries()){const h=this.plotData.pointLabels[o];h&&(this.orientation==="horizontal"?s.push({x:u+10,y:l,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):s.push({x:l,y:u-10,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}s.length>0&&n.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:s})}return n}},x(K2,"LinePlot"),K2),Z2,w6t=(Z2=class{constructor(e,r,n,i,a,s){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=a,this.plotIndex=s}getDrawableElement(){const e=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:this.boundingRect.x,y:a[0]-i,height:n,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:a[0]-i,y:a[1],width:n,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},x(Z2,"BarPlot"),Z2),Q2,C6t=(Q2=class{constructor(e,r,n){this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(e,r){this.xAxis=e,this.yAxis=r}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const e=[];for(const[r,n]of this.chartData.plots.entries())switch(n.type){case"line":{const i=new T6t(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new w6t(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},x(Q2,"BasePlot"),Q2);function d_e(t,e,r){return new C6t(t,e,r)}x(d_e,"getPlotComponent");var J2,k6t=(J2=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:h_e(e,r,n,i),plot:d_e(e,r,n),xAxis:DB(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:DB(r.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},i)}}calculateVerticalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:a,height:s});e-=o.width,r-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=o.height,r-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=o.width,e-=o.width,e>0&&(a+=e,e=0),r>0&&(s+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:s}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+s}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>NB(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=0,s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:s,height:o});e-=l.width,r-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),n=l.height,r-=l.height,this.componentStore.xAxis.setAxisPosition("left"),l=this.componentStore.xAxis.calculateSpace({width:e,height:r}),e-=l.width,i=l.width,this.componentStore.yAxis.setAxisPosition("top"),l=this.componentStore.yAxis.calculateSpace({width:e,height:r}),r-=l.height,a=n+l.height,e>0&&(s+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:o}),this.componentStore.plot.setBoundingBoxXY({x:i,y:a}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([a,a+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(u=>NB(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}},x(J2,"Orchestrator"),J2),eb,S6t=(eb=class{static build(e,r,n,i){return new k6t(e,r,n,i).getDrawableElement()}},x(eb,"XYChartBuilder"),eb),Ak=0,f_e,_k=AU(),Rk=EU(),sn=_U(),OB=Rk.plotColorPalette.split(",").map(t=>t.trim()),D7=!1,SU=!1;function EU(){const t=Dh(),e=Xt();return ri(t.xyChart,e.themeVariables.xyChart)}x(EU,"getChartDefaultThemeConfig");function AU(){const t=Xt();return ri(Vr.xyChart,t.xyChart)}x(AU,"getChartDefaultConfig");function _U(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}x(_U,"getChartDefaultData");function XS(t){const e=Xt();return Wr(t.trim(),e)}x(XS,"textSanitizer");function p_e(t){f_e=t}x(p_e,"setTmpSVGG");function g_e(t){t==="horizontal"?_k.chartOrientation="horizontal":_k.chartOrientation="vertical"}x(g_e,"setOrientation");function m_e(t){sn.xAxis.title=XS(t.text)}x(m_e,"setXAxisTitle");function RU(t,e){sn.xAxis={type:"linear",title:sn.xAxis.title,min:t,max:e},D7=!0}x(RU,"setXAxisRangeData");function y_e(t){sn.xAxis={type:"band",title:sn.xAxis.title,categories:t.map(e=>XS(e.text))},D7=!0}x(y_e,"setXAxisBand");function v_e(t){sn.yAxis.title=XS(t.text)}x(v_e,"setYAxisTitle");function b_e(t,e){sn.yAxis={type:"linear",title:sn.yAxis.title,min:t,max:e},SU=!0}x(b_e,"setYAxisRangeData");function x_e(t){const e=Math.min(...t),r=Math.max(...t),n=_y(sn.yAxis)?sn.yAxis.min:1/0,i=_y(sn.yAxis)?sn.yAxis.max:-1/0;sn.yAxis={type:"linear",title:sn.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}x(x_e,"setYAxisRangeFromPlotData");function LU(t){let e=[];if(t.length===0)return e;if(!D7){const r=_y(sn.xAxis)?sn.xAxis.min:1/0,n=_y(sn.xAxis)?sn.xAxis.max:-1/0;RU(Math.min(r,1),Math.max(n,t.length))}if(T6(sn.xAxis)&&t.length>sn.xAxis.categories.length&&(t=t.slice(0,sn.xAxis.categories.length)),SU||x_e(t),T6(sn.xAxis)&&(e=sn.xAxis.categories.map((r,n)=>[r,t[n]])),_y(sn.xAxis)){const r=sn.xAxis.min,n=sn.xAxis.max;if(t.length===1)e=[[`${r}`,t[0]]];else{const i=(n-r)/(t.length-1);e=t.map((a,s)=>[`${r+s*i}`,a])}}return e}x(LU,"transformDataWithoutCategory");function MU(t){return OB[t===0?0:t%OB.length]}x(MU,"getPlotColorFromPalette");function T_e(t,e){const r=e.map(s=>s.value),n=e.map(s=>s.label?XS(s.label):""),i=LU(r),a=n.some(s=>s!=="");sn.plots.push({type:"line",strokeFill:MU(Ak),strokeWidth:2,data:i,...a?{pointLabels:n}:{}}),Ak++}x(T_e,"setLineData");function w_e(t,e){const r=e.map(i=>i.value),n=LU(r);sn.plots.push({type:"bar",fill:MU(Ak),data:n}),Ak++}x(w_e,"setBarData");function C_e(){if(sn.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return sn.title=Yn(),S6t.build(_k,sn,Rk,f_e)}x(C_e,"getDrawableElem");function k_e(){return Rk}x(k_e,"getChartThemeConfig");function S_e(){return _k}x(S_e,"getChartConfig");function E_e(){return sn}x(E_e,"getXYChartData");var E6t=x(function(){On(),Ak=0,_k=AU(),sn=_U(),Rk=EU(),OB=Rk.plotColorPalette.split(",").map(t=>t.trim()),D7=!1,SU=!1},"clear"),A6t={getDrawableElem:C_e,clear:E6t,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii,setOrientation:g_e,setXAxisTitle:m_e,setXAxisRangeData:RU,setXAxisBand:y_e,setYAxisTitle:v_e,setYAxisRangeData:b_e,setLineData:T_e,setBarData:w_e,setTmpSVGG:p_e,getChartThemeConfig:k_e,getChartConfig:S_e,getXYChartData:E_e},_6t=x((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(v=>v[1]);function l(v){return v==="top"?"text-before-edge":"middle"}x(l,"getDominantBaseLine");function u(v){return v==="left"?"start":v==="right"?"end":"middle"}x(u,"getTextAnchor");function h(v){return`translate(${v.x}, ${v.y}) rotate(${v.rotation||0})`}x(h,"getTextTransformation"),le.debug(`Rendering xychart chart -`+t);const d=xs(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");Ai(d,s.height,s.width,!0),d.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function y(v){let T=f,b="";for(const[w]of v.entries()){let C=f;w>0&&m[b]&&(C=m[b]),b+=v[w],T=m[b],T||(T=m[b]=C.append("g").attr("class",v[w]))}return T}x(y,"getGroup");for(const v of g){if(v.data.length===0)continue;const T=y(v.groupTexts);switch(v.type){case"rect":if(T.selectAll("rect").data(v.data).enter().append("rect").attr("x",b=>b.x).attr("y",b=>b.y).attr("width",b=>b.width).attr("height",b=>b.height).attr("fill",b=>b.fill).attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth),s.showDataLabel){const b=s.showDataLabelOutsideBar;if(s.chartOrientation==="horizontal"){let w=function(L,P){const{data:D,label:R}=L;return P*R.length*C<=D.width-S};x(w,"fitsHorizontally");const C=.7,S=10,k=v.data.map((L,P)=>({data:L,label:o[P].toString()})).filter(L=>L.data.width>0&&L.data.height>0),E=k.map(L=>{const{data:P}=L;let D=P.height*.7;for(;!w(L,D)&&D>0;)D-=1;return D}),_=Math.floor(Math.min(...E)),M=x(L=>b?L.data.x+L.data.width+S:L.data.x+L.data.width-S,"determineLabelXPosition");T.selectAll("text").data(k).enter().append("text").attr("x",M).attr("y",L=>L.data.y+L.data.height/2).attr("text-anchor",b?"start":"end").attr("dominant-baseline","middle").attr("fill",a.dataLabelColor).attr("font-size",`${_}px`).text(L=>L.label)}else{let w=function(M,L,P){const{data:D,label:R}=M,$=L*R.length*.7,O=D.x+D.width/2,N=O-$/2,F=O+$/2,z=N>=D.x&&F<=D.x+D.width,V=D.y+P+L<=D.y+D.height;return z&&V};x(w,"fitsInBar");const C=10,S=v.data.map((M,L)=>({data:M,label:o[L].toString()})).filter(M=>M.data.width>0&&M.data.height>0),k=S.map(M=>{const{data:L,label:P}=M;let D=L.width/(P.length*.7);for(;!w(M,D,C)&&D>0;)D-=1;return D}),E=Math.floor(Math.min(...k)),_=x(M=>b?M.data.y-C:M.data.y+C,"determineLabelYPosition");T.selectAll("text").data(S).enter().append("text").attr("x",M=>M.data.x+M.data.width/2).attr("y",_).attr("text-anchor","middle").attr("dominant-baseline",b?"auto":"hanging").attr("fill",a.dataLabelColor).attr("font-size",`${E}px`).text(M=>M.label)}}break;case"text":T.selectAll("text").data(v.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",b=>b.fill).attr("font-size",b=>b.fontSize).attr("dominant-baseline",b=>l(b.verticalPos)).attr("text-anchor",b=>u(b.horizontalPos)).attr("transform",b=>h(b)).text(b=>b.text);break;case"path":T.selectAll("path").data(v.data).enter().append("path").attr("d",b=>b.path).attr("fill",b=>b.fill?b.fill:"none").attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth);break}}},"draw"),R6t={draw:_6t},L6t={parser:y6t,db:A6t,renderer:R6t};const M6t=Object.freeze(Object.defineProperty({__proto__:null,diagram:L6t},Symbol.toStringTag,{value:"Module"}));var $B=(function(){var t=x(function(ae,he,W,ne){for(W=W||{},ne=ae.length;ne--;W[ae[ne]]=he);return W},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],o=[2,7],l=[1,26],u=[1,27],h=[1,28],d=[1,29],f=[1,33],p=[1,34],g=[1,35],m=[1,36],y=[1,37],v=[1,38],T=[1,24],b=[1,31],w=[1,32],C=[1,30],S=[1,39],k=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],_=[1,61],M=[89,90],L=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],P=[27,29],D=[1,70],R=[1,71],I=[1,72],$=[1,73],O=[1,74],N=[1,75],F=[1,76],z=[1,83],V=[1,80],B=[1,84],G=[1,85],H=[1,86],q=[1,87],Z=[1,88],Y=[1,89],ie=[1,90],K=[1,91],Q=[1,92],te=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],J=[63,64],ge=[1,101],ee=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],Re=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ie=[1,110],Be=[1,106],ce=[1,107],oe=[1,108],be=[1,109],fe=[1,111],Pe=[1,116],ve=[1,117],Ce=[1,114],Ve=[1,115],se={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:x(function(he,W,ne,j,ue,X,Oe){var xe=X.length-1;switch(ue){case 4:this.$=X[xe].trim(),j.setAccTitle(this.$);break;case 5:case 6:this.$=X[xe].trim(),j.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:j.setDirection("TB");break;case 18:j.setDirection("BT");break;case 19:j.setDirection("RL");break;case 20:j.setDirection("LR");break;case 21:j.addRequirement(X[xe-3],X[xe-4]);break;case 22:j.addRequirement(X[xe-5],X[xe-6]),j.setClass([X[xe-5]],X[xe-3]);break;case 23:j.setNewReqId(X[xe-2]);break;case 24:j.setNewReqText(X[xe-2]);break;case 25:j.setNewReqRisk(X[xe-2]);break;case 26:j.setNewReqVerifyMethod(X[xe-2]);break;case 29:this.$=j.RequirementType.REQUIREMENT;break;case 30:this.$=j.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=j.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=j.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=j.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=j.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=j.RiskLevel.LOW_RISK;break;case 36:this.$=j.RiskLevel.MED_RISK;break;case 37:this.$=j.RiskLevel.HIGH_RISK;break;case 38:this.$=j.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=j.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=j.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=j.VerifyType.VERIFY_TEST;break;case 42:j.addElement(X[xe-3]);break;case 43:j.addElement(X[xe-5]),j.setClass([X[xe-5]],X[xe-3]);break;case 44:j.setNewElementType(X[xe-2]);break;case 45:j.setNewElementDocRef(X[xe-2]);break;case 48:j.addRelationship(X[xe-2],X[xe],X[xe-4]);break;case 49:j.addRelationship(X[xe-2],X[xe-4],X[xe]);break;case 50:this.$=j.Relationships.CONTAINS;break;case 51:this.$=j.Relationships.COPIES;break;case 52:this.$=j.Relationships.DERIVES;break;case 53:this.$=j.Relationships.SATISFIES;break;case 54:this.$=j.Relationships.VERIFIES;break;case 55:this.$=j.Relationships.REFINES;break;case 56:this.$=j.Relationships.TRACES;break;case 57:this.$=X[xe-2],j.defineClass(X[xe-1],X[xe]);break;case 58:j.setClass(X[xe-1],X[xe]);break;case 59:j.setClass([X[xe-2]],X[xe]);break;case 60:case 62:this.$=[X[xe]];break;case 61:case 63:this.$=X[xe-2].concat([X[xe]]);break;case 64:this.$=X[xe-2],j.setCssStyle(X[xe-1],X[xe]);break;case 65:this.$=[X[xe]];break;case 66:X[xe-2].push(X[xe]),this.$=X[xe-2];break;case 68:this.$=X[xe-1]+X[xe];break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:43,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:44,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:45,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:46,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:47,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:48,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:49,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:50,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(E,[2,17]),t(E,[2,18]),t(E,[2,19]),t(E,[2,20]),{30:60,33:62,75:_,89:S,90:k},{30:63,33:62,75:_,89:S,90:k},{30:64,33:62,75:_,89:S,90:k},t(M,[2,29]),t(M,[2,30]),t(M,[2,31]),t(M,[2,32]),t(M,[2,33]),t(M,[2,34]),t(L,[2,81]),t(L,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(P,[2,79]),t(P,[2,80]),{27:[1,67],29:[1,68]},t(P,[2,85]),t(P,[2,86]),{62:69,65:D,66:R,67:I,68:$,69:O,70:N,71:F},{62:77,65:D,66:R,67:I,68:$,69:O,70:N,71:F},{30:78,33:62,75:_,89:S,90:k},{73:79,75:z,76:V,78:81,79:82,80:B,81:G,82:H,83:q,84:Z,85:Y,86:ie,87:K,88:Q},t(te,[2,60]),t(te,[2,62]),{73:93,75:z,76:V,78:81,79:82,80:B,81:G,82:H,83:q,84:Z,85:Y,86:ie,87:K,88:Q},{30:94,33:62,75:_,76:V,89:S,90:k},{5:[1,95]},{30:96,33:62,75:_,89:S,90:k},{5:[1,97]},{30:98,33:62,75:_,89:S,90:k},{63:[1,99]},t(J,[2,50]),t(J,[2,51]),t(J,[2,52]),t(J,[2,53]),t(J,[2,54]),t(J,[2,55]),t(J,[2,56]),{64:[1,100]},t(E,[2,59],{76:V}),t(E,[2,64],{76:ge}),{33:103,75:[1,102],89:S,90:k},t(ee,[2,65],{79:104,75:z,80:B,81:G,82:H,83:q,84:Z,85:Y,86:ie,87:K,88:Q}),t(Re,[2,67]),t(Re,[2,69]),t(Re,[2,70]),t(Re,[2,71]),t(Re,[2,72]),t(Re,[2,73]),t(Re,[2,74]),t(Re,[2,75]),t(Re,[2,76]),t(Re,[2,77]),t(Re,[2,78]),t(E,[2,57],{76:ge}),t(E,[2,58],{76:V}),{5:Ie,28:105,31:Be,34:ce,36:oe,38:be,40:fe},{27:[1,112],76:V},{5:Pe,40:ve,56:113,57:Ce,59:Ve},{27:[1,118],76:V},{33:119,89:S,90:k},{33:120,89:S,90:k},{75:z,78:121,79:82,80:B,81:G,82:H,83:q,84:Z,85:Y,86:ie,87:K,88:Q},t(te,[2,61]),t(te,[2,63]),t(Re,[2,68]),t(E,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Ie,28:126,31:Be,34:ce,36:oe,38:be,40:fe},t(E,[2,28]),{5:[1,127]},t(E,[2,42]),{32:[1,128]},{32:[1,129]},{5:Pe,40:ve,56:130,57:Ce,59:Ve},t(E,[2,47]),{5:[1,131]},t(E,[2,48]),t(E,[2,49]),t(ee,[2,66],{79:104,75:z,80:B,81:G,82:H,83:q,84:Z,85:Y,86:ie,87:K,88:Q}),{33:132,89:S,90:k},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(E,[2,27]),{5:Ie,28:145,31:Be,34:ce,36:oe,38:be,40:fe},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(E,[2,46]),{5:Pe,40:ve,56:152,57:Ce,59:Ve},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(E,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(E,[2,43]),{5:Ie,28:159,31:Be,34:ce,36:oe,38:be,40:fe},{5:Ie,28:160,31:Be,34:ce,36:oe,38:be,40:fe},{5:Ie,28:161,31:Be,34:ce,36:oe,38:be,40:fe},{5:Ie,28:162,31:Be,34:ce,36:oe,38:be,40:fe},{5:Pe,40:ve,56:163,57:Ce,59:Ve},{5:Pe,40:ve,56:164,57:Ce,59:Ve},t(E,[2,23]),t(E,[2,24]),t(E,[2,25]),t(E,[2,26]),t(E,[2,44]),t(E,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:x(function(he,W){if(W.recoverable)this.trace(he);else{var ne=new Error(he);throw ne.hash=W,ne}},"parseError"),parse:x(function(he){var W=this,ne=[0],j=[],ue=[null],X=[],Oe=this.table,xe="",Ge=0,_e=0,$e=2,Me=1,He=X.slice.call(arguments,1),De=Object.create(this.lexer),Ke={yy:{}};for(var Ae in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ae)&&(Ke.yy[Ae]=this.yy[Ae]);De.setInput(he,Ke.yy),Ke.yy.lexer=De,Ke.yy.parser=this,typeof De.yylloc>"u"&&(De.yylloc={});var at=De.yylloc;X.push(at);var Ee=De.options&&De.options.ranges;typeof Ke.yy.parseError=="function"?this.parseError=Ke.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(Se){ne.length=ne.length-2*Se,ue.length=ue.length-Se,X.length=X.length-Se}x(pt,"popStack");function ht(){var Se;return Se=j.pop()||De.lex()||Me,typeof Se!="number"&&(Se instanceof Array&&(j=Se,Se=j.pop()),Se=W.symbols_[Se]||Se),Se}x(ht,"lex");for(var rt,Et,vt,ot,pe={},Ct,lt,st,mt;;){if(Et=ne[ne.length-1],this.defaultActions[Et]?vt=this.defaultActions[Et]:((rt===null||typeof rt>"u")&&(rt=ht()),vt=Oe[Et]&&Oe[Et][rt]),typeof vt>"u"||!vt.length||!vt[0]){var _r="";mt=[];for(Ct in Oe[Et])this.terminals_[Ct]&&Ct>$e&&mt.push("'"+this.terminals_[Ct]+"'");De.showPosition?_r="Parse error on line "+(Ge+1)+`: +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var N=this.next();return N||this.lex()},"lex"),begin:x(function(N){this.conditionStack.push(N)},"begin"),popState:x(function(){var N=this.conditionStack.length-1;return N>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(N){return N=this.conditionStack.length-1-Math.abs(N||0),N>=0?this.conditionStack[N]:"INITIAL"},"topState"),pushState:x(function(N){this.begin(N)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(N,F,z,V){switch(z){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return $})();D.lexer=R;function I(){this.yy={}}return x(I,"Parser"),I.prototype=D,D.Parser=I,new I})();IB.parser=IB;var x6t=IB;function NB(t){return t.type==="bar"}x(NB,"isBarPlot");function T6(t){return t.type==="band"}x(T6,"isBandAxisData");function _y(t){return t.type==="linear"}x(_y,"isLinearAxisData");var q2,u_e=(q2=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((a,s)=>Math.max(s.length,a),0)*r,height:r};const n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(const a of e){const s=ofe(i,1,a),o=s?s.width:a.length*r,l=s?s.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},x(q2,"TextDimensionCalculatorWithFont"),q2),gie=.7,mie=.2,U2,h_e=(U2=class{constructor(e,r,n,i){this.axisConfig=e,this.title=r,this.textDimensionCalculator=n,this.axisThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){gie*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(gie*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let r=e.height;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=mie*e.width;this.outerPadding=Math.min(n.width/2,i);let a=n.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),a+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-r}calculateSpaceIfDrawnVertical(e){let r=e.width;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=mie*e.height;this.outerPadding=Math.min(n.height/2,i);const a=n.width+this.axisConfig.labelPadding*2;a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){const r=this.normalizedLabelRotationInRad;return r===0?0:Math.sin(r)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},x(U2,"BaseAxis"),U2),Y2,T6t=(Y2=class extends h_e{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=uO().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=uO().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),le.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},x(Y2,"BandAxis"),Y2),X2,w6t=(X2=class extends h_e{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=Sb().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=Sb().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},x(X2,"LinearAxis"),X2);function DB(t,e,r,n){const i=new u_e(n);return T6(t)?new T6t(e,r,t.categories,t.title,i):new w6t(e,r,[t.min,t.max],t.title,i)}x(DB,"getAxis");var j2,C6t=(j2=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}},x(j2,"ChartTitle"),j2);function d_e(t,e,r,n){const i=new u_e(n);return new C6t(i,t,e,r)}x(d_e,"getChartTitleComponent");var K2,k6t=(K2=class{constructor(e,r,n,i,a){this.plotData=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}getDrawableElement(){const e=this.plotData.data.map(i=>[this.xAxis.getScaleValue(i[0]),this.yAxis.getScaleValue(i[1])]);let r;if(this.orientation==="horizontal"?r=NC().y(i=>i[0]).x(i=>i[1])(e):r=NC().x(i=>i[0]).y(i=>i[1])(e),!r)return[];const n=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const s=[];for(const[o,[l,u]]of e.entries()){const h=this.plotData.pointLabels[o];h&&(this.orientation==="horizontal"?s.push({x:u+10,y:l,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):s.push({x:l,y:u-10,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}s.length>0&&n.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:s})}return n}},x(K2,"LinePlot"),K2),Z2,S6t=(Z2=class{constructor(e,r,n,i,a,s){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=a,this.plotIndex=s}getDrawableElement(){const e=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:this.boundingRect.x,y:a[0]-i,height:n,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:a[0]-i,y:a[1],width:n,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},x(Z2,"BarPlot"),Z2),Q2,E6t=(Q2=class{constructor(e,r,n){this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(e,r){this.xAxis=e,this.yAxis=r}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const e=[];for(const[r,n]of this.chartData.plots.entries())switch(n.type){case"line":{const i=new k6t(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new S6t(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},x(Q2,"BasePlot"),Q2);function f_e(t,e,r){return new E6t(t,e,r)}x(f_e,"getPlotComponent");var J2,A6t=(J2=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:d_e(e,r,n,i),plot:f_e(e,r,n),xAxis:DB(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:DB(r.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},i)}}calculateVerticalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:a,height:s});e-=o.width,r-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=o.height,r-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=o.width,e-=o.width,e>0&&(a+=e,e=0),r>0&&(s+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:s}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+s}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>NB(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=0,s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:s,height:o});e-=l.width,r-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),n=l.height,r-=l.height,this.componentStore.xAxis.setAxisPosition("left"),l=this.componentStore.xAxis.calculateSpace({width:e,height:r}),e-=l.width,i=l.width,this.componentStore.yAxis.setAxisPosition("top"),l=this.componentStore.yAxis.calculateSpace({width:e,height:r}),r-=l.height,a=n+l.height,e>0&&(s+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:o}),this.componentStore.plot.setBoundingBoxXY({x:i,y:a}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([a,a+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(u=>NB(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}},x(J2,"Orchestrator"),J2),eb,_6t=(eb=class{static build(e,r,n,i){return new A6t(e,r,n,i).getDrawableElement()}},x(eb,"XYChartBuilder"),eb),Ak=0,p_e,_k=AU(),Rk=EU(),sn=_U(),OB=Rk.plotColorPalette.split(",").map(t=>t.trim()),D7=!1,SU=!1;function EU(){const t=Dh(),e=Xt();return ri(t.xyChart,e.themeVariables.xyChart)}x(EU,"getChartDefaultThemeConfig");function AU(){const t=Xt();return ri(Vr.xyChart,t.xyChart)}x(AU,"getChartDefaultConfig");function _U(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}x(_U,"getChartDefaultData");function XS(t){const e=Xt();return Wr(t.trim(),e)}x(XS,"textSanitizer");function g_e(t){p_e=t}x(g_e,"setTmpSVGG");function m_e(t){t==="horizontal"?_k.chartOrientation="horizontal":_k.chartOrientation="vertical"}x(m_e,"setOrientation");function y_e(t){sn.xAxis.title=XS(t.text)}x(y_e,"setXAxisTitle");function RU(t,e){sn.xAxis={type:"linear",title:sn.xAxis.title,min:t,max:e},D7=!0}x(RU,"setXAxisRangeData");function v_e(t){sn.xAxis={type:"band",title:sn.xAxis.title,categories:t.map(e=>XS(e.text))},D7=!0}x(v_e,"setXAxisBand");function b_e(t){sn.yAxis.title=XS(t.text)}x(b_e,"setYAxisTitle");function x_e(t,e){sn.yAxis={type:"linear",title:sn.yAxis.title,min:t,max:e},SU=!0}x(x_e,"setYAxisRangeData");function T_e(t){const e=Math.min(...t),r=Math.max(...t),n=_y(sn.yAxis)?sn.yAxis.min:1/0,i=_y(sn.yAxis)?sn.yAxis.max:-1/0;sn.yAxis={type:"linear",title:sn.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}x(T_e,"setYAxisRangeFromPlotData");function LU(t){let e=[];if(t.length===0)return e;if(!D7){const r=_y(sn.xAxis)?sn.xAxis.min:1/0,n=_y(sn.xAxis)?sn.xAxis.max:-1/0;RU(Math.min(r,1),Math.max(n,t.length))}if(T6(sn.xAxis)&&t.length>sn.xAxis.categories.length&&(t=t.slice(0,sn.xAxis.categories.length)),SU||T_e(t),T6(sn.xAxis)&&(e=sn.xAxis.categories.map((r,n)=>[r,t[n]])),_y(sn.xAxis)){const r=sn.xAxis.min,n=sn.xAxis.max;if(t.length===1)e=[[`${r}`,t[0]]];else{const i=(n-r)/(t.length-1);e=t.map((a,s)=>[`${r+s*i}`,a])}}return e}x(LU,"transformDataWithoutCategory");function MU(t){return OB[t===0?0:t%OB.length]}x(MU,"getPlotColorFromPalette");function w_e(t,e){const r=e.map(s=>s.value),n=e.map(s=>s.label?XS(s.label):""),i=LU(r),a=n.some(s=>s!=="");sn.plots.push({type:"line",strokeFill:MU(Ak),strokeWidth:2,data:i,...a?{pointLabels:n}:{}}),Ak++}x(w_e,"setLineData");function C_e(t,e){const r=e.map(i=>i.value),n=LU(r);sn.plots.push({type:"bar",fill:MU(Ak),data:n}),Ak++}x(C_e,"setBarData");function k_e(){if(sn.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return sn.title=Yn(),_6t.build(_k,sn,Rk,p_e)}x(k_e,"getDrawableElem");function S_e(){return Rk}x(S_e,"getChartThemeConfig");function E_e(){return _k}x(E_e,"getChartConfig");function A_e(){return sn}x(A_e,"getXYChartData");var R6t=x(function(){$n(),Ak=0,_k=AU(),sn=_U(),Rk=EU(),OB=Rk.plotColorPalette.split(",").map(t=>t.trim()),D7=!1,SU=!1},"clear"),L6t={getDrawableElem:k_e,clear:R6t,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii,setOrientation:m_e,setXAxisTitle:y_e,setXAxisRangeData:RU,setXAxisBand:v_e,setYAxisTitle:b_e,setYAxisRangeData:x_e,setLineData:w_e,setBarData:C_e,setTmpSVGG:g_e,getChartThemeConfig:S_e,getChartConfig:E_e,getXYChartData:A_e},M6t=x((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(v=>v[1]);function l(v){return v==="top"?"text-before-edge":"middle"}x(l,"getDominantBaseLine");function u(v){return v==="left"?"start":v==="right"?"end":"middle"}x(u,"getTextAnchor");function h(v){return`translate(${v.x}, ${v.y}) rotate(${v.rotation||0})`}x(h,"getTextTransformation"),le.debug(`Rendering xychart chart +`+t);const d=xs(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");Ai(d,s.height,s.width,!0),d.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function y(v){let T=f,b="";for(const[w]of v.entries()){let C=f;w>0&&m[b]&&(C=m[b]),b+=v[w],T=m[b],T||(T=m[b]=C.append("g").attr("class",v[w]))}return T}x(y,"getGroup");for(const v of g){if(v.data.length===0)continue;const T=y(v.groupTexts);switch(v.type){case"rect":if(T.selectAll("rect").data(v.data).enter().append("rect").attr("x",b=>b.x).attr("y",b=>b.y).attr("width",b=>b.width).attr("height",b=>b.height).attr("fill",b=>b.fill).attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth),s.showDataLabel){const b=s.showDataLabelOutsideBar;if(s.chartOrientation==="horizontal"){let w=function(L,P){const{data:D,label:R}=L;return P*R.length*C<=D.width-S};x(w,"fitsHorizontally");const C=.7,S=10,k=v.data.map((L,P)=>({data:L,label:o[P].toString()})).filter(L=>L.data.width>0&&L.data.height>0),E=k.map(L=>{const{data:P}=L;let D=P.height*.7;for(;!w(L,D)&&D>0;)D-=1;return D}),_=Math.floor(Math.min(...E)),M=x(L=>b?L.data.x+L.data.width+S:L.data.x+L.data.width-S,"determineLabelXPosition");T.selectAll("text").data(k).enter().append("text").attr("x",M).attr("y",L=>L.data.y+L.data.height/2).attr("text-anchor",b?"start":"end").attr("dominant-baseline","middle").attr("fill",a.dataLabelColor).attr("font-size",`${_}px`).text(L=>L.label)}else{let w=function(M,L,P){const{data:D,label:R}=M,$=L*R.length*.7,O=D.x+D.width/2,N=O-$/2,F=O+$/2,z=N>=D.x&&F<=D.x+D.width,V=D.y+P+L<=D.y+D.height;return z&&V};x(w,"fitsInBar");const C=10,S=v.data.map((M,L)=>({data:M,label:o[L].toString()})).filter(M=>M.data.width>0&&M.data.height>0),k=S.map(M=>{const{data:L,label:P}=M;let D=L.width/(P.length*.7);for(;!w(M,D,C)&&D>0;)D-=1;return D}),E=Math.floor(Math.min(...k)),_=x(M=>b?M.data.y-C:M.data.y+C,"determineLabelYPosition");T.selectAll("text").data(S).enter().append("text").attr("x",M=>M.data.x+M.data.width/2).attr("y",_).attr("text-anchor","middle").attr("dominant-baseline",b?"auto":"hanging").attr("fill",a.dataLabelColor).attr("font-size",`${E}px`).text(M=>M.label)}}break;case"text":T.selectAll("text").data(v.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",b=>b.fill).attr("font-size",b=>b.fontSize).attr("dominant-baseline",b=>l(b.verticalPos)).attr("text-anchor",b=>u(b.horizontalPos)).attr("transform",b=>h(b)).text(b=>b.text);break;case"path":T.selectAll("path").data(v.data).enter().append("path").attr("d",b=>b.path).attr("fill",b=>b.fill?b.fill:"none").attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth);break}}},"draw"),I6t={draw:M6t},N6t={parser:x6t,db:L6t,renderer:I6t};const D6t=Object.freeze(Object.defineProperty({__proto__:null,diagram:N6t},Symbol.toStringTag,{value:"Module"}));var $B=(function(){var t=x(function(ae,he,W,ne){for(W=W||{},ne=ae.length;ne--;W[ae[ne]]=he);return W},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],o=[2,7],l=[1,26],u=[1,27],h=[1,28],d=[1,29],f=[1,33],p=[1,34],g=[1,35],m=[1,36],y=[1,37],v=[1,38],T=[1,24],b=[1,31],w=[1,32],C=[1,30],S=[1,39],k=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],_=[1,61],M=[89,90],L=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],P=[27,29],D=[1,70],R=[1,71],I=[1,72],$=[1,73],O=[1,74],N=[1,75],F=[1,76],z=[1,83],V=[1,80],B=[1,84],G=[1,85],H=[1,86],q=[1,87],Z=[1,88],Y=[1,89],ie=[1,90],K=[1,91],Q=[1,92],te=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],J=[63,64],ge=[1,101],ee=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],Re=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ie=[1,110],Be=[1,106],ce=[1,107],oe=[1,108],be=[1,109],fe=[1,111],Pe=[1,116],ve=[1,117],Ce=[1,114],Ve=[1,115],se={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:x(function(he,W,ne,j,ue,X,Oe){var xe=X.length-1;switch(ue){case 4:this.$=X[xe].trim(),j.setAccTitle(this.$);break;case 5:case 6:this.$=X[xe].trim(),j.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:j.setDirection("TB");break;case 18:j.setDirection("BT");break;case 19:j.setDirection("RL");break;case 20:j.setDirection("LR");break;case 21:j.addRequirement(X[xe-3],X[xe-4]);break;case 22:j.addRequirement(X[xe-5],X[xe-6]),j.setClass([X[xe-5]],X[xe-3]);break;case 23:j.setNewReqId(X[xe-2]);break;case 24:j.setNewReqText(X[xe-2]);break;case 25:j.setNewReqRisk(X[xe-2]);break;case 26:j.setNewReqVerifyMethod(X[xe-2]);break;case 29:this.$=j.RequirementType.REQUIREMENT;break;case 30:this.$=j.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=j.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=j.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=j.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=j.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=j.RiskLevel.LOW_RISK;break;case 36:this.$=j.RiskLevel.MED_RISK;break;case 37:this.$=j.RiskLevel.HIGH_RISK;break;case 38:this.$=j.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=j.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=j.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=j.VerifyType.VERIFY_TEST;break;case 42:j.addElement(X[xe-3]);break;case 43:j.addElement(X[xe-5]),j.setClass([X[xe-5]],X[xe-3]);break;case 44:j.setNewElementType(X[xe-2]);break;case 45:j.setNewElementDocRef(X[xe-2]);break;case 48:j.addRelationship(X[xe-2],X[xe],X[xe-4]);break;case 49:j.addRelationship(X[xe-2],X[xe-4],X[xe]);break;case 50:this.$=j.Relationships.CONTAINS;break;case 51:this.$=j.Relationships.COPIES;break;case 52:this.$=j.Relationships.DERIVES;break;case 53:this.$=j.Relationships.SATISFIES;break;case 54:this.$=j.Relationships.VERIFIES;break;case 55:this.$=j.Relationships.REFINES;break;case 56:this.$=j.Relationships.TRACES;break;case 57:this.$=X[xe-2],j.defineClass(X[xe-1],X[xe]);break;case 58:j.setClass(X[xe-1],X[xe]);break;case 59:j.setClass([X[xe-2]],X[xe]);break;case 60:case 62:this.$=[X[xe]];break;case 61:case 63:this.$=X[xe-2].concat([X[xe]]);break;case 64:this.$=X[xe-2],j.setCssStyle(X[xe-1],X[xe]);break;case 65:this.$=[X[xe]];break;case 66:X[xe-2].push(X[xe]),this.$=X[xe-2];break;case 68:this.$=X[xe-1]+X[xe];break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:43,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:44,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:45,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:46,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:47,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:48,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:49,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:50,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(E,[2,17]),t(E,[2,18]),t(E,[2,19]),t(E,[2,20]),{30:60,33:62,75:_,89:S,90:k},{30:63,33:62,75:_,89:S,90:k},{30:64,33:62,75:_,89:S,90:k},t(M,[2,29]),t(M,[2,30]),t(M,[2,31]),t(M,[2,32]),t(M,[2,33]),t(M,[2,34]),t(L,[2,81]),t(L,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(P,[2,79]),t(P,[2,80]),{27:[1,67],29:[1,68]},t(P,[2,85]),t(P,[2,86]),{62:69,65:D,66:R,67:I,68:$,69:O,70:N,71:F},{62:77,65:D,66:R,67:I,68:$,69:O,70:N,71:F},{30:78,33:62,75:_,89:S,90:k},{73:79,75:z,76:V,78:81,79:82,80:B,81:G,82:H,83:q,84:Z,85:Y,86:ie,87:K,88:Q},t(te,[2,60]),t(te,[2,62]),{73:93,75:z,76:V,78:81,79:82,80:B,81:G,82:H,83:q,84:Z,85:Y,86:ie,87:K,88:Q},{30:94,33:62,75:_,76:V,89:S,90:k},{5:[1,95]},{30:96,33:62,75:_,89:S,90:k},{5:[1,97]},{30:98,33:62,75:_,89:S,90:k},{63:[1,99]},t(J,[2,50]),t(J,[2,51]),t(J,[2,52]),t(J,[2,53]),t(J,[2,54]),t(J,[2,55]),t(J,[2,56]),{64:[1,100]},t(E,[2,59],{76:V}),t(E,[2,64],{76:ge}),{33:103,75:[1,102],89:S,90:k},t(ee,[2,65],{79:104,75:z,80:B,81:G,82:H,83:q,84:Z,85:Y,86:ie,87:K,88:Q}),t(Re,[2,67]),t(Re,[2,69]),t(Re,[2,70]),t(Re,[2,71]),t(Re,[2,72]),t(Re,[2,73]),t(Re,[2,74]),t(Re,[2,75]),t(Re,[2,76]),t(Re,[2,77]),t(Re,[2,78]),t(E,[2,57],{76:ge}),t(E,[2,58],{76:V}),{5:Ie,28:105,31:Be,34:ce,36:oe,38:be,40:fe},{27:[1,112],76:V},{5:Pe,40:ve,56:113,57:Ce,59:Ve},{27:[1,118],76:V},{33:119,89:S,90:k},{33:120,89:S,90:k},{75:z,78:121,79:82,80:B,81:G,82:H,83:q,84:Z,85:Y,86:ie,87:K,88:Q},t(te,[2,61]),t(te,[2,63]),t(Re,[2,68]),t(E,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Ie,28:126,31:Be,34:ce,36:oe,38:be,40:fe},t(E,[2,28]),{5:[1,127]},t(E,[2,42]),{32:[1,128]},{32:[1,129]},{5:Pe,40:ve,56:130,57:Ce,59:Ve},t(E,[2,47]),{5:[1,131]},t(E,[2,48]),t(E,[2,49]),t(ee,[2,66],{79:104,75:z,80:B,81:G,82:H,83:q,84:Z,85:Y,86:ie,87:K,88:Q}),{33:132,89:S,90:k},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(E,[2,27]),{5:Ie,28:145,31:Be,34:ce,36:oe,38:be,40:fe},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(E,[2,46]),{5:Pe,40:ve,56:152,57:Ce,59:Ve},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(E,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(E,[2,43]),{5:Ie,28:159,31:Be,34:ce,36:oe,38:be,40:fe},{5:Ie,28:160,31:Be,34:ce,36:oe,38:be,40:fe},{5:Ie,28:161,31:Be,34:ce,36:oe,38:be,40:fe},{5:Ie,28:162,31:Be,34:ce,36:oe,38:be,40:fe},{5:Pe,40:ve,56:163,57:Ce,59:Ve},{5:Pe,40:ve,56:164,57:Ce,59:Ve},t(E,[2,23]),t(E,[2,24]),t(E,[2,25]),t(E,[2,26]),t(E,[2,44]),t(E,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:x(function(he,W){if(W.recoverable)this.trace(he);else{var ne=new Error(he);throw ne.hash=W,ne}},"parseError"),parse:x(function(he){var W=this,ne=[0],j=[],ue=[null],X=[],Oe=this.table,xe="",Ge=0,_e=0,$e=2,Me=1,He=X.slice.call(arguments,1),De=Object.create(this.lexer),Ke={yy:{}};for(var Ae in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ae)&&(Ke.yy[Ae]=this.yy[Ae]);De.setInput(he,Ke.yy),Ke.yy.lexer=De,Ke.yy.parser=this,typeof De.yylloc>"u"&&(De.yylloc={});var at=De.yylloc;X.push(at);var Ee=De.options&&De.options.ranges;typeof Ke.yy.parseError=="function"?this.parseError=Ke.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(Se){ne.length=ne.length-2*Se,ue.length=ue.length-Se,X.length=X.length-Se}x(pt,"popStack");function ht(){var Se;return Se=j.pop()||De.lex()||Me,typeof Se!="number"&&(Se instanceof Array&&(j=Se,Se=j.pop()),Se=W.symbols_[Se]||Se),Se}x(ht,"lex");for(var rt,Et,vt,ot,pe={},Ct,lt,st,mt;;){if(Et=ne[ne.length-1],this.defaultActions[Et]?vt=this.defaultActions[Et]:((rt===null||typeof rt>"u")&&(rt=ht()),vt=Oe[Et]&&Oe[Et][rt]),typeof vt>"u"||!vt.length||!vt[0]){var _r="";mt=[];for(Ct in Oe[Et])this.terminals_[Ct]&&Ct>$e&&mt.push("'"+this.terminals_[Ct]+"'");De.showPosition?_r="Parse error on line "+(Ge+1)+`: `+De.showPosition()+` Expecting `+mt.join(", ")+", got '"+(this.terminals_[rt]||rt)+"'":_r="Parse error on line "+(Ge+1)+": Unexpected "+(rt==Me?"end of input":"'"+(this.terminals_[rt]||rt)+"'"),this.parseError(_r,{text:De.match,token:this.terminals_[rt]||rt,line:De.yylineno,loc:at,expected:mt})}if(vt[0]instanceof Array&&vt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Et+", token: "+rt);switch(vt[0]){case 1:ne.push(rt),ue.push(De.yytext),X.push(De.yylloc),ne.push(vt[1]),rt=null,_e=De.yyleng,xe=De.yytext,Ge=De.yylineno,at=De.yylloc;break;case 2:if(lt=this.productions_[vt[1]][1],pe.$=ue[ue.length-lt],pe._$={first_line:X[X.length-(lt||1)].first_line,last_line:X[X.length-1].last_line,first_column:X[X.length-(lt||1)].first_column,last_column:X[X.length-1].last_column},Ee&&(pe._$.range=[X[X.length-(lt||1)].range[0],X[X.length-1].range[1]]),ot=this.performAction.apply(pe,[xe,_e,Ge,Ke.yy,vt[1],ue,X].concat(He)),typeof ot<"u")return ot;lt&&(ne=ne.slice(0,-1*lt*2),ue=ue.slice(0,-1*lt),X=X.slice(0,-1*lt)),ne.push(this.productions_[vt[1]][0]),ue.push(pe.$),X.push(pe._$),st=Oe[ne[ne.length-2]][ne[ne.length-1]],ne.push(st);break;case 3:return!0}}return!0},"parse")},de=(function(){var ae={EOF:1,parseError:x(function(W,ne){if(this.yy.parser)this.yy.parser.parseError(W,ne);else throw new Error(W)},"parseError"),setInput:x(function(he,W){return this.yy=W||this.yy||{},this._input=he,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var he=this._input[0];this.yytext+=he,this.yyleng++,this.offset++,this.match+=he,this.matched+=he;var W=he.match(/(?:\r\n?|\n).*/g);return W?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),he},"input"),unput:x(function(he){var W=he.length,ne=he.split(/(?:\r\n?|\n)/g);this._input=he+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-W),this.offset-=W;var j=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),ne.length-1&&(this.yylineno-=ne.length-1);var ue=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ne?(ne.length===j.length?this.yylloc.first_column:0)+j[j.length-ne.length].length-ne[0].length:this.yylloc.first_column-W},this.options.ranges&&(this.yylloc.range=[ue[0],ue[0]+this.yyleng-W]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(he){this.unput(this.match.slice(he))},"less"),pastInput:x(function(){var he=this.matched.substr(0,this.matched.length-this.match.length);return(he.length>20?"...":"")+he.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var he=this.match;return he.length<20&&(he+=this._input.substr(0,20-he.length)),(he.substr(0,20)+(he.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var he=this.pastInput(),W=new Array(he.length+1).join("-");return he+this.upcomingInput()+` `+W+"^"},"showPosition"),test_match:x(function(he,W){var ne,j,ue;if(this.options.backtrack_lexer&&(ue={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(ue.yylloc.range=this.yylloc.range.slice(0))),j=he[0].match(/(?:\r\n?|\n).*/g),j&&(this.yylineno+=j.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:j?j[j.length-1].length-j[j.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+he[0].length},this.yytext+=he[0],this.match+=he[0],this.matches=he,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(he[0].length),this.matched+=he[0],ne=this.performAction.call(this,this.yy,this,W,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ne)return ne;if(this._backtrack){for(var X in ue)this[X]=ue[X];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var he,W,ne,j;this._more||(this.yytext="",this.match="");for(var ue=this._currentRules(),X=0;XW[0].length)){if(W=ne,j=X,this.options.backtrack_lexer){if(he=this.test_match(ne,ue[X]),he!==!1)return he;if(this._backtrack){W=!1;continue}else return!1}else if(!this.options.flex)break}return W?(he=this.test_match(W,ue[j]),he!==!1?he:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var W=this.next();return W||this.lex()},"lex"),begin:x(function(W){this.conditionStack.push(W)},"begin"),popState:x(function(){var W=this.conditionStack.length-1;return W>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(W){return W=this.conditionStack.length-1-Math.abs(W||0),W>=0?this.conditionStack[W]:"INITIAL"},"topState"),pushState:x(function(W){this.begin(W)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(W,ne,j,ue){switch(j){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return ne.yytext=ne.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return ae})();se.lexer=de;function Te(){this.yy={}}return x(Te,"Parser"),Te.prototype=se,se.Parser=Te,new Te})();$B.parser=$B;var I6t=$B,tb,N6t=(tb=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Hn,this.getAccTitle=ni,this.setAccDescription=ii,this.getAccDescription=ai,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getConfig=x(()=>Fe().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,r){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:r,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),le.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,r,n){this.relations.push({type:e,src:r,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,On()}setCssStyle(e,r){for(const n of e){const i=this.requirements.get(n)??this.elements.get(n);if(!r||!i)return;for(const a of r)a.includes(",")?i.cssStyles.push(...a.split(",")):i.cssStyles.push(a)}}setClass(e,r){var n;for(const i of e){const a=this.requirements.get(i)??this.elements.get(i);if(a)for(const s of r){a.classes.push(s);const o=(n=this.classes.get(s))==null?void 0:n.styles;o&&a.cssStyles.push(...o)}}}defineClass(e,r){for(const n of e){let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.requirements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))}),this.elements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))})}}getClasses(){return this.classes}getData(){var i,a,s,o;const e=Fe(),r=[],n=[];for(const l of this.requirements.values()){const u=l;u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.shape="requirementBox",u.look=e.look,u.colorIndex=r.length,r.push(u)}for(const l of this.elements.values()){const u=l;u.shape="requirementBox",u.look=e.look,u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.colorIndex=r.length,r.push(u)}for(const l of this.relations){let u=0;const h=l.type===this.Relationships.CONTAINS,d={id:`${l.src}-${l.dst}-${u}`,start:((i=this.requirements.get(l.src))==null?void 0:i.name)??((a=this.elements.get(l.src))==null?void 0:a.name),end:((s=this.requirements.get(l.dst))==null?void 0:s.name)??((o=this.elements.get(l.dst))==null?void 0:o.name),label:`<<${l.type}>>`,classes:"relationshipLine",style:["fill:none",h?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:h?"normal":"dashed",arrowTypeStart:h?"requirement_contains":"",arrowTypeEnd:h?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(d),u++}return{nodes:r,edges:n,other:{},config:e,direction:this.getDirection()}}},x(tb,"RequirementDB"),tb),D6t=x(t=>{const e=Xt(),{themeVariables:r,look:n}=e,{bkgColorArray:i,borderColorArray:a}=r;if(!(a!=null&&a.length))return"";let s="";for(let o=0;o0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(W){return W=this.conditionStack.length-1-Math.abs(W||0),W>=0?this.conditionStack[W]:"INITIAL"},"topState"),pushState:x(function(W){this.begin(W)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(W,ne,j,ue){switch(j){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return ne.yytext=ne.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return ae})();se.lexer=de;function Te(){this.yy={}}return x(Te,"Parser"),Te.prototype=se,se.Parser=Te,new Te})();$B.parser=$B;var O6t=$B,tb,$6t=(tb=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Hn,this.getAccTitle=ni,this.setAccDescription=ii,this.getAccDescription=ai,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getConfig=x(()=>Fe().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,r){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:r,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),le.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,r,n){this.relations.push({type:e,src:r,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,$n()}setCssStyle(e,r){for(const n of e){const i=this.requirements.get(n)??this.elements.get(n);if(!r||!i)return;for(const a of r)a.includes(",")?i.cssStyles.push(...a.split(",")):i.cssStyles.push(a)}}setClass(e,r){var n;for(const i of e){const a=this.requirements.get(i)??this.elements.get(i);if(a)for(const s of r){a.classes.push(s);const o=(n=this.classes.get(s))==null?void 0:n.styles;o&&a.cssStyles.push(...o)}}}defineClass(e,r){for(const n of e){let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.requirements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))}),this.elements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))})}}getClasses(){return this.classes}getData(){var i,a,s,o;const e=Fe(),r=[],n=[];for(const l of this.requirements.values()){const u=l;u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.shape="requirementBox",u.look=e.look,u.colorIndex=r.length,r.push(u)}for(const l of this.elements.values()){const u=l;u.shape="requirementBox",u.look=e.look,u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.colorIndex=r.length,r.push(u)}for(const l of this.relations){let u=0;const h=l.type===this.Relationships.CONTAINS,d={id:`${l.src}-${l.dst}-${u}`,start:((i=this.requirements.get(l.src))==null?void 0:i.name)??((a=this.elements.get(l.src))==null?void 0:a.name),end:((s=this.requirements.get(l.dst))==null?void 0:s.name)??((o=this.elements.get(l.dst))==null?void 0:o.name),label:`<<${l.type}>>`,classes:"relationshipLine",style:["fill:none",h?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:h?"normal":"dashed",arrowTypeStart:h?"requirement_contains":"",arrowTypeEnd:h?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(d),u++}return{nodes:r,edges:n,other:{},config:e,direction:this.getDirection()}}},x(tb,"RequirementDB"),tb),P6t=x(t=>{const e=Xt(),{themeVariables:r,look:n}=e,{bkgColorArray:i,borderColorArray:a}=r;if(!(a!=null&&a.length))return"";let s="";for(let o=0;o{const e=Xt(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` - ${D6t(t)} + `;return s},"genColor"),B6t=x(t=>{const e=Xt(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` + ${P6t(t)} marker { fill: ${t.relationColor}; stroke: ${t.relationColor}; @@ -2100,16 +2102,16 @@ Expecting `+mt.join(", ")+", got '"+(this.terminals_[rt]||rt)+"'":_r="Parse erro background-color: ${i??t.edgeLabelBackground}; } -`},"getStyles"),$6t=O6t,A_e={};Z6(A_e,{draw:()=>P6t});var P6t=x(async function(t,e,r,n){le.info("REF0:"),le.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s,look:o}=Fe(),l=n.db.getData(),u=Ox(e,i);l.type=n.type,l.layoutAlgorithm=nS(s),l.nodeSpacing=(a==null?void 0:a.nodeSpacing)??50,l.rankSpacing=(a==null?void 0:a.rankSpacing)??50,l.markers=o==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await xx(l,u);const h=8;yr.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),mg(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),B6t={parser:I6t,get db(){return new N6t},renderer:A_e,styles:$6t};const F6t=Object.freeze(Object.defineProperty({__proto__:null,diagram:B6t},Symbol.toStringTag,{value:"Module"}));var PB=(function(){var t=x(function(_e,$e,Me,He){for(Me=Me||{},He=_e.length;He--;Me[_e[He]]=$e);return Me},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,12],l=[1,14],u=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,25],g=[1,26],m=[1,27],y=[1,28],v=[1,29],T=[1,30],b=[1,31],w=[1,32],C=[1,33],S=[1,34],k=[1,35],E=[1,36],_=[1,37],M=[1,38],L=[1,39],P=[1,40],D=[1,42],R=[1,43],I=[1,44],$=[1,45],O=[1,46],N=[1,47],F=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],z=[1,74],V=[1,80],B=[1,81],G=[1,82],H=[1,83],q=[1,84],Z=[1,85],Y=[1,86],ie=[1,87],K=[1,88],Q=[1,89],te=[1,90],J=[1,91],ge=[1,92],ee=[1,93],Re=[1,94],Ie=[1,95],Be=[1,96],ce=[1,97],oe=[1,98],be=[1,99],fe=[1,100],Pe=[1,101],ve=[1,102],Ce=[1,103],Ve=[1,104],se=[1,105],de=[2,78],Te=[4,5,17,51,53,54],ae=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],he=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],W=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],ne=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],j=[5,52],ue=[70,71,72,73],X=[1,151],Oe={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:x(function($e,Me,He,De,Ke,Ae,at){var Ee=Ae.length-1;switch(Ke){case 3:return De.apply(Ae[Ee]),Ae[Ee];case 4:case 10:this.$=[];break;case 5:case 11:Ae[Ee-1].push(Ae[Ee]),this.$=Ae[Ee-1];break;case 6:case 7:case 12:case 13:this.$=Ae[Ee];break;case 8:case 9:case 14:this.$=[];break;case 16:Ae[Ee].type="createParticipant",this.$=Ae[Ee];break;case 17:Ae[Ee-1].unshift({type:"boxStart",boxData:De.parseBoxData(Ae[Ee-2])}),Ae[Ee-1].push({type:"boxEnd",boxText:Ae[Ee-2]}),this.$=Ae[Ee-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(Ae[Ee-2]),sequenceIndexStep:Number(Ae[Ee-1]),sequenceVisible:!0,signalType:De.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Ae[Ee-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:De.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:De.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:De.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:De.LINETYPE.ACTIVE_START,actor:Ae[Ee-1].actor};break;case 24:this.$={type:"activeEnd",signalType:De.LINETYPE.ACTIVE_END,actor:Ae[Ee-1].actor};break;case 30:De.setDiagramTitle(Ae[Ee].substring(6)),this.$=Ae[Ee].substring(6);break;case 31:De.setDiagramTitle(Ae[Ee].substring(7)),this.$=Ae[Ee].substring(7);break;case 32:this.$=Ae[Ee].trim(),De.setAccTitle(this.$);break;case 33:case 34:this.$=Ae[Ee].trim(),De.setAccDescription(this.$);break;case 35:Ae[Ee-1].unshift({type:"loopStart",loopText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.LOOP_START}),Ae[Ee-1].push({type:"loopEnd",loopText:Ae[Ee-2],signalType:De.LINETYPE.LOOP_END}),this.$=Ae[Ee-1];break;case 36:Ae[Ee-1].unshift({type:"rectStart",color:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.RECT_START}),Ae[Ee-1].push({type:"rectEnd",color:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.RECT_END}),this.$=Ae[Ee-1];break;case 37:Ae[Ee-1].unshift({type:"optStart",optText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.OPT_START}),Ae[Ee-1].push({type:"optEnd",optText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.OPT_END}),this.$=Ae[Ee-1];break;case 38:Ae[Ee-1].unshift({type:"altStart",altText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.ALT_START}),Ae[Ee-1].push({type:"altEnd",signalType:De.LINETYPE.ALT_END}),this.$=Ae[Ee-1];break;case 39:Ae[Ee-1].unshift({type:"parStart",parText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.PAR_START}),Ae[Ee-1].push({type:"parEnd",signalType:De.LINETYPE.PAR_END}),this.$=Ae[Ee-1];break;case 40:Ae[Ee-1].unshift({type:"parStart",parText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.PAR_OVER_START}),Ae[Ee-1].push({type:"parEnd",signalType:De.LINETYPE.PAR_END}),this.$=Ae[Ee-1];break;case 41:Ae[Ee-1].unshift({type:"criticalStart",criticalText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.CRITICAL_START}),Ae[Ee-1].push({type:"criticalEnd",signalType:De.LINETYPE.CRITICAL_END}),this.$=Ae[Ee-1];break;case 42:Ae[Ee-1].unshift({type:"breakStart",breakText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.BREAK_START}),Ae[Ee-1].push({type:"breakEnd",optText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.BREAK_END}),this.$=Ae[Ee-1];break;case 44:this.$=Ae[Ee-3].concat([{type:"option",optionText:De.parseMessage(Ae[Ee-1]),signalType:De.LINETYPE.CRITICAL_OPTION},Ae[Ee]]);break;case 46:this.$=Ae[Ee-3].concat([{type:"and",parText:De.parseMessage(Ae[Ee-1]),signalType:De.LINETYPE.PAR_AND},Ae[Ee]]);break;case 48:this.$=Ae[Ee-3].concat([{type:"else",altText:De.parseMessage(Ae[Ee-1]),signalType:De.LINETYPE.ALT_ELSE},Ae[Ee]]);break;case 49:Ae[Ee-3].draw="participant",Ae[Ee-3].type="addParticipant",Ae[Ee-3].description=De.parseMessage(Ae[Ee-1]),this.$=Ae[Ee-3];break;case 50:Ae[Ee-1].draw="participant",Ae[Ee-1].type="addParticipant",this.$=Ae[Ee-1];break;case 51:Ae[Ee-3].draw="actor",Ae[Ee-3].type="addParticipant",Ae[Ee-3].description=De.parseMessage(Ae[Ee-1]),this.$=Ae[Ee-3];break;case 52:case 57:Ae[Ee-1].draw="actor",Ae[Ee-1].type="addParticipant",this.$=Ae[Ee-1];break;case 53:Ae[Ee-1].type="destroyParticipant",this.$=Ae[Ee-1];break;case 54:Ae[Ee-3].draw="participant",Ae[Ee-3].type="addParticipant",Ae[Ee-3].description=De.parseMessage(Ae[Ee-1]),this.$=Ae[Ee-3];break;case 55:Ae[Ee-1].draw="participant",Ae[Ee-1].type="addParticipant",this.$=Ae[Ee-1];break;case 56:Ae[Ee-3].draw="actor",Ae[Ee-3].type="addParticipant",Ae[Ee-3].description=De.parseMessage(Ae[Ee-1]),this.$=Ae[Ee-3];break;case 58:this.$=[Ae[Ee-1],{type:"addNote",placement:Ae[Ee-2],actor:Ae[Ee-1].actor,text:Ae[Ee]}];break;case 59:Ae[Ee-2]=[].concat(Ae[Ee-1],Ae[Ee-1]).slice(0,2),Ae[Ee-2][0]=Ae[Ee-2][0].actor,Ae[Ee-2][1]=Ae[Ee-2][1].actor,this.$=[Ae[Ee-1],{type:"addNote",placement:De.PLACEMENT.OVER,actor:Ae[Ee-2].slice(0,2),text:Ae[Ee]}];break;case 60:this.$=[Ae[Ee-1],{type:"addLinks",actor:Ae[Ee-1].actor,text:Ae[Ee]}];break;case 61:this.$=[Ae[Ee-1],{type:"addALink",actor:Ae[Ee-1].actor,text:Ae[Ee]}];break;case 62:this.$=[Ae[Ee-1],{type:"addProperties",actor:Ae[Ee-1].actor,text:Ae[Ee]}];break;case 63:this.$=[Ae[Ee-1],{type:"addDetails",actor:Ae[Ee-1].actor,text:Ae[Ee]}];break;case 66:this.$=[Ae[Ee-2],Ae[Ee]];break;case 67:this.$=Ae[Ee];break;case 68:this.$=De.PLACEMENT.LEFTOF;break;case 69:this.$=De.PLACEMENT.RIGHTOF;break;case 70:this.$=[Ae[Ee-4],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-4].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-3],msg:Ae[Ee],activate:!0},{type:"activeStart",signalType:De.LINETYPE.ACTIVE_START,actor:Ae[Ee-1].actor}];break;case 71:this.$=[Ae[Ee-4],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-4].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-3],msg:Ae[Ee]},{type:"activeEnd",signalType:De.LINETYPE.ACTIVE_END,actor:Ae[Ee-4].actor}];break;case 72:this.$=[Ae[Ee-4],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-4].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-3],msg:Ae[Ee],activate:!0,centralConnection:De.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:De.LINETYPE.CENTRAL_CONNECTION,actor:Ae[Ee-1].actor}];break;case 73:this.$=[Ae[Ee-4],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-4].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-2],msg:Ae[Ee],activate:!1,centralConnection:De.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:De.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Ae[Ee-4].actor}];break;case 74:this.$=[Ae[Ee-5],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-5].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-3],msg:Ae[Ee],activate:!0,centralConnection:De.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:De.LINETYPE.CENTRAL_CONNECTION,actor:Ae[Ee-1].actor},{type:"centralConnectionReverse",signalType:De.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Ae[Ee-5].actor}];break;case 75:this.$=[Ae[Ee-3],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-3].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-2],msg:Ae[Ee]}];break;case 76:this.$={type:"addParticipant",actor:Ae[Ee-1],config:Ae[Ee]};break;case 77:this.$=Ae[Ee-1].trim();break;case 78:this.$={type:"addParticipant",actor:Ae[Ee]};break;case 79:this.$=De.LINETYPE.SOLID_OPEN;break;case 80:this.$=De.LINETYPE.DOTTED_OPEN;break;case 81:this.$=De.LINETYPE.SOLID;break;case 82:this.$=De.LINETYPE.SOLID_TOP;break;case 83:this.$=De.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=De.LINETYPE.STICK_TOP;break;case 85:this.$=De.LINETYPE.STICK_BOTTOM;break;case 86:this.$=De.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=De.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=De.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=De.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=De.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=De.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=De.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=De.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=De.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=De.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=De.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=De.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=De.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=De.LINETYPE.DOTTED;break;case 100:this.$=De.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=De.LINETYPE.SOLID_CROSS;break;case 102:this.$=De.LINETYPE.DOTTED_CROSS;break;case 103:this.$=De.LINETYPE.SOLID_POINT;break;case 104:this.$=De.LINETYPE.DOTTED_POINT;break;case 105:this.$=De.parseMessage(Ae[Ee].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},t(F,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},t(F,[2,7]),t(F,[2,8]),t(F,[2,9]),t(F,[2,15]),{13:49,51:M,53:L,54:P},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:N},{23:56,73:N},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(F,[2,30]),t(F,[2,31]),{33:[1,62]},{35:[1,63]},t(F,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:z},{23:75,55:76,73:z},{23:77,73:N},{69:78,72:[1,79],78:V,79:B,80:G,81:H,82:q,83:Z,84:Y,85:ie,86:K,87:Q,88:te,89:J,90:ge,91:ee,92:Re,93:Ie,94:Be,95:ce,96:oe,97:be,98:fe,99:Pe,100:ve,101:Ce,102:Ve,103:se},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:N},{23:111,73:N},{23:112,73:N},{23:113,73:N},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],de),t(F,[2,6]),t(F,[2,16]),t(Te,[2,10],{11:114}),t(F,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(F,[2,22]),{5:[1,118]},{5:[1,119]},t(F,[2,25]),t(F,[2,26]),t(F,[2,27]),t(F,[2,28]),t(F,[2,29]),t(F,[2,32]),t(F,[2,33]),t(ae,i,{7:120}),t(ae,i,{7:121}),t(ae,i,{7:122}),t(he,i,{41:123,7:124}),t(W,i,{43:125,7:126}),t(W,i,{7:126,43:127}),t(ne,i,{46:128,7:129}),t(ae,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(j,de,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:N},{69:146,78:V,79:B,80:G,81:H,82:q,83:Z,84:Y,85:ie,86:K,87:Q,88:te,89:J,90:ge,91:ee,92:Re,93:Ie,94:Be,95:ce,96:oe,97:be,98:fe,99:Pe,100:ve,101:Ce,102:Ve,103:se},t(ue,[2,79]),t(ue,[2,80]),t(ue,[2,81]),t(ue,[2,82]),t(ue,[2,83]),t(ue,[2,84]),t(ue,[2,85]),t(ue,[2,86]),t(ue,[2,87]),t(ue,[2,88]),t(ue,[2,89]),t(ue,[2,90]),t(ue,[2,91]),t(ue,[2,92]),t(ue,[2,93]),t(ue,[2,94]),t(ue,[2,95]),t(ue,[2,96]),t(ue,[2,97]),t(ue,[2,98]),t(ue,[2,99]),t(ue,[2,100]),t(ue,[2,101]),t(ue,[2,102]),t(ue,[2,103]),t(ue,[2,104]),{23:147,73:N},{23:149,60:148,73:N},{73:[2,68]},{73:[2,69]},{58:150,104:X},{58:152,104:X},{58:153,104:X},{58:154,104:X},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:M,53:L,54:P},{5:[1,160]},t(F,[2,20]),t(F,[2,21]),t(F,[2,23]),t(F,[2,24]),{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,161],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,162],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,163],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{17:[1,164]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,47],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,50:[1,165],51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{17:[1,166]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,45],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,49:[1,167],51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{17:[1,168]},{17:[1,169]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,43],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,48:[1,170],51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,171],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{16:[1,172]},t(F,[2,50]),{16:[1,173]},t(F,[2,55]),t(j,[2,76]),{76:[1,174]},{16:[1,175]},t(F,[2,52]),{16:[1,176]},t(F,[2,57]),t(F,[2,53]),{23:177,73:N},{23:178,73:N},{23:179,73:N},{58:180,104:X},{23:181,72:[1,182],73:N},{58:183,104:X},{58:184,104:X},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(F,[2,17]),t(Te,[2,11]),{13:186,51:M,53:L,54:P},t(Te,[2,13]),t(Te,[2,14]),t(F,[2,19]),t(F,[2,35]),t(F,[2,36]),t(F,[2,37]),t(F,[2,38]),{16:[1,187]},t(F,[2,39]),{16:[1,188]},t(F,[2,40]),t(F,[2,41]),{16:[1,189]},t(F,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:X},{58:196,104:X},{58:197,104:X},{5:[2,75]},{58:198,104:X},{23:199,73:N},{5:[2,58]},{5:[2,59]},{23:200,73:N},t(Te,[2,12]),t(he,i,{7:124,41:201}),t(W,i,{7:126,43:202}),t(ne,i,{7:129,46:203}),t(F,[2,49]),t(F,[2,54]),t(j,[2,77]),t(F,[2,51]),t(F,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:X},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:x(function($e,Me){if(Me.recoverable)this.trace($e);else{var He=new Error($e);throw He.hash=Me,He}},"parseError"),parse:x(function($e){var Me=this,He=[0],De=[],Ke=[null],Ae=[],at=this.table,Ee="",pt=0,ht=0,rt=2,Et=1,vt=Ae.slice.call(arguments,1),ot=Object.create(this.lexer),pe={yy:{}};for(var Ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ct)&&(pe.yy[Ct]=this.yy[Ct]);ot.setInput($e,pe.yy),pe.yy.lexer=ot,pe.yy.parser=this,typeof ot.yylloc>"u"&&(ot.yylloc={});var lt=ot.yylloc;Ae.push(lt);var st=ot.options&&ot.options.ranges;typeof pe.yy.parseError=="function"?this.parseError=pe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function mt(Zt){He.length=He.length-2*Zt,Ke.length=Ke.length-Zt,Ae.length=Ae.length-Zt}x(mt,"popStack");function _r(){var Zt;return Zt=De.pop()||ot.lex()||Et,typeof Zt!="number"&&(Zt instanceof Array&&(De=Zt,Zt=De.pop()),Zt=Me.symbols_[Zt]||Zt),Zt}x(_r,"lex");for(var Se,Ue,tt,kt,Nt={},sr,Qt,vr,nr;;){if(Ue=He[He.length-1],this.defaultActions[Ue]?tt=this.defaultActions[Ue]:((Se===null||typeof Se>"u")&&(Se=_r()),tt=at[Ue]&&at[Ue][Se]),typeof tt>"u"||!tt.length||!tt[0]){var Rr="";nr=[];for(sr in at[Ue])this.terminals_[sr]&&sr>rt&&nr.push("'"+this.terminals_[sr]+"'");ot.showPosition?Rr="Parse error on line "+(pt+1)+`: +`},"getStyles"),F6t=B6t,__e={};Z6(__e,{draw:()=>z6t});var z6t=x(async function(t,e,r,n){le.info("REF0:"),le.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s,look:o}=Fe(),l=n.db.getData(),u=Ox(e,i);l.type=n.type,l.layoutAlgorithm=nS(s),l.nodeSpacing=(a==null?void 0:a.nodeSpacing)??50,l.rankSpacing=(a==null?void 0:a.rankSpacing)??50,l.markers=o==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await xx(l,u);const h=8;yr.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),mg(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),V6t={parser:O6t,get db(){return new $6t},renderer:__e,styles:F6t};const G6t=Object.freeze(Object.defineProperty({__proto__:null,diagram:V6t},Symbol.toStringTag,{value:"Module"}));var PB=(function(){var t=x(function(_e,$e,Me,He){for(Me=Me||{},He=_e.length;He--;Me[_e[He]]=$e);return Me},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,12],l=[1,14],u=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,25],g=[1,26],m=[1,27],y=[1,28],v=[1,29],T=[1,30],b=[1,31],w=[1,32],C=[1,33],S=[1,34],k=[1,35],E=[1,36],_=[1,37],M=[1,38],L=[1,39],P=[1,40],D=[1,42],R=[1,43],I=[1,44],$=[1,45],O=[1,46],N=[1,47],F=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],z=[1,74],V=[1,80],B=[1,81],G=[1,82],H=[1,83],q=[1,84],Z=[1,85],Y=[1,86],ie=[1,87],K=[1,88],Q=[1,89],te=[1,90],J=[1,91],ge=[1,92],ee=[1,93],Re=[1,94],Ie=[1,95],Be=[1,96],ce=[1,97],oe=[1,98],be=[1,99],fe=[1,100],Pe=[1,101],ve=[1,102],Ce=[1,103],Ve=[1,104],se=[1,105],de=[2,78],Te=[4,5,17,51,53,54],ae=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],he=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],W=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],ne=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],j=[5,52],ue=[70,71,72,73],X=[1,151],Oe={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:x(function($e,Me,He,De,Ke,Ae,at){var Ee=Ae.length-1;switch(Ke){case 3:return De.apply(Ae[Ee]),Ae[Ee];case 4:case 10:this.$=[];break;case 5:case 11:Ae[Ee-1].push(Ae[Ee]),this.$=Ae[Ee-1];break;case 6:case 7:case 12:case 13:this.$=Ae[Ee];break;case 8:case 9:case 14:this.$=[];break;case 16:Ae[Ee].type="createParticipant",this.$=Ae[Ee];break;case 17:Ae[Ee-1].unshift({type:"boxStart",boxData:De.parseBoxData(Ae[Ee-2])}),Ae[Ee-1].push({type:"boxEnd",boxText:Ae[Ee-2]}),this.$=Ae[Ee-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(Ae[Ee-2]),sequenceIndexStep:Number(Ae[Ee-1]),sequenceVisible:!0,signalType:De.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Ae[Ee-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:De.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:De.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:De.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:De.LINETYPE.ACTIVE_START,actor:Ae[Ee-1].actor};break;case 24:this.$={type:"activeEnd",signalType:De.LINETYPE.ACTIVE_END,actor:Ae[Ee-1].actor};break;case 30:De.setDiagramTitle(Ae[Ee].substring(6)),this.$=Ae[Ee].substring(6);break;case 31:De.setDiagramTitle(Ae[Ee].substring(7)),this.$=Ae[Ee].substring(7);break;case 32:this.$=Ae[Ee].trim(),De.setAccTitle(this.$);break;case 33:case 34:this.$=Ae[Ee].trim(),De.setAccDescription(this.$);break;case 35:Ae[Ee-1].unshift({type:"loopStart",loopText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.LOOP_START}),Ae[Ee-1].push({type:"loopEnd",loopText:Ae[Ee-2],signalType:De.LINETYPE.LOOP_END}),this.$=Ae[Ee-1];break;case 36:Ae[Ee-1].unshift({type:"rectStart",color:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.RECT_START}),Ae[Ee-1].push({type:"rectEnd",color:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.RECT_END}),this.$=Ae[Ee-1];break;case 37:Ae[Ee-1].unshift({type:"optStart",optText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.OPT_START}),Ae[Ee-1].push({type:"optEnd",optText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.OPT_END}),this.$=Ae[Ee-1];break;case 38:Ae[Ee-1].unshift({type:"altStart",altText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.ALT_START}),Ae[Ee-1].push({type:"altEnd",signalType:De.LINETYPE.ALT_END}),this.$=Ae[Ee-1];break;case 39:Ae[Ee-1].unshift({type:"parStart",parText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.PAR_START}),Ae[Ee-1].push({type:"parEnd",signalType:De.LINETYPE.PAR_END}),this.$=Ae[Ee-1];break;case 40:Ae[Ee-1].unshift({type:"parStart",parText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.PAR_OVER_START}),Ae[Ee-1].push({type:"parEnd",signalType:De.LINETYPE.PAR_END}),this.$=Ae[Ee-1];break;case 41:Ae[Ee-1].unshift({type:"criticalStart",criticalText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.CRITICAL_START}),Ae[Ee-1].push({type:"criticalEnd",signalType:De.LINETYPE.CRITICAL_END}),this.$=Ae[Ee-1];break;case 42:Ae[Ee-1].unshift({type:"breakStart",breakText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.BREAK_START}),Ae[Ee-1].push({type:"breakEnd",optText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.BREAK_END}),this.$=Ae[Ee-1];break;case 44:this.$=Ae[Ee-3].concat([{type:"option",optionText:De.parseMessage(Ae[Ee-1]),signalType:De.LINETYPE.CRITICAL_OPTION},Ae[Ee]]);break;case 46:this.$=Ae[Ee-3].concat([{type:"and",parText:De.parseMessage(Ae[Ee-1]),signalType:De.LINETYPE.PAR_AND},Ae[Ee]]);break;case 48:this.$=Ae[Ee-3].concat([{type:"else",altText:De.parseMessage(Ae[Ee-1]),signalType:De.LINETYPE.ALT_ELSE},Ae[Ee]]);break;case 49:Ae[Ee-3].draw="participant",Ae[Ee-3].type="addParticipant",Ae[Ee-3].description=De.parseMessage(Ae[Ee-1]),this.$=Ae[Ee-3];break;case 50:Ae[Ee-1].draw="participant",Ae[Ee-1].type="addParticipant",this.$=Ae[Ee-1];break;case 51:Ae[Ee-3].draw="actor",Ae[Ee-3].type="addParticipant",Ae[Ee-3].description=De.parseMessage(Ae[Ee-1]),this.$=Ae[Ee-3];break;case 52:case 57:Ae[Ee-1].draw="actor",Ae[Ee-1].type="addParticipant",this.$=Ae[Ee-1];break;case 53:Ae[Ee-1].type="destroyParticipant",this.$=Ae[Ee-1];break;case 54:Ae[Ee-3].draw="participant",Ae[Ee-3].type="addParticipant",Ae[Ee-3].description=De.parseMessage(Ae[Ee-1]),this.$=Ae[Ee-3];break;case 55:Ae[Ee-1].draw="participant",Ae[Ee-1].type="addParticipant",this.$=Ae[Ee-1];break;case 56:Ae[Ee-3].draw="actor",Ae[Ee-3].type="addParticipant",Ae[Ee-3].description=De.parseMessage(Ae[Ee-1]),this.$=Ae[Ee-3];break;case 58:this.$=[Ae[Ee-1],{type:"addNote",placement:Ae[Ee-2],actor:Ae[Ee-1].actor,text:Ae[Ee]}];break;case 59:Ae[Ee-2]=[].concat(Ae[Ee-1],Ae[Ee-1]).slice(0,2),Ae[Ee-2][0]=Ae[Ee-2][0].actor,Ae[Ee-2][1]=Ae[Ee-2][1].actor,this.$=[Ae[Ee-1],{type:"addNote",placement:De.PLACEMENT.OVER,actor:Ae[Ee-2].slice(0,2),text:Ae[Ee]}];break;case 60:this.$=[Ae[Ee-1],{type:"addLinks",actor:Ae[Ee-1].actor,text:Ae[Ee]}];break;case 61:this.$=[Ae[Ee-1],{type:"addALink",actor:Ae[Ee-1].actor,text:Ae[Ee]}];break;case 62:this.$=[Ae[Ee-1],{type:"addProperties",actor:Ae[Ee-1].actor,text:Ae[Ee]}];break;case 63:this.$=[Ae[Ee-1],{type:"addDetails",actor:Ae[Ee-1].actor,text:Ae[Ee]}];break;case 66:this.$=[Ae[Ee-2],Ae[Ee]];break;case 67:this.$=Ae[Ee];break;case 68:this.$=De.PLACEMENT.LEFTOF;break;case 69:this.$=De.PLACEMENT.RIGHTOF;break;case 70:this.$=[Ae[Ee-4],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-4].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-3],msg:Ae[Ee],activate:!0},{type:"activeStart",signalType:De.LINETYPE.ACTIVE_START,actor:Ae[Ee-1].actor}];break;case 71:this.$=[Ae[Ee-4],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-4].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-3],msg:Ae[Ee]},{type:"activeEnd",signalType:De.LINETYPE.ACTIVE_END,actor:Ae[Ee-4].actor}];break;case 72:this.$=[Ae[Ee-4],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-4].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-3],msg:Ae[Ee],activate:!0,centralConnection:De.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:De.LINETYPE.CENTRAL_CONNECTION,actor:Ae[Ee-1].actor}];break;case 73:this.$=[Ae[Ee-4],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-4].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-2],msg:Ae[Ee],activate:!1,centralConnection:De.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:De.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Ae[Ee-4].actor}];break;case 74:this.$=[Ae[Ee-5],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-5].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-3],msg:Ae[Ee],activate:!0,centralConnection:De.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:De.LINETYPE.CENTRAL_CONNECTION,actor:Ae[Ee-1].actor},{type:"centralConnectionReverse",signalType:De.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Ae[Ee-5].actor}];break;case 75:this.$=[Ae[Ee-3],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-3].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-2],msg:Ae[Ee]}];break;case 76:this.$={type:"addParticipant",actor:Ae[Ee-1],config:Ae[Ee]};break;case 77:this.$=Ae[Ee-1].trim();break;case 78:this.$={type:"addParticipant",actor:Ae[Ee]};break;case 79:this.$=De.LINETYPE.SOLID_OPEN;break;case 80:this.$=De.LINETYPE.DOTTED_OPEN;break;case 81:this.$=De.LINETYPE.SOLID;break;case 82:this.$=De.LINETYPE.SOLID_TOP;break;case 83:this.$=De.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=De.LINETYPE.STICK_TOP;break;case 85:this.$=De.LINETYPE.STICK_BOTTOM;break;case 86:this.$=De.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=De.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=De.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=De.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=De.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=De.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=De.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=De.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=De.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=De.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=De.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=De.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=De.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=De.LINETYPE.DOTTED;break;case 100:this.$=De.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=De.LINETYPE.SOLID_CROSS;break;case 102:this.$=De.LINETYPE.DOTTED_CROSS;break;case 103:this.$=De.LINETYPE.SOLID_POINT;break;case 104:this.$=De.LINETYPE.DOTTED_POINT;break;case 105:this.$=De.parseMessage(Ae[Ee].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},t(F,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},t(F,[2,7]),t(F,[2,8]),t(F,[2,9]),t(F,[2,15]),{13:49,51:M,53:L,54:P},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:N},{23:56,73:N},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(F,[2,30]),t(F,[2,31]),{33:[1,62]},{35:[1,63]},t(F,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:z},{23:75,55:76,73:z},{23:77,73:N},{69:78,72:[1,79],78:V,79:B,80:G,81:H,82:q,83:Z,84:Y,85:ie,86:K,87:Q,88:te,89:J,90:ge,91:ee,92:Re,93:Ie,94:Be,95:ce,96:oe,97:be,98:fe,99:Pe,100:ve,101:Ce,102:Ve,103:se},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:N},{23:111,73:N},{23:112,73:N},{23:113,73:N},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],de),t(F,[2,6]),t(F,[2,16]),t(Te,[2,10],{11:114}),t(F,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(F,[2,22]),{5:[1,118]},{5:[1,119]},t(F,[2,25]),t(F,[2,26]),t(F,[2,27]),t(F,[2,28]),t(F,[2,29]),t(F,[2,32]),t(F,[2,33]),t(ae,i,{7:120}),t(ae,i,{7:121}),t(ae,i,{7:122}),t(he,i,{41:123,7:124}),t(W,i,{43:125,7:126}),t(W,i,{7:126,43:127}),t(ne,i,{46:128,7:129}),t(ae,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(j,de,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:N},{69:146,78:V,79:B,80:G,81:H,82:q,83:Z,84:Y,85:ie,86:K,87:Q,88:te,89:J,90:ge,91:ee,92:Re,93:Ie,94:Be,95:ce,96:oe,97:be,98:fe,99:Pe,100:ve,101:Ce,102:Ve,103:se},t(ue,[2,79]),t(ue,[2,80]),t(ue,[2,81]),t(ue,[2,82]),t(ue,[2,83]),t(ue,[2,84]),t(ue,[2,85]),t(ue,[2,86]),t(ue,[2,87]),t(ue,[2,88]),t(ue,[2,89]),t(ue,[2,90]),t(ue,[2,91]),t(ue,[2,92]),t(ue,[2,93]),t(ue,[2,94]),t(ue,[2,95]),t(ue,[2,96]),t(ue,[2,97]),t(ue,[2,98]),t(ue,[2,99]),t(ue,[2,100]),t(ue,[2,101]),t(ue,[2,102]),t(ue,[2,103]),t(ue,[2,104]),{23:147,73:N},{23:149,60:148,73:N},{73:[2,68]},{73:[2,69]},{58:150,104:X},{58:152,104:X},{58:153,104:X},{58:154,104:X},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:M,53:L,54:P},{5:[1,160]},t(F,[2,20]),t(F,[2,21]),t(F,[2,23]),t(F,[2,24]),{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,161],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,162],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,163],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{17:[1,164]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,47],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,50:[1,165],51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{17:[1,166]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,45],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,49:[1,167],51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{17:[1,168]},{17:[1,169]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,43],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,48:[1,170],51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,171],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{16:[1,172]},t(F,[2,50]),{16:[1,173]},t(F,[2,55]),t(j,[2,76]),{76:[1,174]},{16:[1,175]},t(F,[2,52]),{16:[1,176]},t(F,[2,57]),t(F,[2,53]),{23:177,73:N},{23:178,73:N},{23:179,73:N},{58:180,104:X},{23:181,72:[1,182],73:N},{58:183,104:X},{58:184,104:X},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(F,[2,17]),t(Te,[2,11]),{13:186,51:M,53:L,54:P},t(Te,[2,13]),t(Te,[2,14]),t(F,[2,19]),t(F,[2,35]),t(F,[2,36]),t(F,[2,37]),t(F,[2,38]),{16:[1,187]},t(F,[2,39]),{16:[1,188]},t(F,[2,40]),t(F,[2,41]),{16:[1,189]},t(F,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:X},{58:196,104:X},{58:197,104:X},{5:[2,75]},{58:198,104:X},{23:199,73:N},{5:[2,58]},{5:[2,59]},{23:200,73:N},t(Te,[2,12]),t(he,i,{7:124,41:201}),t(W,i,{7:126,43:202}),t(ne,i,{7:129,46:203}),t(F,[2,49]),t(F,[2,54]),t(j,[2,77]),t(F,[2,51]),t(F,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:X},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:x(function($e,Me){if(Me.recoverable)this.trace($e);else{var He=new Error($e);throw He.hash=Me,He}},"parseError"),parse:x(function($e){var Me=this,He=[0],De=[],Ke=[null],Ae=[],at=this.table,Ee="",pt=0,ht=0,rt=2,Et=1,vt=Ae.slice.call(arguments,1),ot=Object.create(this.lexer),pe={yy:{}};for(var Ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ct)&&(pe.yy[Ct]=this.yy[Ct]);ot.setInput($e,pe.yy),pe.yy.lexer=ot,pe.yy.parser=this,typeof ot.yylloc>"u"&&(ot.yylloc={});var lt=ot.yylloc;Ae.push(lt);var st=ot.options&&ot.options.ranges;typeof pe.yy.parseError=="function"?this.parseError=pe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function mt(Zt){He.length=He.length-2*Zt,Ke.length=Ke.length-Zt,Ae.length=Ae.length-Zt}x(mt,"popStack");function _r(){var Zt;return Zt=De.pop()||ot.lex()||Et,typeof Zt!="number"&&(Zt instanceof Array&&(De=Zt,Zt=De.pop()),Zt=Me.symbols_[Zt]||Zt),Zt}x(_r,"lex");for(var Se,Ue,tt,kt,Nt={},sr,Qt,vr,nr;;){if(Ue=He[He.length-1],this.defaultActions[Ue]?tt=this.defaultActions[Ue]:((Se===null||typeof Se>"u")&&(Se=_r()),tt=at[Ue]&&at[Ue][Se]),typeof tt>"u"||!tt.length||!tt[0]){var Rr="";nr=[];for(sr in at[Ue])this.terminals_[sr]&&sr>rt&&nr.push("'"+this.terminals_[sr]+"'");ot.showPosition?Rr="Parse error on line "+(pt+1)+`: `+ot.showPosition()+` Expecting `+nr.join(", ")+", got '"+(this.terminals_[Se]||Se)+"'":Rr="Parse error on line "+(pt+1)+": Unexpected "+(Se==Et?"end of input":"'"+(this.terminals_[Se]||Se)+"'"),this.parseError(Rr,{text:ot.match,token:this.terminals_[Se]||Se,line:ot.yylineno,loc:lt,expected:nr})}if(tt[0]instanceof Array&&tt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ue+", token: "+Se);switch(tt[0]){case 1:He.push(Se),Ke.push(ot.yytext),Ae.push(ot.yylloc),He.push(tt[1]),Se=null,ht=ot.yyleng,Ee=ot.yytext,pt=ot.yylineno,lt=ot.yylloc;break;case 2:if(Qt=this.productions_[tt[1]][1],Nt.$=Ke[Ke.length-Qt],Nt._$={first_line:Ae[Ae.length-(Qt||1)].first_line,last_line:Ae[Ae.length-1].last_line,first_column:Ae[Ae.length-(Qt||1)].first_column,last_column:Ae[Ae.length-1].last_column},st&&(Nt._$.range=[Ae[Ae.length-(Qt||1)].range[0],Ae[Ae.length-1].range[1]]),kt=this.performAction.apply(Nt,[Ee,ht,pt,pe.yy,tt[1],Ke,Ae].concat(vt)),typeof kt<"u")return kt;Qt&&(He=He.slice(0,-1*Qt*2),Ke=Ke.slice(0,-1*Qt),Ae=Ae.slice(0,-1*Qt)),He.push(this.productions_[tt[1]][0]),Ke.push(Nt.$),Ae.push(Nt._$),vr=at[He[He.length-2]][He[He.length-1]],He.push(vr);break;case 3:return!0}}return!0},"parse")},xe=(function(){var _e={EOF:1,parseError:x(function(Me,He){if(this.yy.parser)this.yy.parser.parseError(Me,He);else throw new Error(Me)},"parseError"),setInput:x(function($e,Me){return this.yy=Me||this.yy||{},this._input=$e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var $e=this._input[0];this.yytext+=$e,this.yyleng++,this.offset++,this.match+=$e,this.matched+=$e;var Me=$e.match(/(?:\r\n?|\n).*/g);return Me?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),$e},"input"),unput:x(function($e){var Me=$e.length,He=$e.split(/(?:\r\n?|\n)/g);this._input=$e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Me),this.offset-=Me;var De=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),He.length-1&&(this.yylineno-=He.length-1);var Ke=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:He?(He.length===De.length?this.yylloc.first_column:0)+De[De.length-He.length].length-He[0].length:this.yylloc.first_column-Me},this.options.ranges&&(this.yylloc.range=[Ke[0],Ke[0]+this.yyleng-Me]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function($e){this.unput(this.match.slice($e))},"less"),pastInput:x(function(){var $e=this.matched.substr(0,this.matched.length-this.match.length);return($e.length>20?"...":"")+$e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var $e=this.match;return $e.length<20&&($e+=this._input.substr(0,20-$e.length)),($e.substr(0,20)+($e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var $e=this.pastInput(),Me=new Array($e.length+1).join("-");return $e+this.upcomingInput()+` `+Me+"^"},"showPosition"),test_match:x(function($e,Me){var He,De,Ke;if(this.options.backtrack_lexer&&(Ke={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ke.yylloc.range=this.yylloc.range.slice(0))),De=$e[0].match(/(?:\r\n?|\n).*/g),De&&(this.yylineno+=De.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:De?De[De.length-1].length-De[De.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+$e[0].length},this.yytext+=$e[0],this.match+=$e[0],this.matches=$e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice($e[0].length),this.matched+=$e[0],He=this.performAction.call(this,this.yy,this,Me,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),He)return He;if(this._backtrack){for(var Ae in Ke)this[Ae]=Ke[Ae];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var $e,Me,He,De;this._more||(this.yytext="",this.match="");for(var Ke=this._currentRules(),Ae=0;AeMe[0].length)){if(Me=He,De=Ae,this.options.backtrack_lexer){if($e=this.test_match(He,Ke[Ae]),$e!==!1)return $e;if(this._backtrack){Me=!1;continue}else return!1}else if(!this.options.flex)break}return Me?($e=this.test_match(Me,Ke[De]),$e!==!1?$e:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Me=this.next();return Me||this.lex()},"lex"),begin:x(function(Me){this.conditionStack.push(Me)},"begin"),popState:x(function(){var Me=this.conditionStack.length-1;return Me>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Me){return Me=this.conditionStack.length-1-Math.abs(Me||0),Me>=0?this.conditionStack[Me]:"INITIAL"},"topState"),pushState:x(function(Me){this.begin(Me)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Me,He,De,Ke){switch(De){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return He.yytext=He.yytext.trim(),73;case 12:return He.yytext=He.yytext.trim(),this.begin("ALIAS"),73;case 13:return He.yytext=He.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return He.yytext=He.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return He.yytext=He.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return _e})();Oe.lexer=xe;function Ge(){this.yy={}}return x(Ge,"Parser"),Ge.prototype=Oe,Oe.Parser=Ge,new Ge})();PB.parser=PB;var z6t=PB,V6t={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},G6t={FILLED:0,OPEN:1},W6t={LEFTOF:0,RIGHTOF:1,OVER:2},k4={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},rb,H6t=(rb=class{constructor(){this.state=new xW(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=Hn,this.setAccDescription=ii,this.setDiagramTitle=ti,this.getAccTitle=ni,this.getAccDescription=ai,this.getDiagramTitle=Yn,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Fe().wrap),this.LINETYPE=V6t,this.ARROWTYPE=G6t,this.PLACEMENT=W6t}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,r,n,i,a){let s=this.state.records.currentBox,o;if(a!==void 0){let u;a.includes(` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Me=this.next();return Me||this.lex()},"lex"),begin:x(function(Me){this.conditionStack.push(Me)},"begin"),popState:x(function(){var Me=this.conditionStack.length-1;return Me>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Me){return Me=this.conditionStack.length-1-Math.abs(Me||0),Me>=0?this.conditionStack[Me]:"INITIAL"},"topState"),pushState:x(function(Me){this.begin(Me)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Me,He,De,Ke){switch(De){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return He.yytext=He.yytext.trim(),73;case 12:return He.yytext=He.yytext.trim(),this.begin("ALIAS"),73;case 13:return He.yytext=He.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return He.yytext=He.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return He.yytext=He.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return _e})();Oe.lexer=xe;function Ge(){this.yy={}}return x(Ge,"Parser"),Ge.prototype=Oe,Oe.Parser=Ge,new Ge})();PB.parser=PB;var W6t=PB,H6t={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},q6t={FILLED:0,OPEN:1},U6t={LEFTOF:0,RIGHTOF:1,OVER:2},k4={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},rb,Y6t=(rb=class{constructor(){this.state=new xW(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=Hn,this.setAccDescription=ii,this.setDiagramTitle=ti,this.getAccTitle=ni,this.getAccDescription=ai,this.getDiagramTitle=Yn,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Fe().wrap),this.LINETYPE=H6t,this.ARROWTYPE=q6t,this.PLACEMENT=U6t}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,r,n,i,a){let s=this.state.records.currentBox,o;if(a!==void 0){let u;a.includes(` `)?u=a+` `:u=`{ `+a+` -}`,o=dR(u,{schema:hR})}i=(o==null?void 0:o.type)??i,o!=null&&o.alias&&(!n||n.text===r)&&(n={text:o.alias,wrap:n==null?void 0:n.wrap,type:i});const l=this.state.records.actors.get(e);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(s=l.box?l.box:this.state.records.currentBox,l.box=s,l&&r===l.name&&n==null)return}if((n==null?void 0:n.text)==null&&(n={text:r,type:i}),(i==null||n.text==null)&&(n={text:r,type:i}),this.state.records.actors.set(e,{box:s,name:r,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const u=this.state.records.actors.get(this.state.records.prevActor);u&&(u.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let r,n=0;if(!e)return 0;for(r=0;r>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:r,message:(n==null?void 0:n.text)??"",wrap:(n==null?void 0:n.wrap)??this.autoWrap(),type:i,activate:a,centralConnection:s??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const r=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(r===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:r}}autoWrap(){var e;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((e=Fe().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),On()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),a={text:i,wrap:n};return le.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){const r=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=r!=null&&r[1]?r[1].trim():"transparent",i=r!=null&&r[2]?r[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",n)||(n="transparent",i=e.trim());else{const o=new Option().style;o.color=n,o.color!==n&&(n="transparent",i=e.trim())}const{wrap:a,cleanedText:s}=this.extractWrap(i);return{text:s?Wr(s,Fe()):void 0,color:n,wrap:a}}addNote(e,r,n){const i={actor:e,placement:r,message:n.text,wrap:n.wrap??this.autoWrap()},a=[].concat(e,e);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:a[0],to:a[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:r})}addLinks(e,r){const n=this.getActor(e);try{let i=Wr(r.text,Fe());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const a=JSON.parse(i);this.insertLinks(n,a)}catch(i){le.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let a=Wr(r.text,Fe());const s=a.indexOf("@");a=a.replace(/=/g,"="),a=a.replace(/&/g,"&");const o=a.slice(0,s-1).trim(),l=a.slice(s+1).trim();i[o]=l,this.insertLinks(n,i)}catch(i){le.error("error while parsing actor link text",i)}}insertLinks(e,r){if(e.links==null)e.links=r;else for(const n in r)e.links[n]=r[n]}addProperties(e,r){const n=this.getActor(e);try{const i=Wr(r.text,Fe()),a=JSON.parse(i);this.insertProperties(n,a)}catch(i){le.error("error while parsing actor properties text",i)}}insertProperties(e,r){if(e.properties==null)e.properties=r;else for(const n in r)e.properties[n]=r[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,r){const n=this.getActor(e),i=document.getElementById(r.text);try{const a=i.innerHTML,s=JSON.parse(a);s.properties&&this.insertProperties(n,s.properties),s.links&&this.insertLinks(n,s.links)}catch(a){le.error("error while parsing actor details text",a)}}getActorProperty(e,r){if((e==null?void 0:e.properties)!==void 0)return e.properties[r]}apply(e){if(Array.isArray(e))e.forEach(r=>{this.apply(r)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":Hn(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return Fe().sequence}},x(rb,"SequenceDB"),rb),q6t=x(t=>{const e=t.dropShadow??"none",{look:r}=Fe();return`.actor { +}`,o=dR(u,{schema:hR})}i=(o==null?void 0:o.type)??i,o!=null&&o.alias&&(!n||n.text===r)&&(n={text:o.alias,wrap:n==null?void 0:n.wrap,type:i});const l=this.state.records.actors.get(e);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(s=l.box?l.box:this.state.records.currentBox,l.box=s,l&&r===l.name&&n==null)return}if((n==null?void 0:n.text)==null&&(n={text:r,type:i}),(i==null||n.text==null)&&(n={text:r,type:i}),this.state.records.actors.set(e,{box:s,name:r,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const u=this.state.records.actors.get(this.state.records.prevActor);u&&(u.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let r,n=0;if(!e)return 0;for(r=0;r>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:r,message:(n==null?void 0:n.text)??"",wrap:(n==null?void 0:n.wrap)??this.autoWrap(),type:i,activate:a,centralConnection:s??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const r=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(r===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:r}}autoWrap(){var e;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((e=Fe().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),$n()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),a={text:i,wrap:n};return le.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){const r=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=r!=null&&r[1]?r[1].trim():"transparent",i=r!=null&&r[2]?r[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",n)||(n="transparent",i=e.trim());else{const o=new Option().style;o.color=n,o.color!==n&&(n="transparent",i=e.trim())}const{wrap:a,cleanedText:s}=this.extractWrap(i);return{text:s?Wr(s,Fe()):void 0,color:n,wrap:a}}addNote(e,r,n){const i={actor:e,placement:r,message:n.text,wrap:n.wrap??this.autoWrap()},a=[].concat(e,e);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:a[0],to:a[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:r})}addLinks(e,r){const n=this.getActor(e);try{let i=Wr(r.text,Fe());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const a=JSON.parse(i);this.insertLinks(n,a)}catch(i){le.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let a=Wr(r.text,Fe());const s=a.indexOf("@");a=a.replace(/=/g,"="),a=a.replace(/&/g,"&");const o=a.slice(0,s-1).trim(),l=a.slice(s+1).trim();i[o]=l,this.insertLinks(n,i)}catch(i){le.error("error while parsing actor link text",i)}}insertLinks(e,r){if(e.links==null)e.links=r;else for(const n in r)e.links[n]=r[n]}addProperties(e,r){const n=this.getActor(e);try{const i=Wr(r.text,Fe()),a=JSON.parse(i);this.insertProperties(n,a)}catch(i){le.error("error while parsing actor properties text",i)}}insertProperties(e,r){if(e.properties==null)e.properties=r;else for(const n in r)e.properties[n]=r[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,r){const n=this.getActor(e),i=document.getElementById(r.text);try{const a=i.innerHTML,s=JSON.parse(a);s.properties&&this.insertProperties(n,s.properties),s.links&&this.insertLinks(n,s.links)}catch(a){le.error("error while parsing actor details text",a)}}getActorProperty(e,r){if((e==null?void 0:e.properties)!==void 0)return e.properties[r]}apply(e){if(Array.isArray(e))e.forEach(r=>{this.apply(r)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":Hn(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return Fe().sequence}},x(rb,"SequenceDB"),rb),X6t=x(t=>{const e=t.dropShadow??"none",{look:r}=Fe();return`.actor { stroke: ${t.actorBorder}; fill: ${t.actorBkg}; stroke-width: ${t.strokeWidth??1}; @@ -2248,25 +2250,25 @@ Expecting `+nr.join(", ")+", got '"+(this.terminals_[Se]||Se)+"'":Rr="Parse erro filter: ${e}; stroke: ${t.nodeBorder}; } -`},"getStyles"),U6t=q6t,i0=36,Ff="actor-top",zf="actor-bottom",O7="actor-box",j0="actor-man",Kh=new Set(["redux-color","redux-dark-color"]),Lk=x(function(t,e){const r=xL(t,e);return Xt().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),Y6t=x(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+s+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),a!=null){var p=20;for(let y in a){var g=u.append("a"),m=ig.sanitizeUrl(a[y]);g.attr("xlink:href",m),g.attr("target","_blank"),mRt(n)(y,g,o.x+10,o.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:o.height+p,width:d}},"drawPopup"),$7=x(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),w6=x(async function(t,e,r=null){let n=t.append("foreignObject");const i=await eR(e.text,Xt()),s=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",s.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-s.width/2)).attr("y",Math.round(l.y+l.height/2-s.height/2))}else if(r){let{startx:o,stopx:l,starty:u}=r;if(o>l){const h=o;o=l,l=h}n.attr("x",Math.round(o+Math.abs(o-l)/2-s.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-s.height))}return[n]},"drawKatex"),lx=x(function(t,e){let r=0,n=0;const i=e.text.split(At.lineBreakRegex),[a,s]=Oh(e.fontSize);let o=[],l=0,u=x(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=x(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=x(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=x(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&a!==void 0&&(l=h*a);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),s!==void 0&&f.style("font-size",s),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||kde;if(e.tspan){const g=f.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(p)}else f.text(p);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),o.push(f)}return o},"drawText"),__e=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,lx(t,e),n},"drawLabel"),Ur=-1,R_e=x((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),s=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):n.mirrorActors&&s.attr("y2",a.stopy)})},"fixLifeLineHeights"),X6t=x(function(t,e,r,n,i){var w,C;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Ur++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",$7(`actor${Ur}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Ur,e.links!=null&&g.attr("id","root-"+Ur),l==="neo"&&g.attr("data-look","neo"));const m=Yo();var y="actor";(w=e.properties)!=null&&w.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${zf}`:y+=` ${Ff}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.rx=3,m.ry=3,m.name=e.name,l==="neo"&&(m.rx=6,m.ry=6);const v=Lk(g,m),T=i.get(e.name)??0;if(Kh.has(u)&&(v.style("stroke",f[T%f.length]),v.style("fill",d[T%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),e.rectData=m,(C=e.properties)!=null&&C.icon){const S=e.properties.icon.trim();S.charAt(0)==="@"?hW(g,m.x+m.width-20,m.y+10,S.substr(1)):uW(g,m.x+m.width-20,m.y+10,S)}n||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),Zh(r,$i(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${O7}`},r);let b=e.height;if(v.node){const S=v.node().getBBox();e.height=S.height,b=S.height}return b},"drawActorTypeParticipant"),j6t=x(function(t,e,r,n,i){var k,E;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Ur++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",$7(`actor${Ur}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Ur,e.links!=null&&g.attr("id","root-"+Ur),l==="neo"&&g.attr("data-look","neo"));const m=Yo();var y="actor";(k=e.properties)!=null&&k.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${zf}`:y+=` ${Ff}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.name=e.name;const v=6,T={...m,x:m.x+-v,y:m.y+ +v,class:"actor"},b=Lk(g,m),w=Lk(g,T);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const C=i.get(e.name)??0;if(Kh.has(u)&&(b.style("stroke",f[C%f.length]),b.style("fill",d[C%f.length]),w.style("stroke",f[C%f.length]),w.style("fill",d[C%f.length])),(E=e.properties)!=null&&E.icon){const _=e.properties.icon.trim();_.charAt(0)==="@"?hW(g,m.x+m.width-20,m.y+10,_.substr(1)):uW(g,m.x+m.width-20,m.y+10,_)}Zh(r,$i(e.description))(e.description,g,m.x-v,m.y+v,m.width,m.height,{class:`actor ${O7}`},r);let S=e.height;if(b.node){const _=b.node().getBBox();e.height=_.height,S=_.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),S},"drawActorTypeCollections"),K6t=x(function(t,e,r,n,i){var _,M;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(Ur++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",$7(`actor${Ur}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Ur,e.links!=null&&g.attr("id","root-"+Ur),l==="neo"&&g.attr("data-look","neo"));const m=Yo();let y="actor";(_=e.properties)!=null&&_.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${zf}`:y+=` ${Ff}`,g.attr("class",y),m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.name=e.name;const v=m.height/2,T=v/(2.5+m.height/50),b=g.append("g"),w=g.append("g"),C=`M ${m.x},${m.y+v} +`},"getStyles"),j6t=X6t,i0=36,Ff="actor-top",zf="actor-bottom",O7="actor-box",j0="actor-man",Kh=new Set(["redux-color","redux-dark-color"]),Lk=x(function(t,e){const r=xL(t,e);return Xt().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),K6t=x(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+s+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),a!=null){var p=20;for(let y in a){var g=u.append("a"),m=ig.sanitizeUrl(a[y]);g.attr("xlink:href",m),g.attr("target","_blank"),bRt(n)(y,g,o.x+10,o.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:o.height+p,width:d}},"drawPopup"),$7=x(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),w6=x(async function(t,e,r=null){let n=t.append("foreignObject");const i=await eR(e.text,Xt()),s=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",s.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-s.width/2)).attr("y",Math.round(l.y+l.height/2-s.height/2))}else if(r){let{startx:o,stopx:l,starty:u}=r;if(o>l){const h=o;o=l,l=h}n.attr("x",Math.round(o+Math.abs(o-l)/2-s.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-s.height))}return[n]},"drawKatex"),lx=x(function(t,e){let r=0,n=0;const i=e.text.split(At.lineBreakRegex),[a,s]=Oh(e.fontSize);let o=[],l=0,u=x(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=x(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=x(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=x(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&a!==void 0&&(l=h*a);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),s!==void 0&&f.style("font-size",s),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||Sde;if(e.tspan){const g=f.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(p)}else f.text(p);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),o.push(f)}return o},"drawText"),R_e=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,lx(t,e),n},"drawLabel"),Ur=-1,L_e=x((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),s=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):n.mirrorActors&&s.attr("y2",a.stopy)})},"fixLifeLineHeights"),Z6t=x(function(t,e,r,n,i){var w,C;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Ur++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",$7(`actor${Ur}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Ur,e.links!=null&&g.attr("id","root-"+Ur),l==="neo"&&g.attr("data-look","neo"));const m=Yo();var y="actor";(w=e.properties)!=null&&w.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${zf}`:y+=` ${Ff}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.rx=3,m.ry=3,m.name=e.name,l==="neo"&&(m.rx=6,m.ry=6);const v=Lk(g,m),T=i.get(e.name)??0;if(Kh.has(u)&&(v.style("stroke",f[T%f.length]),v.style("fill",d[T%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),e.rectData=m,(C=e.properties)!=null&&C.icon){const S=e.properties.icon.trim();S.charAt(0)==="@"?hW(g,m.x+m.width-20,m.y+10,S.substr(1)):uW(g,m.x+m.width-20,m.y+10,S)}n||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),Zh(r,$i(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${O7}`},r);let b=e.height;if(v.node){const S=v.node().getBBox();e.height=S.height,b=S.height}return b},"drawActorTypeParticipant"),Q6t=x(function(t,e,r,n,i){var k,E;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Ur++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",$7(`actor${Ur}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Ur,e.links!=null&&g.attr("id","root-"+Ur),l==="neo"&&g.attr("data-look","neo"));const m=Yo();var y="actor";(k=e.properties)!=null&&k.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${zf}`:y+=` ${Ff}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.name=e.name;const v=6,T={...m,x:m.x+-v,y:m.y+ +v,class:"actor"},b=Lk(g,m),w=Lk(g,T);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const C=i.get(e.name)??0;if(Kh.has(u)&&(b.style("stroke",f[C%f.length]),b.style("fill",d[C%f.length]),w.style("stroke",f[C%f.length]),w.style("fill",d[C%f.length])),(E=e.properties)!=null&&E.icon){const _=e.properties.icon.trim();_.charAt(0)==="@"?hW(g,m.x+m.width-20,m.y+10,_.substr(1)):uW(g,m.x+m.width-20,m.y+10,_)}Zh(r,$i(e.description))(e.description,g,m.x-v,m.y+v,m.width,m.height,{class:`actor ${O7}`},r);let S=e.height;if(b.node){const _=b.node().getBBox();e.height=_.height,S=_.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),S},"drawActorTypeCollections"),J6t=x(function(t,e,r,n,i){var _,M;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(Ur++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",$7(`actor${Ur}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Ur,e.links!=null&&g.attr("id","root-"+Ur),l==="neo"&&g.attr("data-look","neo"));const m=Yo();let y="actor";(_=e.properties)!=null&&_.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${zf}`:y+=` ${Ff}`,g.attr("class",y),m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.name=e.name;const v=m.height/2,T=v/(2.5+m.height/50),b=g.append("g"),w=g.append("g"),C=`M ${m.x},${m.y+v} a ${T},${v} 0 0 0 0,${m.height} h ${m.width-2*T} a ${T},${v} 0 0 0 0,-${m.height} Z `;b.append("path").attr("d",C),w.append("path").attr("d",`M ${m.x},${m.y+v} - a ${T},${v} 0 0 0 0,${m.height}`),b.attr("transform",`translate(${T}, ${-(m.height/2)})`),w.attr("transform",`translate(${m.width-T}, ${-m.height/2})`),e.rectData=m,l==="neo"&&b.attr("filter","url(#drop-shadow)");const S=i.get(e.name)??0;if(Kh.has(u)&&(b.style("stroke",f[S%f.length]),b.style("fill",d[S%f.length]),w.style("stroke",f[S%f.length]),w.style("fill",d[S%f.length])),(M=e.properties)!=null&&M.icon){const L=e.properties.icon.trim(),P=m.x+m.width-20,D=m.y+10;L.charAt(0)==="@"?hW(g,P,D,L.substr(1)):uW(g,P,D,L)}Zh(r,$i(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${O7}`},r);let k=e.height;const E=b.select("path:last-child");if(E.node()){const L=E.node().getBBox();e.height=L.height,k=L.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),k},"drawActorTypeQueue"),Z6t=x(function(t,e,r,n,i,a){var _;const s=n?e.stopy:e.starty,o=e.x+e.width/2,l=s+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,y=t.append("g").lower();n||(Ur++,y.append("line").attr("id","actor"+Ur).attr("x1",o).attr("y1",l).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Ur);const v=t.append("g");let T=j0;n?T+=` ${zf}`:T+=` ${Ff}`,v.attr("class",T),v.attr("name",e.name);const b=Yo();b.x=e.x,b.y=s,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor";const w=e.x+e.width/2,C=s+32,S=22;v.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),v.append("circle").attr("cx",w).attr("cy",C).attr("r",S).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${C-S})`);const k=a.get(e.name)??0;Kh.has(h)?(v.style("stroke",p[k%p.length]),v.style("fill",f[k%p.length])):(v.style("stroke",g),v.style("fill",m));const E=v.node().getBBox();return e.height=E.height+2*(((_=r==null?void 0:r.sequence)==null?void 0:_.labelBoxHeight)??0),Zh(r,$i(e.description))(e.description,v,b.x,b.y+S+(n?5:12),b.width,b.height,{class:`actor ${j0}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),Q6t=x(function(t,e,r,n,i){var S;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+75,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower(),g=t.append("g");let m="actor";n?m+=` ${zf}`:m+=` ${Ff}`,g.attr("class",m),g.attr("name",e.name);const y=Yo();y.x=e.x,y.y=a,y.fill="#eaeaea",y.width=e.width,y.height=e.height,y.class="actor";const v=e.x+e.width/2,T=a+(n?10:25),b=22;g.append("circle").attr("cx",v).attr("cy",T).attr("r",b).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",v-b).attr("x2",v+b).attr("y1",T+b).attr("y2",T+b).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const w=i.get(e.name)??0;Kh.has(u)&&(g.style("stroke",f[w%f.length]),g.style("fill",d[w%f.length]));const C=g.node().getBBox();return e.height=C.height+(((S=r==null?void 0:r.sequence)==null?void 0:S.labelBoxHeight)??0),n||(Ur++,p.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Ur),Zh(r,$i(e.description))(e.description,g,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${j0}`},r),n?g.attr("transform",`translate(0, ${b})`):(g.attr("transform",`translate(0, ${b/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),J6t=x(function(t,e,r,n,i){var M;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height+2*r.boxTextMargin,{theme:l,themeVariables:u,look:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=u,g=t.append("g").lower();let m=g;n||(Ur++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",$7(`actor${Ur}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),m=g.append("g"),e.actorCnt=Ur,e.links!=null&&m.attr("id","root-"+Ur),h==="neo"&&m.attr("data-look","neo"));const y=Yo();let v="actor";(M=e.properties)!=null&&M.class?v=e.properties.class:y.fill="#eaeaea",n?v+=` ${zf}`:v+=` ${Ff}`,y.x=e.x,y.y=a,y.width=e.width,y.height=e.height,y.class=v,y.name=e.name,y.x=e.x,y.y=a;const T=y.width/3,b=y.width/3,w=T/2,C=w/(2.5+T/50),S=m.append("g");S.attr("class",v);const k=` + a ${T},${v} 0 0 0 0,${m.height}`),b.attr("transform",`translate(${T}, ${-(m.height/2)})`),w.attr("transform",`translate(${m.width-T}, ${-m.height/2})`),e.rectData=m,l==="neo"&&b.attr("filter","url(#drop-shadow)");const S=i.get(e.name)??0;if(Kh.has(u)&&(b.style("stroke",f[S%f.length]),b.style("fill",d[S%f.length]),w.style("stroke",f[S%f.length]),w.style("fill",d[S%f.length])),(M=e.properties)!=null&&M.icon){const L=e.properties.icon.trim(),P=m.x+m.width-20,D=m.y+10;L.charAt(0)==="@"?hW(g,P,D,L.substr(1)):uW(g,P,D,L)}Zh(r,$i(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${O7}`},r);let k=e.height;const E=b.select("path:last-child");if(E.node()){const L=E.node().getBBox();e.height=L.height,k=L.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),k},"drawActorTypeQueue"),eRt=x(function(t,e,r,n,i,a){var _;const s=n?e.stopy:e.starty,o=e.x+e.width/2,l=s+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,y=t.append("g").lower();n||(Ur++,y.append("line").attr("id","actor"+Ur).attr("x1",o).attr("y1",l).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Ur);const v=t.append("g");let T=j0;n?T+=` ${zf}`:T+=` ${Ff}`,v.attr("class",T),v.attr("name",e.name);const b=Yo();b.x=e.x,b.y=s,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor";const w=e.x+e.width/2,C=s+32,S=22;v.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),v.append("circle").attr("cx",w).attr("cy",C).attr("r",S).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${C-S})`);const k=a.get(e.name)??0;Kh.has(h)?(v.style("stroke",p[k%p.length]),v.style("fill",f[k%p.length])):(v.style("stroke",g),v.style("fill",m));const E=v.node().getBBox();return e.height=E.height+2*(((_=r==null?void 0:r.sequence)==null?void 0:_.labelBoxHeight)??0),Zh(r,$i(e.description))(e.description,v,b.x,b.y+S+(n?5:12),b.width,b.height,{class:`actor ${j0}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),tRt=x(function(t,e,r,n,i){var S;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+75,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower(),g=t.append("g");let m="actor";n?m+=` ${zf}`:m+=` ${Ff}`,g.attr("class",m),g.attr("name",e.name);const y=Yo();y.x=e.x,y.y=a,y.fill="#eaeaea",y.width=e.width,y.height=e.height,y.class="actor";const v=e.x+e.width/2,T=a+(n?10:25),b=22;g.append("circle").attr("cx",v).attr("cy",T).attr("r",b).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",v-b).attr("x2",v+b).attr("y1",T+b).attr("y2",T+b).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const w=i.get(e.name)??0;Kh.has(u)&&(g.style("stroke",f[w%f.length]),g.style("fill",d[w%f.length]));const C=g.node().getBBox();return e.height=C.height+(((S=r==null?void 0:r.sequence)==null?void 0:S.labelBoxHeight)??0),n||(Ur++,p.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Ur),Zh(r,$i(e.description))(e.description,g,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${j0}`},r),n?g.attr("transform",`translate(0, ${b})`):(g.attr("transform",`translate(0, ${b/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),rRt=x(function(t,e,r,n,i){var M;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height+2*r.boxTextMargin,{theme:l,themeVariables:u,look:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=u,g=t.append("g").lower();let m=g;n||(Ur++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",$7(`actor${Ur}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),m=g.append("g"),e.actorCnt=Ur,e.links!=null&&m.attr("id","root-"+Ur),h==="neo"&&m.attr("data-look","neo"));const y=Yo();let v="actor";(M=e.properties)!=null&&M.class?v=e.properties.class:y.fill="#eaeaea",n?v+=` ${zf}`:v+=` ${Ff}`,y.x=e.x,y.y=a,y.width=e.width,y.height=e.height,y.class=v,y.name=e.name,y.x=e.x,y.y=a;const T=y.width/3,b=y.width/3,w=T/2,C=w/(2.5+T/50),S=m.append("g");S.attr("class",v);const k=` M ${y.x},${y.y+C} a ${w},${C} 0 0 0 ${T},0 a ${w},${C} 0 0 0 -${T},0 l 0,${b-2*C} a ${w},${C} 0 0 0 ${T},0 l 0,-${b-2*C} -`;S.append("path").attr("d",k),h==="neo"&&S.attr("filter","url(#drop-shadow)");const E=i.get(e.name)??0;Kh.has(l)?(S.style("stroke",f[E%f.length]),S.style("fill",d[E%f.length])):S.style("stroke",p),S.attr("transform",`translate(${T}, ${C})`),e.rectData=y,Zh(r,$i(e.description))(e.description,m,y.x,y.y+35,y.width,y.height,{class:`actor ${O7}`},r);const _=S.select("path:last-child");if(_.node()){const L=_.node().getBBox();e.height=L.height+(r.sequence.labelBoxHeight??0)}return n||(m.attr("data-et","participant"),m.attr("data-type","database"),m.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),eRt=x(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(Ur++,u.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Ur);const y=t.append("g");let v=j0;n?v+=` ${zf}`:v+=` ${Ff}`,y.attr("class",v),y.attr("name",e.name);const T=Yo();T.x=e.x,T.y=a,T.fill="#eaeaea",T.width=e.width,T.height=e.height,T.class="actor",y.append("line").attr("id","actor-man-torso"+Ur).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+12).attr("x2",e.x+e.width/2-15).attr("y2",a+12),y.append("line").attr("id","actor-man-arms"+Ur).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+2).attr("x2",e.x+e.width/2-l*2.5).attr("y2",a+22),y.append("circle").attr("cx",e.x+e.width/2).attr("cy",a+12).attr("r",l),h==="neo"&&y.attr("filter","url(#drop-shadow)");const b=i.get(e.name)??0;Kh.has(d)?(y.style("stroke",g[b%g.length]),y.style("fill",p[b%g.length])):y.style("stroke",m);const w=y.node().getBBox();return e.height=w.height+(r.sequence.labelBoxHeight??0),Zh(r,$i(e.description))(e.description,y,T.x,T.y+15,T.width,T.height,{class:`actor ${j0}`},r),y.attr("transform",`translate(0,${l/2+10})`),n||(y.attr("data-et","participant"),y.attr("data-type","boundary"),y.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),tRt=x(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(Ur++,g.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Ur);const m=t.append("g");let y=j0;n?y+=` ${zf}`:y+=` ${Ff}`,m.attr("class",y),m.attr("name",e.name),n||m.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const v=l==="neo"?.5:1,T=l==="neo"?a+(1-v)*30:a;m.append("line").attr("id","actor-man-torso"+Ur).attr("x1",s).attr("y1",T+25*v).attr("x2",s).attr("y2",T+45*v),m.append("line").attr("id","actor-man-arms"+Ur).attr("x1",s-i0/2*v).attr("y1",T+33*v).attr("x2",s+i0/2*v).attr("y2",T+33*v),m.append("line").attr("x1",s-i0/2*v).attr("y1",T+60*v).attr("x2",s).attr("y2",T+45*v),m.append("line").attr("x1",s).attr("y1",T+45*v).attr("x2",s+(i0/2-2)*v).attr("y2",T+60*v);const b=m.append("circle");b.attr("cx",e.x+e.width/2),b.attr("cy",T+10*v),b.attr("r",15*v),b.attr("width",e.width*v),b.attr("height",e.height*v);const w=m.node().getBBox();e.height=w.height;const C=Yo();C.x=e.x,C.y=T,C.fill="#eaeaea",C.width=e.width,C.height=e.height/v,C.class="actor",C.rx=3,C.ry=3;const S=i.get(e.name)??0;return Kh.has(u)?(m.style("stroke",f[S%f.length]),m.style("fill",d[S%f.length])):m.style("stroke",p),Zh(r,$i(e.description))(e.description,m,C.x,T+35*v-(l==="neo"?10:0),C.width,C.height,{class:`actor ${j0}`},r),e.height},"drawActorTypeActor"),rRt=x(async function(t,e,r,n,i,a,s){const o=s??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await tRt(t,e,r,n,o);case"participant":return await X6t(t,e,r,n,o);case"boundary":return await eRt(t,e,r,n,o);case"control":return await Z6t(t,e,r,n,i,o);case"entity":return await Q6t(t,e,r,n,o);case"database":return await J6t(t,e,r,n,o);case"collections":return await j6t(t,e,r,n,o);case"queue":return await K6t(t,e,r,n,o)}},"drawActor"),nRt=x(function(t,e,r){const i=t.append("g");L_e(i,e),e.name&&Zh(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),iRt=x(function(t){return t.append("g")},"anchorElement"),aRt=x(function(t,e,r,n,i,a,s){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=Yo(),p=e.anchored,g=e.actor;f.x=e.startx,f.y=e.starty,f.class="activation"+i%3,f.width=e.stopx-e.startx,f.height=r-e.starty;const m=Lk(p,f),v=(s??new Map([...a.db.getActors().values()].map((T,b)=>[T.name,b]))).get(g)??0;Kh.has(o)&&(m.style("stroke",h[v%h.length]),m.style("fill",u[v%h.length]??d))},"drawActivation"),sRt=x(async function(t,e,r,n,i){const{boxMargin:a,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,f=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=x(function(y,v,T,b){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",T).attr("y2",b).attr("class","loopLine")},"drawLoopLine");p(e.startx,e.starty,e.stopx,e.starty),p(e.stopx,e.starty,e.stopx,e.stopy),p(e.startx,e.stopy,e.stopx,e.stopy),p(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(y){p(e.startx,y.y,e.stopx,y.y).style("stroke-dasharray","3, 3")});let g=dW();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(l??0,50),g.height=o+(n.look==="neo"?15:0)||20,g.textMargin=s,g.class="labelText",__e(f,g),g=M_e(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+a+s,g.anchor="middle",g.valign="middle",g.textMargin=s,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=$i(g.text)?await w6(f,g,e):lx(f,g);if(e.sectionTitles!==void 0){for(const[y,v]of Object.entries(e.sectionTitles))if(v.message){g.text=v.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[y].y+a+s,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=e.wrap,$i(g.text)?(e.starty=e.sections[y].y,await w6(f,g,e)):lx(f,g);let T=Math.round(m.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,w)=>b+w));e.sections[y].height+=T-(a+s)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),L_e=x(function(t,e){q2e(t,e)},"drawBackgroundRect"),oRt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),lRt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),cRt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),uRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),hRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),dRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),fRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),pRt=x(function(t,e){const{theme:r}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),M_e=x(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),gRt=x(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Zh=(function(){function t(a,s,o,l,u,h,d){const f=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}x(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[y,v]=Oh(p),T=a.split(At.lineBreakRegex);for(let b=0;bt.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:x(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:x(function(t){this.boxes.push(t)},"addBox"),addActor:x(function(t){this.actors.push(t)},"addActor"),addLoop:x(function(t){this.loops.push(t)},"addLoop"),addMessage:x(function(t){this.messages.push(t)},"addMessage"),addNote:x(function(t){this.notes.push(t)},"addNote"),lastActor:x(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:x(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:x(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:x(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:x(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,D_e(Fe())},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=this;let a=0;function s(o){return x(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*Ye.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*Ye.boxMargin,Math.max),i.updateVal(bt.data,"startx",t-h*Ye.boxMargin,Math.min),i.updateVal(bt.data,"stopx",r+h*Ye.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*Ye.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*Ye.boxMargin,Math.max),i.updateVal(bt.data,"starty",e-h*Ye.boxMargin,Math.min),i.updateVal(bt.data,"stopy",n+h*Ye.boxMargin,Math.max))},"updateItemBounds")}x(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:x(function(t,e,r,n){const i=At.getMin(t,r),a=At.getMax(t,r),s=At.getMin(e,n),o=At.getMax(e,n);this.updateVal(bt.data,"startx",i,Math.min),this.updateVal(bt.data,"starty",s,Math.min),this.updateVal(bt.data,"stopx",a,Math.max),this.updateVal(bt.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:x(function(t,e,r){const n=r.get(t.from),i=P7(t.from).length||0,a=n.x+n.width/2+(i-1)*Ye.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Ye.activationWidth,stopy:void 0,actor:t.from,anchored:Fn.anchorElement(e)})},"newActivation"),endActivation:x(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:x(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:x(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:x(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:bt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:x(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:x(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=At.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return{bounds:this.data,models:this.models}},"getBounds")},TRt=x(async function(t,e,r){bt.bumpVerticalPos(Ye.boxMargin),e.height=Ye.boxMargin,e.starty=bt.getVerticalPos();const n=Yo();n.x=e.startx,n.y=e.starty,n.width=e.width||Ye.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=Fn.drawRect(i,n),s=dW();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=Ye.noteFontFamily,s.fontSize=Ye.noteFontSize,s.fontWeight=Ye.noteFontWeight,s.anchor=Ye.noteAlign,s.textMargin=Ye.noteMargin,s.valign="center";const o=$i(s.text)?await w6(i,s):lx(i,s),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));a.attr("height",l+2*Ye.noteMargin),e.height+=l+2*Ye.noteMargin,bt.bumpVerticalPos(l+2*Ye.noteMargin),e.stopy=e.starty+l+2*Ye.noteMargin,e.stopx=e.startx+n.width,bt.insert(e.startx,e.starty,e.stopx,e.stopy),bt.models.addNote(e)},"drawNote"),mie=x(function(t,e,r,n,i,a,s){const o=n.db.getActors(),l=o.get(e.from),u=o.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=B_e(e,n),m=t.append("g"),y=16.5,v=x((S,k)=>{const E=S?y:-y;return k?-E:E},"getCircleOffset"),T=x(S=>{m.append("circle").attr("cx",S).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:w,CENTRAL_CONNECTION_DUAL:C}=n.db.LINETYPE;if(h)switch(e.centralConnection){case b:g&&(f+=v(p,!0));break;case w:g||(d+=v(p,!1));break;case C:g?f+=v(p,!0):d+=v(p,!1);break}switch(e.centralConnection){case b:T(f);break;case w:T(d);break;case C:T(d),T(f);break}},"drawCentralConnection"),K0=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),Pm=x(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),BB=x(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function I_e(t,e){bt.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=At.splitBreaks(i).length,s=$i(i),o=s?await Yk(i,Fe()):yr.calculateTextDimensions(i,K0(Ye));if(!s){const d=o.height/a;e.height+=d,bt.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=bt.getVerticalPos()+u,Ye.rightAngles||(u+=Ye.boxMargin,l=bt.getVerticalPos()+u),u+=30;const d=At.getMax(h/2,Ye.width/2);bt.insert(r-d,bt.getVerticalPos()-10+u,n+d,bt.getVerticalPos()+30+u)}else u+=Ye.boxMargin,l=bt.getVerticalPos()+u,bt.insert(r,l-10,n,l);return bt.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,bt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}x(I_e,"boundMessage");var wRt=x(async function(t,e,r,n,i,a){const{startx:s,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=yr.calculateTextDimensions(u,K0(Ye)),g=dW();g.x=Math.min(s,o),g.y=l+10,g.width=Math.abs(o-s),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=Ye.messageFontFamily,g.fontSize=Ye.messageFontSize,g.fontWeight=Ye.messageFontWeight,g.anchor=Ye.messageAlign,g.valign="center",g.textMargin=Ye.wrapPadding,g.tspan=!1,$i(g.text)?await w6(t,g,{startx:s,stopx:o,starty:r}):lx(t,g);const m=p.width;let y;if(s===o){const T=f||Ye.showSequenceNumbers,b=B_e(i,n),w=RRt(i,n),C=s+(T&&(b||w)?10:0);Ye.rightAngles?y=t.append("path").attr("d",`M ${C},${r} H ${s+At.getMax(Ye.width/2,m/2)} V ${r+25} H ${s}`):y=t.append("path").attr("d","M "+C+","+r+" C "+(C+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)),zN(i,n)&&mie(t,i,e,n,s,o,r)}else y=t.append("line"),y.attr("x1",s),y.attr("y1",r),y.attr("x2",o),y.attr("y2",r),zN(i,n)&&mie(t,i,e,n,s,o,r);h===n.db.LINETYPE.DOTTED||h===n.db.LINETYPE.DOTTED_CROSS||h===n.db.LINETYPE.DOTTED_POINT||h===n.db.LINETYPE.DOTTED_OPEN||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===n.db.LINETYPE.SOLID_TOP_DOTTED||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===n.db.LINETYPE.STICK_TOP_DOTTED||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0"),y.attr("data-et","message"),y.attr("data-id","i"+e.id),y.attr("data-from",e.from),y.attr("data-to",e.to);let v="";if(Ye.arrowMarkerAbsolute&&(v=J6(!0)),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),(h===n.db.LINETYPE.SOLID_TOP||h===n.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr("marker-start","url("+v+"#"+a+"-arrowhead)"),y.attr("marker-end","url("+v+"#"+a+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&y.attr("marker-end","url("+v+"#"+a+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&y.attr("marker-end","url("+v+"#"+a+"-crosshead)"),f||Ye.showSequenceNumbers){const T=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,w=6,C=zN(i,n);let S=s,k=o;T?(ss?k=o-2*w:(k=o-w,S+=(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),k+=C?15:0,y.attr("x2",k),y.attr("x1",S)):y.attr("x1",s+w);let E=0;const _=s===o,M=s<=o;_?E=e.fromBounds+1:b?E=M?e.toBounds-1:e.fromBounds+1:E=M?e.fromBounds+1:e.toBounds-1;let L="12px";const P=d.toString().length;P>5?L="7px":P>3&&(L="9px"),t.append("line").attr("x1",E).attr("y1",r).attr("x2",E).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+v+"#"+a+"-sequencenumber)"),t.append("text").attr("x",E).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",L).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),CRt=x(function(t,e,r,n,i,a,s){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(s||bt.models.addBox(u),l+=Ye.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=At.getMax(f.width||Ye.width,Ye.width),f.height=At.getMax(f.height||Ye.height,Ye.height),f.margin=f.margin||Ye.actorMargin,h=At.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=bt.getVerticalPos(),bt.insert(f.x,i,f.x+f.width,f.height),o+=f.width+l,f.box&&(f.box.width=o+p.margin-f.box.x),l=f.margin,u=f.box,bt.models.addActor(f)}u&&!s&&bt.models.addBox(u),bt.bumpVerticalPos(h)},"addActorRenderingData"),FB=x(async function(t,e,r,n,i,a,s){if(n){let o=0;bt.bumpVerticalPos(Ye.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=bt.getVerticalPos());const h=await Fn.drawActor(t,u,Ye,!0,i,a,s);o=At.getMax(o,h)}bt.bumpVerticalPos(o+Ye.boxMargin)}else for(const o of r){const l=e.get(o);await Fn.drawActor(t,l,Ye,!1,i,a,s)}},"drawActors"),N_e=x(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=SRt(o),u=Fn.drawPopup(t,o,l,Ye,Ye.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),D_e=x(function(t){Wi(Ye,t),t.fontFamily&&(Ye.actorFontFamily=Ye.noteFontFamily=Ye.messageFontFamily=t.fontFamily),t.fontSize&&(Ye.actorFontSize=Ye.noteFontSize=Ye.messageFontSize=t.fontSize),t.fontWeight&&(Ye.actorFontWeight=Ye.noteFontWeight=Ye.messageFontWeight=t.fontWeight)},"setConf"),P7=x(function(t){return bt.activations.filter(function(e){return e.actor===t})},"actorActivations"),yie=x(function(t,e){const r=e.get(t),n=P7(t),i=n.reduce(function(s,o){return At.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return At.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function Ll(t,e,r,n,i){bt.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=K0(Ye);e.message=yr.wrapLabel(`[${e.message}]`,s-2*Ye.wrapPadding,o),e.width=s,e.wrap=!0;const l=yr.calculateTextDimensions(e.message,o),u=At.getMax(l.height,Ye.labelBoxHeight);a=n+u,le.debug(`${u} - ${e.message}`)}i(e),bt.bumpVerticalPos(a)}x(Ll,"adjustLoopHeightForWrap");function O_e(t,e,r,n,i,a,s){function o(h,d){h.x{B.add(G.from),B.add(G.to)}),y=y.filter(G=>B.has(G))}const S=new Map(y.map((B,G)=>{var H;return[((H=f.get(B))==null?void 0:H.name)??B,G]}));CRt(d,f,p,y,0,v,!1);const k=await MRt(v,f,C,n);Fn.insertArrowHead(d,e),Fn.insertArrowCrossHead(d,e),Fn.insertArrowFilledHead(d,e),Fn.insertSequenceNumber(d,e),Fn.insertSolidTopArrowHead(d,e),Fn.insertSolidBottomArrowHead(d,e),Fn.insertStickTopArrowHead(d,e),Fn.insertStickBottomArrowHead(d,e),s==="neo"&&Fn.insertDropShadow(d,Ye);function E(B,G){const H=bt.endActivation(B);H.starty+18>G&&(H.starty=G-6,G+=12),Fn.drawActivation(d,H,G,Ye,P7(B.from).length,n,S),bt.insert(H.startx,G-10,H.stopx,G)}x(E,"activeEnd");let _=1,M=1;const L=[],P=[];let D=0;for(const B of v){let G,H,q;switch(B.type){case n.db.LINETYPE.NOTE:bt.resetVerticalPos(),H=B.noteModel,await TRt(d,H,B.id);break;case n.db.LINETYPE.ACTIVE_START:bt.newActivation(B,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:bt.newActivation(B,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:bt.newActivation(B,d,f);break;case n.db.LINETYPE.ACTIVE_END:E(B,bt.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z));break;case n.db.LINETYPE.LOOP_END:G=bt.endLoop(),await Fn.drawLoop(d,G,"loop",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;case n.db.LINETYPE.RECT_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin,Z=>{let Y=Z.message;Y||(Y=(o==null?void 0:o.rectBkgColor)||(o==null?void 0:o.actorBkg)||"rgba(128, 128, 128, 0.5)"),bt.newLoop(void 0,Y)});break;case n.db.LINETYPE.RECT_END:G=bt.endLoop(),P.push(G),bt.models.addLoop(G),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos());break;case n.db.LINETYPE.OPT_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z));break;case n.db.LINETYPE.OPT_END:G=bt.endLoop(),await Fn.drawLoop(d,G,"opt",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;case n.db.LINETYPE.ALT_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z));break;case n.db.LINETYPE.ALT_ELSE:Ll(k,B,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,Z=>bt.addSectionToLoop(Z));break;case n.db.LINETYPE.ALT_END:G=bt.endLoop(),await Fn.drawLoop(d,G,"alt",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z)),bt.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:Ll(k,B,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,Z=>bt.addSectionToLoop(Z));break;case n.db.LINETYPE.PAR_END:G=bt.endLoop(),await Fn.drawLoop(d,G,"par",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;case n.db.LINETYPE.AUTONUMBER:_=B.message.start||_,M=B.message.step||M,B.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z));break;case n.db.LINETYPE.CRITICAL_OPTION:Ll(k,B,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,Z=>bt.addSectionToLoop(Z));break;case n.db.LINETYPE.CRITICAL_END:G=bt.endLoop(),await Fn.drawLoop(d,G,"critical",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;case n.db.LINETYPE.BREAK_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z));break;case n.db.LINETYPE.BREAK_END:G=bt.endLoop(),await Fn.drawLoop(d,G,"break",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;default:try{q=B.msgModel,q.starty=bt.getVerticalPos(),q.sequenceIndex=_,q.sequenceVisible=n.db.showSequenceNumbers(),q.id=B.id,q.from=B.from,q.to=B.to;const Z=await I_e(d,q);O_e(B,q,Z,D,f,p,g),L.push({messageModel:q,lineStartY:Z,msg:B}),bt.models.addMessage(q)}catch(Z){le.error("error while drawing message",Z)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(B.type)&&(_=Math.round((_+M)*100)/100),D++}le.debug("createdActors",p),le.debug("destroyedActors",g),await FB(d,f,y,!1,e,n,S);for(const B of L)await wRt(d,B.messageModel,B.lineStartY,n,B.msg,e);Ye.mirrorActors&&await FB(d,f,y,!0,e,n,S),P.forEach(B=>Fn.drawBackgroundRect(d,B)),R_e(d,f,y,Ye);for(const B of bt.models.boxes){B.height=bt.getVerticalPos()-B.y,bt.insert(B.x,B.y,B.x+B.width,B.height);const G=Ye.boxMargin*2;B.startx=B.x-G,B.starty=B.y-G*.25,B.stopx=B.startx+B.width+2*G,B.stopy=B.starty+B.height+G*.75,B.stroke="rgb(0,0,0, 0.5)",Fn.drawBox(d,B,Ye)}b&&bt.bumpVerticalPos(Ye.boxMargin);const R=N_e(d,f,y,h),{bounds:I}=bt.getBounds();I.startx===void 0&&(I.startx=0),I.starty===void 0&&(I.starty=0),I.stopx===void 0&&(I.stopx=0),I.stopy===void 0&&(I.stopy=0);let $=I.stopy-I.starty;${const s=K0(Ye);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=Ye.boxMargin*8;o+=l,o-=2*Ye.boxTextMargin,a.wrap&&(a.name=yr.wrapLabel(a.name,o-2*Ye.wrapPadding,s));const u=yr.calculateTextDimensions(a.name,s);i=At.getMax(u.height,i);const h=At.getMax(o,u.width+2*Ye.wrapPadding);if(a.margin=Ye.boxTextMargin,oa.textMaxHeight=i),At.getMax(n,Ye.height)}x(P_e,"calculateActorMargins");var ERt=x(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=$i(t.message)?await Yk(t.message,Fe()):yr.calculateTextDimensions(o?yr.wrapLabel(t.message,Ye.width,Pm(Ye)):t.message,Pm(Ye));const u={width:o?Ye.width:At.getMax(Ye.width,l.width+2*Ye.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=o?At.getMax(Ye.width,l.width):At.getMax(n.width/2+i.width/2,l.width+2*Ye.noteMargin),u.startx=a+(n.width+Ye.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?At.getMax(Ye.width,l.width+2*Ye.noteMargin):At.getMax(n.width/2+i.width/2,l.width+2*Ye.noteMargin),u.startx=a-u.width+(n.width-Ye.actorMargin)/2):t.to===t.from?(l=yr.calculateTextDimensions(o?yr.wrapLabel(t.message,At.getMax(Ye.width,n.width),Pm(Ye)):t.message,Pm(Ye)),u.width=o?At.getMax(Ye.width,n.width):At.getMax(n.width,Ye.width,l.width+2*Ye.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+Ye.actorMargin,u.startx=a2,f=x(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(Ye.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(h+=f(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=f(3)));const p=[i,a,s,o],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=yr.wrapLabel(t.message,At.getMax(g+2*Ye.wrapPadding,Ye.width),K0(Ye)));const m=yr.calculateTextDimensions(t.message,K0(Ye));return{width:At.getMax(t.wrap?0:m.width+2*Ye.wrapPadding,g+2*Ye.wrapPadding,Ye.width),height:0,startx:u,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),MRt=x(async function(t,e,r,n){const i={},a=[];let s,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(s=a.pop(),i[s.id]=s,i[u.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=P7(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*Ye.activationWidth/2,g={startx:p,stopx:p+Ye.activationWidth,actor:u.from,enabled:!0};bt.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=bt.activations.map(f=>f.actor).lastIndexOf(u.from);bt.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await ERt(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=At.getMin(s.from,o.startx),s.to=At.getMax(s.to,o.startx+o.width),s.width=At.getMax(s.width,Math.abs(s.from-s.to))-Ye.labelBoxWidth})):(l=LRt(u,e,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(d=>{if(s=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);s.from=At.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=At.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=At.getMax(s.width,Math.abs(s.to-s.from))-Ye.labelBoxWidth}else s.from=At.getMin(l.startx,s.from),s.to=At.getMax(l.stopx,s.to),s.width=At.getMax(s.width,l.width)-Ye.labelBoxWidth}))}return bt.activations=[],le.debug("Loop type widths:",i),i},"calculateLoopBounds"),IRt={bounds:bt,drawActors:FB,drawActorsPopup:N_e,setConf:D_e,draw:kRt},NRt={parser:z6t,get db(){return new H6t},renderer:IRt,styles:U6t,init:x(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,jD({sequence:{wrap:t.wrap}}))},"init")};const DRt=Object.freeze(Object.defineProperty({__proto__:null,diagram:NRt},Symbol.toStringTag,{value:"Module"}));var zB=(function(){var t=x(function(de,Te,ae,he){for(ae=ae||{},he=de.length;he--;ae[de[he]]=Te);return ae},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,26],s=[1,42],o=[1,24],l=[1,25],u=[1,32],h=[1,33],d=[1,34],f=[1,45],p=[1,35],g=[1,36],m=[1,37],y=[1,38],v=[1,27],T=[1,28],b=[1,29],w=[1,30],C=[1,31],S=[1,44],k=[1,46],E=[1,43],_=[1,47],M=[1,9],L=[1,8,9],P=[1,58],D=[1,59],R=[1,60],I=[1,61],$=[1,62],O=[1,63],N=[1,64],F=[1,8,9,41],z=[1,77],V=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],B=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],G=[13,60,86,100,102,103],H=[13,60,73,74,86,100,102,103],q=[13,60,68,69,70,71,72,86,100,102,103],Z=[1,103],Y=[1,121],ie=[1,117],K=[1,113],Q=[1,119],te=[1,114],J=[1,115],ge=[1,116],ee=[1,118],Re=[1,120],Ie=[22,50,60,61,82,86,87,88,89,90],Be=[1,128],ce=[12,39],oe=[1,8,9,39,41,44,46],be=[1,8,9,22],fe=[1,153],Pe=[1,8,9,61],ve=[1,8,9,22,50,60,61,82,86,87,88,89,90],Ce={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:x(function(Te,ae,he,W,ne,j,ue){var X=j.length-1;switch(ne){case 8:this.$=j[X-1];break;case 9:case 10:case 13:case 15:this.$=j[X];break;case 11:case 14:this.$=j[X-2]+"."+j[X];break;case 12:case 16:this.$=j[X-1]+j[X];break;case 17:case 18:this.$=j[X-1]+"~"+j[X]+"~";break;case 19:W.addRelation(j[X]);break;case 20:j[X-1].title=W.cleanupLabel(j[X]),W.addRelation(j[X-1]);break;case 31:this.$=j[X].trim(),W.setAccTitle(this.$);break;case 32:case 33:this.$=j[X].trim(),W.setAccDescription(this.$);break;case 34:W.addClassesToNamespace(j[X-3],j[X-1][0],j[X-1][1]),W.popNamespace();break;case 35:W.addClassesToNamespace(j[X-4],j[X-1][0],j[X-1][1]),W.popNamespace();break;case 36:this.$=W.addNamespace(j[X]);break;case 37:this.$=W.addNamespace(j[X-1],j[X]);break;case 38:this.$=[[j[X]],[]];break;case 39:this.$=[[j[X-1]],[]];break;case 40:j[X][0].unshift(j[X-2]),this.$=j[X];break;case 41:this.$=[[],[j[X]]];break;case 42:this.$=[[],[j[X-1]]];break;case 43:j[X][1].unshift(j[X-2]),this.$=j[X];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=j[X];break;case 48:W.setCssClass(j[X-2],j[X]);break;case 49:W.addMembers(j[X-3],j[X-1]);break;case 51:W.setCssClass(j[X-5],j[X-3]),W.addMembers(j[X-5],j[X-1]);break;case 52:W.addAnnotation(j[X-3],j[X-1]);break;case 53:W.addAnnotation(j[X-6],j[X-4]),W.addMembers(j[X-6],j[X-1]);break;case 54:W.addAnnotation(j[X-5],j[X-3]);break;case 55:this.$=j[X],W.addClass(j[X]);break;case 56:this.$=j[X-1],W.addClass(j[X-1]),W.setClassLabel(j[X-1],j[X]);break;case 60:W.addAnnotation(j[X],j[X-2]);break;case 61:case 74:this.$=[j[X]];break;case 62:j[X].push(j[X-1]),this.$=j[X];break;case 63:break;case 64:W.addMember(j[X-1],W.cleanupLabel(j[X]));break;case 65:break;case 66:break;case 67:this.$={id1:j[X-2],id2:j[X],relation:j[X-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:j[X-3],id2:j[X],relation:j[X-1],relationTitle1:j[X-2],relationTitle2:"none"};break;case 69:this.$={id1:j[X-3],id2:j[X],relation:j[X-2],relationTitle1:"none",relationTitle2:j[X-1]};break;case 70:this.$={id1:j[X-4],id2:j[X],relation:j[X-2],relationTitle1:j[X-3],relationTitle2:j[X-1]};break;case 71:this.$=W.addNote(j[X],j[X-1]);break;case 72:this.$=W.addNote(j[X]);break;case 73:this.$=j[X-2],W.defineClass(j[X-1],j[X]);break;case 75:this.$=j[X-2].concat([j[X]]);break;case 76:W.setDirection("TB");break;case 77:W.setDirection("BT");break;case 78:W.setDirection("RL");break;case 79:W.setDirection("LR");break;case 80:this.$={type1:j[X-2],type2:j[X],lineType:j[X-1]};break;case 81:this.$={type1:"none",type2:j[X],lineType:j[X-1]};break;case 82:this.$={type1:j[X-1],type2:"none",lineType:j[X]};break;case 83:this.$={type1:"none",type2:"none",lineType:j[X]};break;case 84:this.$=W.relationType.AGGREGATION;break;case 85:this.$=W.relationType.EXTENSION;break;case 86:this.$=W.relationType.COMPOSITION;break;case 87:this.$=W.relationType.DEPENDENCY;break;case 88:this.$=W.relationType.LOLLIPOP;break;case 89:this.$=W.lineType.LINE;break;case 90:this.$=W.lineType.DOTTED_LINE;break;case 91:case 97:this.$=j[X-2],W.setClickEvent(j[X-1],j[X]);break;case 92:case 98:this.$=j[X-3],W.setClickEvent(j[X-2],j[X-1]),W.setTooltip(j[X-2],j[X]);break;case 93:this.$=j[X-2],W.setLink(j[X-1],j[X]);break;case 94:this.$=j[X-3],W.setLink(j[X-2],j[X-1],j[X]);break;case 95:this.$=j[X-3],W.setLink(j[X-2],j[X-1]),W.setTooltip(j[X-2],j[X]);break;case 96:this.$=j[X-4],W.setLink(j[X-3],j[X-2],j[X]),W.setTooltip(j[X-3],j[X-1]);break;case 99:this.$=j[X-3],W.setClickEvent(j[X-2],j[X-1],j[X]);break;case 100:this.$=j[X-4],W.setClickEvent(j[X-3],j[X-2],j[X-1]),W.setTooltip(j[X-3],j[X]);break;case 101:this.$=j[X-3],W.setLink(j[X-2],j[X]);break;case 102:this.$=j[X-4],W.setLink(j[X-3],j[X-1],j[X]);break;case 103:this.$=j[X-4],W.setLink(j[X-3],j[X-1]),W.setTooltip(j[X-3],j[X]);break;case 104:this.$=j[X-5],W.setLink(j[X-4],j[X-2],j[X]),W.setTooltip(j[X-4],j[X-1]);break;case 105:this.$=j[X-2],W.setCssStyle(j[X-1],j[X]);break;case 106:W.setCssClass(j[X-1],j[X]);break;case 107:this.$=[j[X]];break;case 108:j[X-2].push(j[X]),this.$=j[X-2];break;case 110:this.$=j[X-1]+j[X];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:w,83:C,86:S,100:k,102:E,103:_},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(M,[2,5],{8:[1,48]}),{8:[1,49]},t(L,[2,19],{22:[1,50]}),t(L,[2,21]),t(L,[2,22]),t(L,[2,23]),t(L,[2,24]),t(L,[2,25]),t(L,[2,26]),t(L,[2,27]),t(L,[2,28]),t(L,[2,29]),t(L,[2,30]),{34:[1,51]},{36:[1,52]},t(L,[2,33]),t(L,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:P,69:D,70:R,71:I,72:$,73:O,74:N}),{39:[1,65]},t(F,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(L,[2,65]),t(L,[2,66]),{16:69,60:f,86:S,100:k,102:E},{16:39,17:40,19:70,60:f,86:S,100:k,102:E,103:_},{16:39,17:40,19:71,60:f,86:S,100:k,102:E,103:_},{16:39,17:40,19:72,60:f,86:S,100:k,102:E,103:_},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:S,100:k,102:E,103:_},{13:z,55:76},{58:78,60:[1,79]},t(L,[2,76]),t(L,[2,77]),t(L,[2,78]),t(L,[2,79]),t(V,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:S,100:k,102:E,103:_}),t(V,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:S,100:k,102:E,103:_},{16:39,17:40,19:87,60:f,86:S,100:k,102:E,103:_},t(B,[2,133]),t(B,[2,134]),t(B,[2,135]),t(B,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(M,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:r,37:n,42:i,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:w,83:C,86:S,100:k,102:E,103:_}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:w,83:C,86:S,100:k,102:E,103:_},t(L,[2,20]),t(L,[2,31]),t(L,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:S,100:k,102:E,103:_},{53:92,66:56,67:57,68:P,69:D,70:R,71:I,72:$,73:O,74:N},t(L,[2,64]),{67:93,73:O,74:N},t(G,[2,83],{66:94,68:P,69:D,70:R,71:I,72:$}),t(H,[2,84]),t(H,[2,85]),t(H,[2,86]),t(H,[2,87]),t(H,[2,88]),t(q,[2,89]),t(q,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:s,54:u,56:h},{16:100,60:f,86:S,100:k,102:E},{41:[1,102],45:101,51:Z},{16:104,60:f,86:S,100:k,102:E},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:Y,50:ie,59:110,60:K,82:Q,84:111,85:112,86:te,87:J,88:ge,89:ee,90:Re},{60:[1,122]},{13:z,55:123},t(F,[2,72]),t(F,[2,138]),{22:Y,50:ie,59:124,60:K,61:[1,125],82:Q,84:111,85:112,86:te,87:J,88:ge,89:ee,90:Re},t(Ie,[2,74]),{16:39,17:40,19:126,60:f,86:S,100:k,102:E,103:_},t(V,[2,16]),t(V,[2,17]),t(V,[2,18]),{11:127,12:Be,39:[2,36]},t(ce,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:S,100:k,102:E,103:_}),t(ce,[2,10]),t(oe,[2,55],{11:131,12:Be}),t(M,[2,7]),{9:[1,132]},t(be,[2,67]),{16:39,17:40,19:133,60:f,86:S,100:k,102:E,103:_},{13:[1,135],16:39,17:40,19:134,60:f,86:S,100:k,102:E,103:_},t(G,[2,82],{66:136,68:P,69:D,70:R,71:I,72:$}),t(G,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:s,54:u,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(F,[2,48],{39:[1,142]}),{41:[1,143]},t(F,[2,50]),{41:[2,61],45:144,51:Z},{47:[1,145]},{16:39,17:40,19:146,60:f,86:S,100:k,102:E,103:_},t(L,[2,91],{13:[1,147]}),t(L,[2,93],{13:[1,149],77:[1,148]}),t(L,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(L,[2,105],{61:fe}),t(Pe,[2,107],{85:154,22:Y,50:ie,60:K,82:Q,86:te,87:J,88:ge,89:ee,90:Re}),t(ve,[2,109]),t(ve,[2,111]),t(ve,[2,112]),t(ve,[2,113]),t(ve,[2,114]),t(ve,[2,115]),t(ve,[2,116]),t(ve,[2,117]),t(ve,[2,118]),t(ve,[2,119]),t(L,[2,106]),t(F,[2,71]),t(L,[2,73],{61:fe}),{60:[1,155]},t(V,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:S,100:k,102:E,103:_},t(ce,[2,12]),t(oe,[2,56]),{1:[2,4]},t(be,[2,69]),t(be,[2,68]),{16:39,17:40,19:158,60:f,86:S,100:k,102:E,103:_},t(G,[2,80]),t(F,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:s,54:u,56:h},{45:163,51:Z},t(F,[2,49]),{41:[2,62]},t(F,[2,52],{39:[1,164]}),t(L,[2,60]),t(L,[2,92]),t(L,[2,94]),t(L,[2,95],{77:[1,165]}),t(L,[2,98]),t(L,[2,99],{13:[1,166]}),t(L,[2,101],{13:[1,168],77:[1,167]}),{22:Y,50:ie,60:K,82:Q,84:169,85:112,86:te,87:J,88:ge,89:ee,90:Re},t(ve,[2,110]),t(Ie,[2,75]),{14:[1,170]},t(ce,[2,11]),t(be,[2,70]),t(F,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:Z},t(L,[2,96]),t(L,[2,100]),t(L,[2,102]),t(L,[2,103],{77:[1,174]}),t(Pe,[2,108],{85:154,22:Y,50:ie,60:K,82:Q,86:te,87:J,88:ge,89:ee,90:Re}),t(oe,[2,8]),t(F,[2,51]),{41:[1,175]},t(F,[2,54]),t(L,[2,104]),t(F,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:x(function(Te,ae){if(ae.recoverable)this.trace(Te);else{var he=new Error(Te);throw he.hash=ae,he}},"parseError"),parse:x(function(Te){var ae=this,he=[0],W=[],ne=[null],j=[],ue=this.table,X="",Oe=0,xe=0,Ge=2,_e=1,$e=j.slice.call(arguments,1),Me=Object.create(this.lexer),He={yy:{}};for(var De in this.yy)Object.prototype.hasOwnProperty.call(this.yy,De)&&(He.yy[De]=this.yy[De]);Me.setInput(Te,He.yy),He.yy.lexer=Me,He.yy.parser=this,typeof Me.yylloc>"u"&&(Me.yylloc={});var Ke=Me.yylloc;j.push(Ke);var Ae=Me.options&&Me.options.ranges;typeof He.yy.parseError=="function"?this.parseError=He.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function at(mt){he.length=he.length-2*mt,ne.length=ne.length-mt,j.length=j.length-mt}x(at,"popStack");function Ee(){var mt;return mt=W.pop()||Me.lex()||_e,typeof mt!="number"&&(mt instanceof Array&&(W=mt,mt=W.pop()),mt=ae.symbols_[mt]||mt),mt}x(Ee,"lex");for(var pt,ht,rt,Et,vt={},ot,pe,Ct,lt;;){if(ht=he[he.length-1],this.defaultActions[ht]?rt=this.defaultActions[ht]:((pt===null||typeof pt>"u")&&(pt=Ee()),rt=ue[ht]&&ue[ht][pt]),typeof rt>"u"||!rt.length||!rt[0]){var st="";lt=[];for(ot in ue[ht])this.terminals_[ot]&&ot>Ge&<.push("'"+this.terminals_[ot]+"'");Me.showPosition?st="Parse error on line "+(Oe+1)+`: +`;S.append("path").attr("d",k),h==="neo"&&S.attr("filter","url(#drop-shadow)");const E=i.get(e.name)??0;Kh.has(l)?(S.style("stroke",f[E%f.length]),S.style("fill",d[E%f.length])):S.style("stroke",p),S.attr("transform",`translate(${T}, ${C})`),e.rectData=y,Zh(r,$i(e.description))(e.description,m,y.x,y.y+35,y.width,y.height,{class:`actor ${O7}`},r);const _=S.select("path:last-child");if(_.node()){const L=_.node().getBBox();e.height=L.height+(r.sequence.labelBoxHeight??0)}return n||(m.attr("data-et","participant"),m.attr("data-type","database"),m.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),nRt=x(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(Ur++,u.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Ur);const y=t.append("g");let v=j0;n?v+=` ${zf}`:v+=` ${Ff}`,y.attr("class",v),y.attr("name",e.name);const T=Yo();T.x=e.x,T.y=a,T.fill="#eaeaea",T.width=e.width,T.height=e.height,T.class="actor",y.append("line").attr("id","actor-man-torso"+Ur).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+12).attr("x2",e.x+e.width/2-15).attr("y2",a+12),y.append("line").attr("id","actor-man-arms"+Ur).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+2).attr("x2",e.x+e.width/2-l*2.5).attr("y2",a+22),y.append("circle").attr("cx",e.x+e.width/2).attr("cy",a+12).attr("r",l),h==="neo"&&y.attr("filter","url(#drop-shadow)");const b=i.get(e.name)??0;Kh.has(d)?(y.style("stroke",g[b%g.length]),y.style("fill",p[b%g.length])):y.style("stroke",m);const w=y.node().getBBox();return e.height=w.height+(r.sequence.labelBoxHeight??0),Zh(r,$i(e.description))(e.description,y,T.x,T.y+15,T.width,T.height,{class:`actor ${j0}`},r),y.attr("transform",`translate(0,${l/2+10})`),n||(y.attr("data-et","participant"),y.attr("data-type","boundary"),y.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),iRt=x(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(Ur++,g.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Ur);const m=t.append("g");let y=j0;n?y+=` ${zf}`:y+=` ${Ff}`,m.attr("class",y),m.attr("name",e.name),n||m.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const v=l==="neo"?.5:1,T=l==="neo"?a+(1-v)*30:a;m.append("line").attr("id","actor-man-torso"+Ur).attr("x1",s).attr("y1",T+25*v).attr("x2",s).attr("y2",T+45*v),m.append("line").attr("id","actor-man-arms"+Ur).attr("x1",s-i0/2*v).attr("y1",T+33*v).attr("x2",s+i0/2*v).attr("y2",T+33*v),m.append("line").attr("x1",s-i0/2*v).attr("y1",T+60*v).attr("x2",s).attr("y2",T+45*v),m.append("line").attr("x1",s).attr("y1",T+45*v).attr("x2",s+(i0/2-2)*v).attr("y2",T+60*v);const b=m.append("circle");b.attr("cx",e.x+e.width/2),b.attr("cy",T+10*v),b.attr("r",15*v),b.attr("width",e.width*v),b.attr("height",e.height*v);const w=m.node().getBBox();e.height=w.height;const C=Yo();C.x=e.x,C.y=T,C.fill="#eaeaea",C.width=e.width,C.height=e.height/v,C.class="actor",C.rx=3,C.ry=3;const S=i.get(e.name)??0;return Kh.has(u)?(m.style("stroke",f[S%f.length]),m.style("fill",d[S%f.length])):m.style("stroke",p),Zh(r,$i(e.description))(e.description,m,C.x,T+35*v-(l==="neo"?10:0),C.width,C.height,{class:`actor ${j0}`},r),e.height},"drawActorTypeActor"),aRt=x(async function(t,e,r,n,i,a,s){const o=s??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await iRt(t,e,r,n,o);case"participant":return await Z6t(t,e,r,n,o);case"boundary":return await nRt(t,e,r,n,o);case"control":return await eRt(t,e,r,n,i,o);case"entity":return await tRt(t,e,r,n,o);case"database":return await rRt(t,e,r,n,o);case"collections":return await Q6t(t,e,r,n,o);case"queue":return await J6t(t,e,r,n,o)}},"drawActor"),sRt=x(function(t,e,r){const i=t.append("g");M_e(i,e),e.name&&Zh(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),oRt=x(function(t){return t.append("g")},"anchorElement"),lRt=x(function(t,e,r,n,i,a,s){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=Yo(),p=e.anchored,g=e.actor;f.x=e.startx,f.y=e.starty,f.class="activation"+i%3,f.width=e.stopx-e.startx,f.height=r-e.starty;const m=Lk(p,f),v=(s??new Map([...a.db.getActors().values()].map((T,b)=>[T.name,b]))).get(g)??0;Kh.has(o)&&(m.style("stroke",h[v%h.length]),m.style("fill",u[v%h.length]??d))},"drawActivation"),cRt=x(async function(t,e,r,n,i){const{boxMargin:a,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,f=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=x(function(y,v,T,b){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",T).attr("y2",b).attr("class","loopLine")},"drawLoopLine");p(e.startx,e.starty,e.stopx,e.starty),p(e.stopx,e.starty,e.stopx,e.stopy),p(e.startx,e.stopy,e.stopx,e.stopy),p(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(y){p(e.startx,y.y,e.stopx,y.y).style("stroke-dasharray","3, 3")});let g=dW();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(l??0,50),g.height=o+(n.look==="neo"?15:0)||20,g.textMargin=s,g.class="labelText",R_e(f,g),g=I_e(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+a+s,g.anchor="middle",g.valign="middle",g.textMargin=s,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=$i(g.text)?await w6(f,g,e):lx(f,g);if(e.sectionTitles!==void 0){for(const[y,v]of Object.entries(e.sectionTitles))if(v.message){g.text=v.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[y].y+a+s,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=e.wrap,$i(g.text)?(e.starty=e.sections[y].y,await w6(f,g,e)):lx(f,g);let T=Math.round(m.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,w)=>b+w));e.sections[y].height+=T-(a+s)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),M_e=x(function(t,e){U2e(t,e)},"drawBackgroundRect"),uRt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),hRt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),dRt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),fRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),pRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),gRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),mRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),yRt=x(function(t,e){const{theme:r}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),I_e=x(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),vRt=x(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Zh=(function(){function t(a,s,o,l,u,h,d){const f=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}x(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[y,v]=Oh(p),T=a.split(At.lineBreakRegex);for(let b=0;bt.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:x(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:x(function(t){this.boxes.push(t)},"addBox"),addActor:x(function(t){this.actors.push(t)},"addActor"),addLoop:x(function(t){this.loops.push(t)},"addLoop"),addMessage:x(function(t){this.messages.push(t)},"addMessage"),addNote:x(function(t){this.notes.push(t)},"addNote"),lastActor:x(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:x(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:x(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:x(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:x(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,O_e(Fe())},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=this;let a=0;function s(o){return x(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*Ye.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*Ye.boxMargin,Math.max),i.updateVal(bt.data,"startx",t-h*Ye.boxMargin,Math.min),i.updateVal(bt.data,"stopx",r+h*Ye.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*Ye.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*Ye.boxMargin,Math.max),i.updateVal(bt.data,"starty",e-h*Ye.boxMargin,Math.min),i.updateVal(bt.data,"stopy",n+h*Ye.boxMargin,Math.max))},"updateItemBounds")}x(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:x(function(t,e,r,n){const i=At.getMin(t,r),a=At.getMax(t,r),s=At.getMin(e,n),o=At.getMax(e,n);this.updateVal(bt.data,"startx",i,Math.min),this.updateVal(bt.data,"starty",s,Math.min),this.updateVal(bt.data,"stopx",a,Math.max),this.updateVal(bt.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:x(function(t,e,r){const n=r.get(t.from),i=P7(t.from).length||0,a=n.x+n.width/2+(i-1)*Ye.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Ye.activationWidth,stopy:void 0,actor:t.from,anchored:zn.anchorElement(e)})},"newActivation"),endActivation:x(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:x(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:x(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:x(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:bt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:x(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:x(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=At.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return{bounds:this.data,models:this.models}},"getBounds")},kRt=x(async function(t,e,r){bt.bumpVerticalPos(Ye.boxMargin),e.height=Ye.boxMargin,e.starty=bt.getVerticalPos();const n=Yo();n.x=e.startx,n.y=e.starty,n.width=e.width||Ye.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=zn.drawRect(i,n),s=dW();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=Ye.noteFontFamily,s.fontSize=Ye.noteFontSize,s.fontWeight=Ye.noteFontWeight,s.anchor=Ye.noteAlign,s.textMargin=Ye.noteMargin,s.valign="center";const o=$i(s.text)?await w6(i,s):lx(i,s),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));a.attr("height",l+2*Ye.noteMargin),e.height+=l+2*Ye.noteMargin,bt.bumpVerticalPos(l+2*Ye.noteMargin),e.stopy=e.starty+l+2*Ye.noteMargin,e.stopx=e.startx+n.width,bt.insert(e.startx,e.starty,e.stopx,e.stopy),bt.models.addNote(e)},"drawNote"),yie=x(function(t,e,r,n,i,a,s){const o=n.db.getActors(),l=o.get(e.from),u=o.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=F_e(e,n),m=t.append("g"),y=16.5,v=x((S,k)=>{const E=S?y:-y;return k?-E:E},"getCircleOffset"),T=x(S=>{m.append("circle").attr("cx",S).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:w,CENTRAL_CONNECTION_DUAL:C}=n.db.LINETYPE;if(h)switch(e.centralConnection){case b:g&&(f+=v(p,!0));break;case w:g||(d+=v(p,!1));break;case C:g?f+=v(p,!0):d+=v(p,!1);break}switch(e.centralConnection){case b:T(f);break;case w:T(d);break;case C:T(d),T(f);break}},"drawCentralConnection"),K0=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),Pm=x(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),BB=x(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function N_e(t,e){bt.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=At.splitBreaks(i).length,s=$i(i),o=s?await Yk(i,Fe()):yr.calculateTextDimensions(i,K0(Ye));if(!s){const d=o.height/a;e.height+=d,bt.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=bt.getVerticalPos()+u,Ye.rightAngles||(u+=Ye.boxMargin,l=bt.getVerticalPos()+u),u+=30;const d=At.getMax(h/2,Ye.width/2);bt.insert(r-d,bt.getVerticalPos()-10+u,n+d,bt.getVerticalPos()+30+u)}else u+=Ye.boxMargin,l=bt.getVerticalPos()+u,bt.insert(r,l-10,n,l);return bt.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,bt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}x(N_e,"boundMessage");var SRt=x(async function(t,e,r,n,i,a){const{startx:s,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=yr.calculateTextDimensions(u,K0(Ye)),g=dW();g.x=Math.min(s,o),g.y=l+10,g.width=Math.abs(o-s),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=Ye.messageFontFamily,g.fontSize=Ye.messageFontSize,g.fontWeight=Ye.messageFontWeight,g.anchor=Ye.messageAlign,g.valign="center",g.textMargin=Ye.wrapPadding,g.tspan=!1,$i(g.text)?await w6(t,g,{startx:s,stopx:o,starty:r}):lx(t,g);const m=p.width;let y;if(s===o){const T=f||Ye.showSequenceNumbers,b=F_e(i,n),w=IRt(i,n),C=s+(T&&(b||w)?10:0);Ye.rightAngles?y=t.append("path").attr("d",`M ${C},${r} H ${s+At.getMax(Ye.width/2,m/2)} V ${r+25} H ${s}`):y=t.append("path").attr("d","M "+C+","+r+" C "+(C+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)),zN(i,n)&&yie(t,i,e,n,s,o,r)}else y=t.append("line"),y.attr("x1",s),y.attr("y1",r),y.attr("x2",o),y.attr("y2",r),zN(i,n)&&yie(t,i,e,n,s,o,r);h===n.db.LINETYPE.DOTTED||h===n.db.LINETYPE.DOTTED_CROSS||h===n.db.LINETYPE.DOTTED_POINT||h===n.db.LINETYPE.DOTTED_OPEN||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===n.db.LINETYPE.SOLID_TOP_DOTTED||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===n.db.LINETYPE.STICK_TOP_DOTTED||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0"),y.attr("data-et","message"),y.attr("data-id","i"+e.id),y.attr("data-from",e.from),y.attr("data-to",e.to);let v="";if(Ye.arrowMarkerAbsolute&&(v=J6(!0)),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),(h===n.db.LINETYPE.SOLID_TOP||h===n.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr("marker-start","url("+v+"#"+a+"-arrowhead)"),y.attr("marker-end","url("+v+"#"+a+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&y.attr("marker-end","url("+v+"#"+a+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&y.attr("marker-end","url("+v+"#"+a+"-crosshead)"),f||Ye.showSequenceNumbers){const T=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,w=6,C=zN(i,n);let S=s,k=o;T?(ss?k=o-2*w:(k=o-w,S+=(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),k+=C?15:0,y.attr("x2",k),y.attr("x1",S)):y.attr("x1",s+w);let E=0;const _=s===o,M=s<=o;_?E=e.fromBounds+1:b?E=M?e.toBounds-1:e.fromBounds+1:E=M?e.fromBounds+1:e.toBounds-1;let L="12px";const P=d.toString().length;P>5?L="7px":P>3&&(L="9px"),t.append("line").attr("x1",E).attr("y1",r).attr("x2",E).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+v+"#"+a+"-sequencenumber)"),t.append("text").attr("x",E).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",L).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),ERt=x(function(t,e,r,n,i,a,s){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(s||bt.models.addBox(u),l+=Ye.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=At.getMax(f.width||Ye.width,Ye.width),f.height=At.getMax(f.height||Ye.height,Ye.height),f.margin=f.margin||Ye.actorMargin,h=At.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=bt.getVerticalPos(),bt.insert(f.x,i,f.x+f.width,f.height),o+=f.width+l,f.box&&(f.box.width=o+p.margin-f.box.x),l=f.margin,u=f.box,bt.models.addActor(f)}u&&!s&&bt.models.addBox(u),bt.bumpVerticalPos(h)},"addActorRenderingData"),FB=x(async function(t,e,r,n,i,a,s){if(n){let o=0;bt.bumpVerticalPos(Ye.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=bt.getVerticalPos());const h=await zn.drawActor(t,u,Ye,!0,i,a,s);o=At.getMax(o,h)}bt.bumpVerticalPos(o+Ye.boxMargin)}else for(const o of r){const l=e.get(o);await zn.drawActor(t,l,Ye,!1,i,a,s)}},"drawActors"),D_e=x(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=_Rt(o),u=zn.drawPopup(t,o,l,Ye,Ye.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),O_e=x(function(t){Wi(Ye,t),t.fontFamily&&(Ye.actorFontFamily=Ye.noteFontFamily=Ye.messageFontFamily=t.fontFamily),t.fontSize&&(Ye.actorFontSize=Ye.noteFontSize=Ye.messageFontSize=t.fontSize),t.fontWeight&&(Ye.actorFontWeight=Ye.noteFontWeight=Ye.messageFontWeight=t.fontWeight)},"setConf"),P7=x(function(t){return bt.activations.filter(function(e){return e.actor===t})},"actorActivations"),vie=x(function(t,e){const r=e.get(t),n=P7(t),i=n.reduce(function(s,o){return At.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return At.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function Ll(t,e,r,n,i){bt.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=K0(Ye);e.message=yr.wrapLabel(`[${e.message}]`,s-2*Ye.wrapPadding,o),e.width=s,e.wrap=!0;const l=yr.calculateTextDimensions(e.message,o),u=At.getMax(l.height,Ye.labelBoxHeight);a=n+u,le.debug(`${u} - ${e.message}`)}i(e),bt.bumpVerticalPos(a)}x(Ll,"adjustLoopHeightForWrap");function $_e(t,e,r,n,i,a,s){function o(h,d){h.x{B.add(G.from),B.add(G.to)}),y=y.filter(G=>B.has(G))}const S=new Map(y.map((B,G)=>{var H;return[((H=f.get(B))==null?void 0:H.name)??B,G]}));ERt(d,f,p,y,0,v,!1);const k=await DRt(v,f,C,n);zn.insertArrowHead(d,e),zn.insertArrowCrossHead(d,e),zn.insertArrowFilledHead(d,e),zn.insertSequenceNumber(d,e),zn.insertSolidTopArrowHead(d,e),zn.insertSolidBottomArrowHead(d,e),zn.insertStickTopArrowHead(d,e),zn.insertStickBottomArrowHead(d,e),s==="neo"&&zn.insertDropShadow(d,Ye);function E(B,G){const H=bt.endActivation(B);H.starty+18>G&&(H.starty=G-6,G+=12),zn.drawActivation(d,H,G,Ye,P7(B.from).length,n,S),bt.insert(H.startx,G-10,H.stopx,G)}x(E,"activeEnd");let _=1,M=1;const L=[],P=[];let D=0;for(const B of v){let G,H,q;switch(B.type){case n.db.LINETYPE.NOTE:bt.resetVerticalPos(),H=B.noteModel,await kRt(d,H,B.id);break;case n.db.LINETYPE.ACTIVE_START:bt.newActivation(B,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:bt.newActivation(B,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:bt.newActivation(B,d,f);break;case n.db.LINETYPE.ACTIVE_END:E(B,bt.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z));break;case n.db.LINETYPE.LOOP_END:G=bt.endLoop(),await zn.drawLoop(d,G,"loop",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;case n.db.LINETYPE.RECT_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin,Z=>{let Y=Z.message;Y||(Y=(o==null?void 0:o.rectBkgColor)||(o==null?void 0:o.actorBkg)||"rgba(128, 128, 128, 0.5)"),bt.newLoop(void 0,Y)});break;case n.db.LINETYPE.RECT_END:G=bt.endLoop(),P.push(G),bt.models.addLoop(G),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos());break;case n.db.LINETYPE.OPT_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z));break;case n.db.LINETYPE.OPT_END:G=bt.endLoop(),await zn.drawLoop(d,G,"opt",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;case n.db.LINETYPE.ALT_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z));break;case n.db.LINETYPE.ALT_ELSE:Ll(k,B,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,Z=>bt.addSectionToLoop(Z));break;case n.db.LINETYPE.ALT_END:G=bt.endLoop(),await zn.drawLoop(d,G,"alt",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z)),bt.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:Ll(k,B,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,Z=>bt.addSectionToLoop(Z));break;case n.db.LINETYPE.PAR_END:G=bt.endLoop(),await zn.drawLoop(d,G,"par",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;case n.db.LINETYPE.AUTONUMBER:_=B.message.start||_,M=B.message.step||M,B.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z));break;case n.db.LINETYPE.CRITICAL_OPTION:Ll(k,B,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,Z=>bt.addSectionToLoop(Z));break;case n.db.LINETYPE.CRITICAL_END:G=bt.endLoop(),await zn.drawLoop(d,G,"critical",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;case n.db.LINETYPE.BREAK_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z));break;case n.db.LINETYPE.BREAK_END:G=bt.endLoop(),await zn.drawLoop(d,G,"break",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;default:try{q=B.msgModel,q.starty=bt.getVerticalPos(),q.sequenceIndex=_,q.sequenceVisible=n.db.showSequenceNumbers(),q.id=B.id,q.from=B.from,q.to=B.to;const Z=await N_e(d,q);$_e(B,q,Z,D,f,p,g),L.push({messageModel:q,lineStartY:Z,msg:B}),bt.models.addMessage(q)}catch(Z){le.error("error while drawing message",Z)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(B.type)&&(_=Math.round((_+M)*100)/100),D++}le.debug("createdActors",p),le.debug("destroyedActors",g),await FB(d,f,y,!1,e,n,S);for(const B of L)await SRt(d,B.messageModel,B.lineStartY,n,B.msg,e);Ye.mirrorActors&&await FB(d,f,y,!0,e,n,S),P.forEach(B=>zn.drawBackgroundRect(d,B)),L_e(d,f,y,Ye);for(const B of bt.models.boxes){B.height=bt.getVerticalPos()-B.y,bt.insert(B.x,B.y,B.x+B.width,B.height);const G=Ye.boxMargin*2;B.startx=B.x-G,B.starty=B.y-G*.25,B.stopx=B.startx+B.width+2*G,B.stopy=B.starty+B.height+G*.75,B.stroke="rgb(0,0,0, 0.5)",zn.drawBox(d,B,Ye)}b&&bt.bumpVerticalPos(Ye.boxMargin);const R=D_e(d,f,y,h),{bounds:I}=bt.getBounds();I.startx===void 0&&(I.startx=0),I.starty===void 0&&(I.starty=0),I.stopx===void 0&&(I.stopx=0),I.stopy===void 0&&(I.stopy=0);let $=I.stopy-I.starty;${const s=K0(Ye);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=Ye.boxMargin*8;o+=l,o-=2*Ye.boxTextMargin,a.wrap&&(a.name=yr.wrapLabel(a.name,o-2*Ye.wrapPadding,s));const u=yr.calculateTextDimensions(a.name,s);i=At.getMax(u.height,i);const h=At.getMax(o,u.width+2*Ye.wrapPadding);if(a.margin=Ye.boxTextMargin,oa.textMaxHeight=i),At.getMax(n,Ye.height)}x(B_e,"calculateActorMargins");var RRt=x(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=$i(t.message)?await Yk(t.message,Fe()):yr.calculateTextDimensions(o?yr.wrapLabel(t.message,Ye.width,Pm(Ye)):t.message,Pm(Ye));const u={width:o?Ye.width:At.getMax(Ye.width,l.width+2*Ye.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=o?At.getMax(Ye.width,l.width):At.getMax(n.width/2+i.width/2,l.width+2*Ye.noteMargin),u.startx=a+(n.width+Ye.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?At.getMax(Ye.width,l.width+2*Ye.noteMargin):At.getMax(n.width/2+i.width/2,l.width+2*Ye.noteMargin),u.startx=a-u.width+(n.width-Ye.actorMargin)/2):t.to===t.from?(l=yr.calculateTextDimensions(o?yr.wrapLabel(t.message,At.getMax(Ye.width,n.width),Pm(Ye)):t.message,Pm(Ye)),u.width=o?At.getMax(Ye.width,n.width):At.getMax(n.width,Ye.width,l.width+2*Ye.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+Ye.actorMargin,u.startx=a2,f=x(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(Ye.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(h+=f(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=f(3)));const p=[i,a,s,o],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=yr.wrapLabel(t.message,At.getMax(g+2*Ye.wrapPadding,Ye.width),K0(Ye)));const m=yr.calculateTextDimensions(t.message,K0(Ye));return{width:At.getMax(t.wrap?0:m.width+2*Ye.wrapPadding,g+2*Ye.wrapPadding,Ye.width),height:0,startx:u,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),DRt=x(async function(t,e,r,n){const i={},a=[];let s,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(s=a.pop(),i[s.id]=s,i[u.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=P7(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*Ye.activationWidth/2,g={startx:p,stopx:p+Ye.activationWidth,actor:u.from,enabled:!0};bt.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=bt.activations.map(f=>f.actor).lastIndexOf(u.from);bt.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await RRt(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=At.getMin(s.from,o.startx),s.to=At.getMax(s.to,o.startx+o.width),s.width=At.getMax(s.width,Math.abs(s.from-s.to))-Ye.labelBoxWidth})):(l=NRt(u,e,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(d=>{if(s=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);s.from=At.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=At.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=At.getMax(s.width,Math.abs(s.to-s.from))-Ye.labelBoxWidth}else s.from=At.getMin(l.startx,s.from),s.to=At.getMax(l.stopx,s.to),s.width=At.getMax(s.width,l.width)-Ye.labelBoxWidth}))}return bt.activations=[],le.debug("Loop type widths:",i),i},"calculateLoopBounds"),ORt={bounds:bt,drawActors:FB,drawActorsPopup:D_e,setConf:O_e,draw:ARt},$Rt={parser:W6t,get db(){return new Y6t},renderer:ORt,styles:j6t,init:x(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,jD({sequence:{wrap:t.wrap}}))},"init")};const PRt=Object.freeze(Object.defineProperty({__proto__:null,diagram:$Rt},Symbol.toStringTag,{value:"Module"}));var zB=(function(){var t=x(function(de,Te,ae,he){for(ae=ae||{},he=de.length;he--;ae[de[he]]=Te);return ae},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,26],s=[1,42],o=[1,24],l=[1,25],u=[1,32],h=[1,33],d=[1,34],f=[1,45],p=[1,35],g=[1,36],m=[1,37],y=[1,38],v=[1,27],T=[1,28],b=[1,29],w=[1,30],C=[1,31],S=[1,44],k=[1,46],E=[1,43],_=[1,47],M=[1,9],L=[1,8,9],P=[1,58],D=[1,59],R=[1,60],I=[1,61],$=[1,62],O=[1,63],N=[1,64],F=[1,8,9,41],z=[1,77],V=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],B=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],G=[13,60,86,100,102,103],H=[13,60,73,74,86,100,102,103],q=[13,60,68,69,70,71,72,86,100,102,103],Z=[1,103],Y=[1,121],ie=[1,117],K=[1,113],Q=[1,119],te=[1,114],J=[1,115],ge=[1,116],ee=[1,118],Re=[1,120],Ie=[22,50,60,61,82,86,87,88,89,90],Be=[1,128],ce=[12,39],oe=[1,8,9,39,41,44,46],be=[1,8,9,22],fe=[1,153],Pe=[1,8,9,61],ve=[1,8,9,22,50,60,61,82,86,87,88,89,90],Ce={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:x(function(Te,ae,he,W,ne,j,ue){var X=j.length-1;switch(ne){case 8:this.$=j[X-1];break;case 9:case 10:case 13:case 15:this.$=j[X];break;case 11:case 14:this.$=j[X-2]+"."+j[X];break;case 12:case 16:this.$=j[X-1]+j[X];break;case 17:case 18:this.$=j[X-1]+"~"+j[X]+"~";break;case 19:W.addRelation(j[X]);break;case 20:j[X-1].title=W.cleanupLabel(j[X]),W.addRelation(j[X-1]);break;case 31:this.$=j[X].trim(),W.setAccTitle(this.$);break;case 32:case 33:this.$=j[X].trim(),W.setAccDescription(this.$);break;case 34:W.addClassesToNamespace(j[X-3],j[X-1][0],j[X-1][1]),W.popNamespace();break;case 35:W.addClassesToNamespace(j[X-4],j[X-1][0],j[X-1][1]),W.popNamespace();break;case 36:this.$=W.addNamespace(j[X]);break;case 37:this.$=W.addNamespace(j[X-1],j[X]);break;case 38:this.$=[[j[X]],[]];break;case 39:this.$=[[j[X-1]],[]];break;case 40:j[X][0].unshift(j[X-2]),this.$=j[X];break;case 41:this.$=[[],[j[X]]];break;case 42:this.$=[[],[j[X-1]]];break;case 43:j[X][1].unshift(j[X-2]),this.$=j[X];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=j[X];break;case 48:W.setCssClass(j[X-2],j[X]);break;case 49:W.addMembers(j[X-3],j[X-1]);break;case 51:W.setCssClass(j[X-5],j[X-3]),W.addMembers(j[X-5],j[X-1]);break;case 52:W.addAnnotation(j[X-3],j[X-1]);break;case 53:W.addAnnotation(j[X-6],j[X-4]),W.addMembers(j[X-6],j[X-1]);break;case 54:W.addAnnotation(j[X-5],j[X-3]);break;case 55:this.$=j[X],W.addClass(j[X]);break;case 56:this.$=j[X-1],W.addClass(j[X-1]),W.setClassLabel(j[X-1],j[X]);break;case 60:W.addAnnotation(j[X],j[X-2]);break;case 61:case 74:this.$=[j[X]];break;case 62:j[X].push(j[X-1]),this.$=j[X];break;case 63:break;case 64:W.addMember(j[X-1],W.cleanupLabel(j[X]));break;case 65:break;case 66:break;case 67:this.$={id1:j[X-2],id2:j[X],relation:j[X-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:j[X-3],id2:j[X],relation:j[X-1],relationTitle1:j[X-2],relationTitle2:"none"};break;case 69:this.$={id1:j[X-3],id2:j[X],relation:j[X-2],relationTitle1:"none",relationTitle2:j[X-1]};break;case 70:this.$={id1:j[X-4],id2:j[X],relation:j[X-2],relationTitle1:j[X-3],relationTitle2:j[X-1]};break;case 71:this.$=W.addNote(j[X],j[X-1]);break;case 72:this.$=W.addNote(j[X]);break;case 73:this.$=j[X-2],W.defineClass(j[X-1],j[X]);break;case 75:this.$=j[X-2].concat([j[X]]);break;case 76:W.setDirection("TB");break;case 77:W.setDirection("BT");break;case 78:W.setDirection("RL");break;case 79:W.setDirection("LR");break;case 80:this.$={type1:j[X-2],type2:j[X],lineType:j[X-1]};break;case 81:this.$={type1:"none",type2:j[X],lineType:j[X-1]};break;case 82:this.$={type1:j[X-1],type2:"none",lineType:j[X]};break;case 83:this.$={type1:"none",type2:"none",lineType:j[X]};break;case 84:this.$=W.relationType.AGGREGATION;break;case 85:this.$=W.relationType.EXTENSION;break;case 86:this.$=W.relationType.COMPOSITION;break;case 87:this.$=W.relationType.DEPENDENCY;break;case 88:this.$=W.relationType.LOLLIPOP;break;case 89:this.$=W.lineType.LINE;break;case 90:this.$=W.lineType.DOTTED_LINE;break;case 91:case 97:this.$=j[X-2],W.setClickEvent(j[X-1],j[X]);break;case 92:case 98:this.$=j[X-3],W.setClickEvent(j[X-2],j[X-1]),W.setTooltip(j[X-2],j[X]);break;case 93:this.$=j[X-2],W.setLink(j[X-1],j[X]);break;case 94:this.$=j[X-3],W.setLink(j[X-2],j[X-1],j[X]);break;case 95:this.$=j[X-3],W.setLink(j[X-2],j[X-1]),W.setTooltip(j[X-2],j[X]);break;case 96:this.$=j[X-4],W.setLink(j[X-3],j[X-2],j[X]),W.setTooltip(j[X-3],j[X-1]);break;case 99:this.$=j[X-3],W.setClickEvent(j[X-2],j[X-1],j[X]);break;case 100:this.$=j[X-4],W.setClickEvent(j[X-3],j[X-2],j[X-1]),W.setTooltip(j[X-3],j[X]);break;case 101:this.$=j[X-3],W.setLink(j[X-2],j[X]);break;case 102:this.$=j[X-4],W.setLink(j[X-3],j[X-1],j[X]);break;case 103:this.$=j[X-4],W.setLink(j[X-3],j[X-1]),W.setTooltip(j[X-3],j[X]);break;case 104:this.$=j[X-5],W.setLink(j[X-4],j[X-2],j[X]),W.setTooltip(j[X-4],j[X-1]);break;case 105:this.$=j[X-2],W.setCssStyle(j[X-1],j[X]);break;case 106:W.setCssClass(j[X-1],j[X]);break;case 107:this.$=[j[X]];break;case 108:j[X-2].push(j[X]),this.$=j[X-2];break;case 110:this.$=j[X-1]+j[X];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:w,83:C,86:S,100:k,102:E,103:_},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(M,[2,5],{8:[1,48]}),{8:[1,49]},t(L,[2,19],{22:[1,50]}),t(L,[2,21]),t(L,[2,22]),t(L,[2,23]),t(L,[2,24]),t(L,[2,25]),t(L,[2,26]),t(L,[2,27]),t(L,[2,28]),t(L,[2,29]),t(L,[2,30]),{34:[1,51]},{36:[1,52]},t(L,[2,33]),t(L,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:P,69:D,70:R,71:I,72:$,73:O,74:N}),{39:[1,65]},t(F,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(L,[2,65]),t(L,[2,66]),{16:69,60:f,86:S,100:k,102:E},{16:39,17:40,19:70,60:f,86:S,100:k,102:E,103:_},{16:39,17:40,19:71,60:f,86:S,100:k,102:E,103:_},{16:39,17:40,19:72,60:f,86:S,100:k,102:E,103:_},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:S,100:k,102:E,103:_},{13:z,55:76},{58:78,60:[1,79]},t(L,[2,76]),t(L,[2,77]),t(L,[2,78]),t(L,[2,79]),t(V,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:S,100:k,102:E,103:_}),t(V,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:S,100:k,102:E,103:_},{16:39,17:40,19:87,60:f,86:S,100:k,102:E,103:_},t(B,[2,133]),t(B,[2,134]),t(B,[2,135]),t(B,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(M,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:r,37:n,42:i,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:w,83:C,86:S,100:k,102:E,103:_}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:w,83:C,86:S,100:k,102:E,103:_},t(L,[2,20]),t(L,[2,31]),t(L,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:S,100:k,102:E,103:_},{53:92,66:56,67:57,68:P,69:D,70:R,71:I,72:$,73:O,74:N},t(L,[2,64]),{67:93,73:O,74:N},t(G,[2,83],{66:94,68:P,69:D,70:R,71:I,72:$}),t(H,[2,84]),t(H,[2,85]),t(H,[2,86]),t(H,[2,87]),t(H,[2,88]),t(q,[2,89]),t(q,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:s,54:u,56:h},{16:100,60:f,86:S,100:k,102:E},{41:[1,102],45:101,51:Z},{16:104,60:f,86:S,100:k,102:E},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:Y,50:ie,59:110,60:K,82:Q,84:111,85:112,86:te,87:J,88:ge,89:ee,90:Re},{60:[1,122]},{13:z,55:123},t(F,[2,72]),t(F,[2,138]),{22:Y,50:ie,59:124,60:K,61:[1,125],82:Q,84:111,85:112,86:te,87:J,88:ge,89:ee,90:Re},t(Ie,[2,74]),{16:39,17:40,19:126,60:f,86:S,100:k,102:E,103:_},t(V,[2,16]),t(V,[2,17]),t(V,[2,18]),{11:127,12:Be,39:[2,36]},t(ce,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:S,100:k,102:E,103:_}),t(ce,[2,10]),t(oe,[2,55],{11:131,12:Be}),t(M,[2,7]),{9:[1,132]},t(be,[2,67]),{16:39,17:40,19:133,60:f,86:S,100:k,102:E,103:_},{13:[1,135],16:39,17:40,19:134,60:f,86:S,100:k,102:E,103:_},t(G,[2,82],{66:136,68:P,69:D,70:R,71:I,72:$}),t(G,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:s,54:u,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(F,[2,48],{39:[1,142]}),{41:[1,143]},t(F,[2,50]),{41:[2,61],45:144,51:Z},{47:[1,145]},{16:39,17:40,19:146,60:f,86:S,100:k,102:E,103:_},t(L,[2,91],{13:[1,147]}),t(L,[2,93],{13:[1,149],77:[1,148]}),t(L,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(L,[2,105],{61:fe}),t(Pe,[2,107],{85:154,22:Y,50:ie,60:K,82:Q,86:te,87:J,88:ge,89:ee,90:Re}),t(ve,[2,109]),t(ve,[2,111]),t(ve,[2,112]),t(ve,[2,113]),t(ve,[2,114]),t(ve,[2,115]),t(ve,[2,116]),t(ve,[2,117]),t(ve,[2,118]),t(ve,[2,119]),t(L,[2,106]),t(F,[2,71]),t(L,[2,73],{61:fe}),{60:[1,155]},t(V,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:S,100:k,102:E,103:_},t(ce,[2,12]),t(oe,[2,56]),{1:[2,4]},t(be,[2,69]),t(be,[2,68]),{16:39,17:40,19:158,60:f,86:S,100:k,102:E,103:_},t(G,[2,80]),t(F,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:s,54:u,56:h},{45:163,51:Z},t(F,[2,49]),{41:[2,62]},t(F,[2,52],{39:[1,164]}),t(L,[2,60]),t(L,[2,92]),t(L,[2,94]),t(L,[2,95],{77:[1,165]}),t(L,[2,98]),t(L,[2,99],{13:[1,166]}),t(L,[2,101],{13:[1,168],77:[1,167]}),{22:Y,50:ie,60:K,82:Q,84:169,85:112,86:te,87:J,88:ge,89:ee,90:Re},t(ve,[2,110]),t(Ie,[2,75]),{14:[1,170]},t(ce,[2,11]),t(be,[2,70]),t(F,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:Z},t(L,[2,96]),t(L,[2,100]),t(L,[2,102]),t(L,[2,103],{77:[1,174]}),t(Pe,[2,108],{85:154,22:Y,50:ie,60:K,82:Q,86:te,87:J,88:ge,89:ee,90:Re}),t(oe,[2,8]),t(F,[2,51]),{41:[1,175]},t(F,[2,54]),t(L,[2,104]),t(F,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:x(function(Te,ae){if(ae.recoverable)this.trace(Te);else{var he=new Error(Te);throw he.hash=ae,he}},"parseError"),parse:x(function(Te){var ae=this,he=[0],W=[],ne=[null],j=[],ue=this.table,X="",Oe=0,xe=0,Ge=2,_e=1,$e=j.slice.call(arguments,1),Me=Object.create(this.lexer),He={yy:{}};for(var De in this.yy)Object.prototype.hasOwnProperty.call(this.yy,De)&&(He.yy[De]=this.yy[De]);Me.setInput(Te,He.yy),He.yy.lexer=Me,He.yy.parser=this,typeof Me.yylloc>"u"&&(Me.yylloc={});var Ke=Me.yylloc;j.push(Ke);var Ae=Me.options&&Me.options.ranges;typeof He.yy.parseError=="function"?this.parseError=He.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function at(mt){he.length=he.length-2*mt,ne.length=ne.length-mt,j.length=j.length-mt}x(at,"popStack");function Ee(){var mt;return mt=W.pop()||Me.lex()||_e,typeof mt!="number"&&(mt instanceof Array&&(W=mt,mt=W.pop()),mt=ae.symbols_[mt]||mt),mt}x(Ee,"lex");for(var pt,ht,rt,Et,vt={},ot,pe,Ct,lt;;){if(ht=he[he.length-1],this.defaultActions[ht]?rt=this.defaultActions[ht]:((pt===null||typeof pt>"u")&&(pt=Ee()),rt=ue[ht]&&ue[ht][pt]),typeof rt>"u"||!rt.length||!rt[0]){var st="";lt=[];for(ot in ue[ht])this.terminals_[ot]&&ot>Ge&<.push("'"+this.terminals_[ot]+"'");Me.showPosition?st="Parse error on line "+(Oe+1)+`: `+Me.showPosition()+` Expecting `+lt.join(", ")+", got '"+(this.terminals_[pt]||pt)+"'":st="Parse error on line "+(Oe+1)+": Unexpected "+(pt==_e?"end of input":"'"+(this.terminals_[pt]||pt)+"'"),this.parseError(st,{text:Me.match,token:this.terminals_[pt]||pt,line:Me.yylineno,loc:Ke,expected:lt})}if(rt[0]instanceof Array&&rt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ht+", token: "+pt);switch(rt[0]){case 1:he.push(pt),ne.push(Me.yytext),j.push(Me.yylloc),he.push(rt[1]),pt=null,xe=Me.yyleng,X=Me.yytext,Oe=Me.yylineno,Ke=Me.yylloc;break;case 2:if(pe=this.productions_[rt[1]][1],vt.$=ne[ne.length-pe],vt._$={first_line:j[j.length-(pe||1)].first_line,last_line:j[j.length-1].last_line,first_column:j[j.length-(pe||1)].first_column,last_column:j[j.length-1].last_column},Ae&&(vt._$.range=[j[j.length-(pe||1)].range[0],j[j.length-1].range[1]]),Et=this.performAction.apply(vt,[X,xe,Oe,He.yy,rt[1],ne,j].concat($e)),typeof Et<"u")return Et;pe&&(he=he.slice(0,-1*pe*2),ne=ne.slice(0,-1*pe),j=j.slice(0,-1*pe)),he.push(this.productions_[rt[1]][0]),ne.push(vt.$),j.push(vt._$),Ct=ue[he[he.length-2]][he[he.length-1]],he.push(Ct);break;case 3:return!0}}return!0},"parse")},Ve=(function(){var de={EOF:1,parseError:x(function(ae,he){if(this.yy.parser)this.yy.parser.parseError(ae,he);else throw new Error(ae)},"parseError"),setInput:x(function(Te,ae){return this.yy=ae||this.yy||{},this._input=Te,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Te=this._input[0];this.yytext+=Te,this.yyleng++,this.offset++,this.match+=Te,this.matched+=Te;var ae=Te.match(/(?:\r\n?|\n).*/g);return ae?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Te},"input"),unput:x(function(Te){var ae=Te.length,he=Te.split(/(?:\r\n?|\n)/g);this._input=Te+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ae),this.offset-=ae;var W=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),he.length-1&&(this.yylineno-=he.length-1);var ne=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:he?(he.length===W.length?this.yylloc.first_column:0)+W[W.length-he.length].length-he[0].length:this.yylloc.first_column-ae},this.options.ranges&&(this.yylloc.range=[ne[0],ne[0]+this.yyleng-ae]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Te){this.unput(this.match.slice(Te))},"less"),pastInput:x(function(){var Te=this.matched.substr(0,this.matched.length-this.match.length);return(Te.length>20?"...":"")+Te.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Te=this.match;return Te.length<20&&(Te+=this._input.substr(0,20-Te.length)),(Te.substr(0,20)+(Te.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Te=this.pastInput(),ae=new Array(Te.length+1).join("-");return Te+this.upcomingInput()+` `+ae+"^"},"showPosition"),test_match:x(function(Te,ae){var he,W,ne;if(this.options.backtrack_lexer&&(ne={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(ne.yylloc.range=this.yylloc.range.slice(0))),W=Te[0].match(/(?:\r\n?|\n).*/g),W&&(this.yylineno+=W.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:W?W[W.length-1].length-W[W.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Te[0].length},this.yytext+=Te[0],this.match+=Te[0],this.matches=Te,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Te[0].length),this.matched+=Te[0],he=this.performAction.call(this,this.yy,this,ae,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),he)return he;if(this._backtrack){for(var j in ne)this[j]=ne[j];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Te,ae,he,W;this._more||(this.yytext="",this.match="");for(var ne=this._currentRules(),j=0;jae[0].length)){if(ae=he,W=j,this.options.backtrack_lexer){if(Te=this.test_match(he,ne[j]),Te!==!1)return Te;if(this._backtrack){ae=!1;continue}else return!1}else if(!this.options.flex)break}return ae?(Te=this.test_match(ae,ne[W]),Te!==!1?Te:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var ae=this.next();return ae||this.lex()},"lex"),begin:x(function(ae){this.conditionStack.push(ae)},"begin"),popState:x(function(){var ae=this.conditionStack.length-1;return ae>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(ae){return ae=this.conditionStack.length-1-Math.abs(ae||0),ae>=0?this.conditionStack[ae]:"INITIAL"},"topState"),pushState:x(function(ae){this.begin(ae)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(ae,he,W,ne){switch(W){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return de})();Ce.lexer=Ve;function se(){this.yy={}}return x(se,"Parser"),se.prototype=Ce,Ce.Parser=se,new se})();zB.parser=zB;var F_e=zB,vie=["#","+","~","-",""],nb,bie=(nb=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=Wr(e,Fe());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+fd(this.id);this.memberType==="method"&&(e+=`(${fd(this.parameters.trim())})`,this.returnType&&(e+=" : "+fd(this.returnType))),e=e.trim();const r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){const a=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(a){const s=a[1]?a[1].trim():"";if(vie.includes(s)&&(this.visibility=s),this.id=a[2],this.parameters=a[3]?a[3].trim():"",r=a[4]?a[4].trim():"",this.returnType=a[5]?a[5].trim():"",r===""){const o=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(o)&&(r=o,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const i=e.length,a=e.substring(0,1),s=e.substring(i-1);vie.includes(a)&&(this.visibility=a),/[$*]/.exec(s)&&(r=s),this.id=e.substring(this.visibility===""?0:1,r===""?i:i-1)}this.classifier=r,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${fd(this.id)}${this.memberType==="method"?`(${fd(this.parameters)})${this.returnType?" : "+fd(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},x(nb,"ClassMember"),nb),S4="classId-",xie=0,np=x(t=>At.sanitizeText(t,Fe()),"sanitizeText"),jd,z_e=(jd=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=x(e=>{const r=fW();ut(e).select("svg").selectAll("g").filter(function(){return ut(this).attr("title")!==null}).on("mouseover",a=>{const s=ut(a.currentTarget),o=s.attr("title");if(!o)return;const l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(ph.sanitize(o)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),ut(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=Hn,this.getAccTitle=ni,this.setAccDescription=ii,this.getAccDescription=ai,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getConfig=x(()=>Fe().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(e){const r=At.sanitizeText(e,Fe());let n="",i=r;if(r.indexOf("~")>0){const a=r.split("~");i=np(a[0]),n=np(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=At.sanitizeText(e,Fe());r&&(r=np(r));const{className:i}=this.splitClassNameAndType(n);this.classes.get(i).label=r,this.classes.get(i).text=`${r}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(e){const r=At.sanitizeText(e,Fe()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const a=At.sanitizeText(n,Fe());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:S4+a+"-"+xie}),xie++}addInterface(e,r){const n={id:`interface${this.interfaces.length}`,label:e,classId:r};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){const r=At.sanitizeText(e,Fe());if(this.classes.has(r)){const n=this.classes.get(r).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+r)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",On()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){const r=typeof e=="number"?`note${e}`:e;return this.notes.get(r)}getNotes(){return this.notes}addRelation(e){le.debug("Adding relation: "+JSON.stringify(e));const r=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!r.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!r.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=At.sanitizeText(e.relationTitle1.trim(),Fe()),e.relationTitle2=At.sanitizeText(e.relationTitle2.trim(),Fe()),this.relations.push(e)}addAnnotation(e,r){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(r)}addMember(e,r){this.addClass(e);const n=this.splitClassNameAndType(e).className,i=this.classes.get(n);if(typeof r=="string"){const a=r.trim();a.startsWith("<<")&&a.endsWith(">>")?i.annotations.push(np(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new bie(a,"method")):a&&i.members.push(new bie(a,"attribute"))}}addMembers(e,r){Array.isArray(r)&&(r.reverse(),r.forEach(n=>this.addMember(e,n)))}addNote(e,r){const n=this.notes.size,i={id:`note${n}`,class:r,text:e,index:n};return this.notes.set(i.id,i),i.id}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),np(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=S4+i),i=this.splitClassNameAndType(i).className;const a=this.classes.get(i);a&&(a.cssClasses+=" "+r)})}defineClass(e,r){for(const n of e){let i=this.styleClasses.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,i)),r&&r.forEach(a=>{if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.classes.forEach(a=>{a.cssClasses.includes(n)&&a.styles.push(...r.flatMap(s=>s.split(",")))})}}setTooltip(e,r){e.split(",").forEach(n=>{if(r!==void 0){const i=this.splitClassNameAndType(n).className,a=this.classes.get(i);a&&(a.tooltip=np(r))}})}getTooltip(e,r){return r&&this.namespaces.has(r)?this.namespaces.get(r).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,r,n){const i=Fe();e.split(",").forEach(a=>{let s=a;/\d/.exec(a[0])&&(s=S4+s),s=this.splitClassNameAndType(s).className;const o=this.classes.get(s);o&&(o.link=yr.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=np(n):o.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFunc(i,r,n);const a=this.splitClassNameAndType(i).className,s=this.classes.get(a);s&&(s.haveCallback=!0)}),this.setCssClass(e,"clickable")}setClickFunc(e,r,n){const i=At.sanitizeText(e,Fe());if(Fe().securityLevel!=="loose"||r===void 0)return;const s=this.splitClassNameAndType(i).className;if(this.classes.has(s)){let o=[];if(typeof n=="string"){o=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=this.lookUpDomId(s),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{yr.runFunc(r,...o)},!1)})}}bindFunctions(e){this.functions.forEach(r=>{r(e)})}escapeHtml(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,r){const n=r.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){const r=e.split("."),n=new Array(r.length);n[0]=r[0];for(let i=1;i0?a[s-1]:void 0,u=s===a.length-1,h=u&&r?r:i[s];this.namespaces.has(o)?u&&(this.namespaces.get(o).explicit=!0):this.namespaces.set(o,this.createNamespaceNode(o,h,l,u)),l&&this.linkParentChild(l,o)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,r,n){if(this.namespaces.has(e)){for(const i of r){const{className:a}=this.splitClassNameAndType(i),s=this.getClass(a);s.parent=e,this.namespaces.get(e).classes.set(a,s)}for(const i of n){const a=this.getNote(i);a.parent=e,this.namespaces.get(e).notes.set(i,a)}}}setCssStyle(e,r){const n=this.classes.get(e);if(!(!r||!n))for(const i of r)i.includes(",")?n.styles.push(...i.split(",")):n.styles.push(i)}getArrowMarker(e){let r;switch(e){case 0:r="aggregation";break;case 1:r="extension";break;case 2:r="composition";break;case 3:r="dependency";break;case 4:r="lollipop";break;default:r="none"}return r}resolveExplicitAncestor(e){let r=e;for(;r;){const n=this.namespaces.get(r);if(!n)return;if(n.explicit)return r;r=n.parent}}getData(){var s,o;const e=[],r=[],n=Fe(),i=((s=n.class)==null?void 0:s.hierarchicalNamespaces)??!0;for(const l of this.namespaces.values()){if(!i&&!l.explicit)continue;const u={id:l.id,label:i?l.label:l.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:i?l.parent:void 0};e.push(u)}for(const l of this.classes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(h)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:u,labelType:"markdown"};e.push(h);const d=(o=this.classes.get(l.class))==null?void 0:o.id;if(d){const f={id:`edgeNote${l.index}`,start:l.id,end:d,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};r.push(f)}}for(const l of this.interfaces){const u={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(u)}let a=0;for(const l of this.relations){a++;const u={id:dy(l.id1,l.id2,{prefix:"id",counter:a}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(u)}return{nodes:e,edges:r,other:{},config:n,direction:this.getDirection()}}},x(jd,"ClassDB"),jd),ORt=x(t=>`g.classGroup text { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var ae=this.next();return ae||this.lex()},"lex"),begin:x(function(ae){this.conditionStack.push(ae)},"begin"),popState:x(function(){var ae=this.conditionStack.length-1;return ae>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(ae){return ae=this.conditionStack.length-1-Math.abs(ae||0),ae>=0?this.conditionStack[ae]:"INITIAL"},"topState"),pushState:x(function(ae){this.begin(ae)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(ae,he,W,ne){switch(W){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return de})();Ce.lexer=Ve;function se(){this.yy={}}return x(se,"Parser"),se.prototype=Ce,Ce.Parser=se,new se})();zB.parser=zB;var z_e=zB,bie=["#","+","~","-",""],nb,xie=(nb=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=Wr(e,Fe());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+fd(this.id);this.memberType==="method"&&(e+=`(${fd(this.parameters.trim())})`,this.returnType&&(e+=" : "+fd(this.returnType))),e=e.trim();const r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){const a=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(a){const s=a[1]?a[1].trim():"";if(bie.includes(s)&&(this.visibility=s),this.id=a[2],this.parameters=a[3]?a[3].trim():"",r=a[4]?a[4].trim():"",this.returnType=a[5]?a[5].trim():"",r===""){const o=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(o)&&(r=o,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const i=e.length,a=e.substring(0,1),s=e.substring(i-1);bie.includes(a)&&(this.visibility=a),/[$*]/.exec(s)&&(r=s),this.id=e.substring(this.visibility===""?0:1,r===""?i:i-1)}this.classifier=r,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${fd(this.id)}${this.memberType==="method"?`(${fd(this.parameters)})${this.returnType?" : "+fd(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},x(nb,"ClassMember"),nb),S4="classId-",Tie=0,np=x(t=>At.sanitizeText(t,Fe()),"sanitizeText"),jd,V_e=(jd=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=x(e=>{const r=fW();ut(e).select("svg").selectAll("g").filter(function(){return ut(this).attr("title")!==null}).on("mouseover",a=>{const s=ut(a.currentTarget),o=s.attr("title");if(!o)return;const l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(ph.sanitize(o)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),ut(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=Hn,this.getAccTitle=ni,this.setAccDescription=ii,this.getAccDescription=ai,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getConfig=x(()=>Fe().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(e){const r=At.sanitizeText(e,Fe());let n="",i=r;if(r.indexOf("~")>0){const a=r.split("~");i=np(a[0]),n=np(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=At.sanitizeText(e,Fe());r&&(r=np(r));const{className:i}=this.splitClassNameAndType(n);this.classes.get(i).label=r,this.classes.get(i).text=`${r}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(e){const r=At.sanitizeText(e,Fe()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const a=At.sanitizeText(n,Fe());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:S4+a+"-"+Tie}),Tie++}addInterface(e,r){const n={id:`interface${this.interfaces.length}`,label:e,classId:r};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){const r=At.sanitizeText(e,Fe());if(this.classes.has(r)){const n=this.classes.get(r).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+r)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",$n()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){const r=typeof e=="number"?`note${e}`:e;return this.notes.get(r)}getNotes(){return this.notes}addRelation(e){le.debug("Adding relation: "+JSON.stringify(e));const r=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!r.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!r.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=At.sanitizeText(e.relationTitle1.trim(),Fe()),e.relationTitle2=At.sanitizeText(e.relationTitle2.trim(),Fe()),this.relations.push(e)}addAnnotation(e,r){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(r)}addMember(e,r){this.addClass(e);const n=this.splitClassNameAndType(e).className,i=this.classes.get(n);if(typeof r=="string"){const a=r.trim();a.startsWith("<<")&&a.endsWith(">>")?i.annotations.push(np(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new xie(a,"method")):a&&i.members.push(new xie(a,"attribute"))}}addMembers(e,r){Array.isArray(r)&&(r.reverse(),r.forEach(n=>this.addMember(e,n)))}addNote(e,r){const n=this.notes.size,i={id:`note${n}`,class:r,text:e,index:n};return this.notes.set(i.id,i),i.id}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),np(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=S4+i),i=this.splitClassNameAndType(i).className;const a=this.classes.get(i);a&&(a.cssClasses+=" "+r)})}defineClass(e,r){for(const n of e){let i=this.styleClasses.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,i)),r&&r.forEach(a=>{if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.classes.forEach(a=>{a.cssClasses.includes(n)&&a.styles.push(...r.flatMap(s=>s.split(",")))})}}setTooltip(e,r){e.split(",").forEach(n=>{if(r!==void 0){const i=this.splitClassNameAndType(n).className,a=this.classes.get(i);a&&(a.tooltip=np(r))}})}getTooltip(e,r){return r&&this.namespaces.has(r)?this.namespaces.get(r).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,r,n){const i=Fe();e.split(",").forEach(a=>{let s=a;/\d/.exec(a[0])&&(s=S4+s),s=this.splitClassNameAndType(s).className;const o=this.classes.get(s);o&&(o.link=yr.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=np(n):o.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFunc(i,r,n);const a=this.splitClassNameAndType(i).className,s=this.classes.get(a);s&&(s.haveCallback=!0)}),this.setCssClass(e,"clickable")}setClickFunc(e,r,n){const i=At.sanitizeText(e,Fe());if(Fe().securityLevel!=="loose"||r===void 0)return;const s=this.splitClassNameAndType(i).className;if(this.classes.has(s)){let o=[];if(typeof n=="string"){o=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=this.lookUpDomId(s),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{yr.runFunc(r,...o)},!1)})}}bindFunctions(e){this.functions.forEach(r=>{r(e)})}escapeHtml(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,r){const n=r.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){const r=e.split("."),n=new Array(r.length);n[0]=r[0];for(let i=1;i0?a[s-1]:void 0,u=s===a.length-1,h=u&&r?r:i[s];this.namespaces.has(o)?u&&(this.namespaces.get(o).explicit=!0):this.namespaces.set(o,this.createNamespaceNode(o,h,l,u)),l&&this.linkParentChild(l,o)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,r,n){if(this.namespaces.has(e)){for(const i of r){const{className:a}=this.splitClassNameAndType(i),s=this.getClass(a);s.parent=e,this.namespaces.get(e).classes.set(a,s)}for(const i of n){const a=this.getNote(i);a.parent=e,this.namespaces.get(e).notes.set(i,a)}}}setCssStyle(e,r){const n=this.classes.get(e);if(!(!r||!n))for(const i of r)i.includes(",")?n.styles.push(...i.split(",")):n.styles.push(i)}getArrowMarker(e){let r;switch(e){case 0:r="aggregation";break;case 1:r="extension";break;case 2:r="composition";break;case 3:r="dependency";break;case 4:r="lollipop";break;default:r="none"}return r}resolveExplicitAncestor(e){let r=e;for(;r;){const n=this.namespaces.get(r);if(!n)return;if(n.explicit)return r;r=n.parent}}getData(){var s,o;const e=[],r=[],n=Fe(),i=((s=n.class)==null?void 0:s.hierarchicalNamespaces)??!0;for(const l of this.namespaces.values()){if(!i&&!l.explicit)continue;const u={id:l.id,label:i?l.label:l.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:i?l.parent:void 0};e.push(u)}for(const l of this.classes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(h)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:u,labelType:"markdown"};e.push(h);const d=(o=this.classes.get(l.class))==null?void 0:o.id;if(d){const f={id:`edgeNote${l.index}`,start:l.id,end:d,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};r.push(f)}}for(const l of this.interfaces){const u={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(u)}let a=0;for(const l of this.relations){a++;const u={id:dy(l.id1,l.id2,{prefix:"id",counter:a}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(u)}return{nodes:e,edges:r,other:{},config:n,direction:this.getDirection()}}},x(jd,"ClassDB"),jd),BRt=x(t=>`g.classGroup text { fill: ${t.nodeBorder||t.classText}; stroke: none; font-family: ${t.fontFamily}; @@ -2466,12 +2468,12 @@ g.classGroup line { text-align: center; } ${CS()} -`,"getStyles"),V_e=ORt,$Rt=x((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),PRt=x(function(t,e){return e.db.getClasses()},"getClasses"),BRt=x(async function(t,e,r,n){le.info("REF0:"),le.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=Fe();n.db.setDiagramId(e);const o=n.db.getData(),l=Ox(e,i);o.type=n.type,o.layoutAlgorithm=nS(s),o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await xx(o,l);const u=8;yr.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),mg(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),G_e={getClasses:PRt,draw:BRt,getDir:$Rt},FRt={parser:F_e,get db(){return new z_e},renderer:G_e,styles:V_e,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const zRt=Object.freeze(Object.defineProperty({__proto__:null,diagram:FRt},Symbol.toStringTag,{value:"Module"}));var VRt={parser:F_e,get db(){return new z_e},renderer:G_e,styles:V_e,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const GRt=Object.freeze(Object.defineProperty({__proto__:null,diagram:VRt},Symbol.toStringTag,{value:"Module"}));var VB=(function(){var t=x(function(F,z,V,B){for(V=V||{},B=F.length;B--;V[F[B]]=z);return V},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,16],l=[1,17],u=[1,18],h=[1,19],d=[1,33],f=[1,20],p=[1,21],g=[1,22],m=[1,23],y=[1,24],v=[1,26],T=[1,27],b=[1,28],w=[1,29],C=[1,30],S=[1,31],k=[1,32],E=[1,35],_=[1,36],M=[1,37],L=[1,38],P=[1,34],D=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],R=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],I=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],$={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:x(function(z,V,B,G,H,q,Z){var Y=q.length-1;switch(H){case 3:return G.setRootDoc(q[Y]),q[Y];case 4:this.$=[];break;case 5:q[Y]!="nl"&&(q[Y-1].push(q[Y]),this.$=q[Y-1]);break;case 6:case 7:this.$=q[Y];break;case 8:this.$="nl";break;case 12:this.$=q[Y];break;case 13:const te=q[Y-1];te.description=G.trimColon(q[Y]),this.$=te;break;case 14:this.$={stmt:"relation",state1:q[Y-2],state2:q[Y]};break;case 15:const J=G.trimColon(q[Y]);this.$={stmt:"relation",state1:q[Y-3],state2:q[Y-1],description:J};break;case 19:this.$={stmt:"state",id:q[Y-3],type:"default",description:"",doc:q[Y-1]};break;case 20:var ie=q[Y],K=q[Y-2].trim();if(q[Y].match(":")){var Q=q[Y].split(":");ie=Q[0],K=[K,Q[1]]}this.$={stmt:"state",id:ie,type:"default",description:K};break;case 21:this.$={stmt:"state",id:q[Y-3],type:"default",description:q[Y-5],doc:q[Y-1]};break;case 22:this.$={stmt:"state",id:q[Y],type:"fork"};break;case 23:this.$={stmt:"state",id:q[Y],type:"join"};break;case 24:this.$={stmt:"state",id:q[Y],type:"choice"};break;case 25:this.$={stmt:"state",id:G.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:q[Y-1].trim(),note:{position:q[Y-2].trim(),text:q[Y].trim()}};break;case 29:this.$=q[Y].trim(),G.setAccTitle(this.$);break;case 30:case 31:this.$=q[Y].trim(),G.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:q[Y-3],url:q[Y-2],tooltip:q[Y-1]};break;case 33:this.$={stmt:"click",id:q[Y-3],url:q[Y-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:q[Y-1].trim(),classes:q[Y].trim()};break;case 36:this.$={stmt:"style",id:q[Y-1].trim(),styleClass:q[Y].trim()};break;case 37:this.$={stmt:"applyClass",id:q[Y-1].trim(),styleClass:q[Y].trim()};break;case 38:G.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:G.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:G.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:G.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:q[Y].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:q[Y-2].trim(),classes:[q[Y].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:q[Y-2].trim(),classes:[q[Y].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:C,45:S,48:k,51:E,52:_,53:M,54:L,57:P},t(D,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:C,45:S,48:k,51:E,52:_,53:M,54:L,57:P},t(D,[2,7]),t(D,[2,8]),t(D,[2,9]),t(D,[2,10]),t(D,[2,11]),t(D,[2,12],{14:[1,40],15:[1,41]}),t(D,[2,16]),{18:[1,42]},t(D,[2,18],{20:[1,43]}),{23:[1,44]},t(D,[2,22]),t(D,[2,23]),t(D,[2,24]),t(D,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(D,[2,28]),{34:[1,49]},{36:[1,50]},t(D,[2,31]),{13:51,24:d,57:P},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(R,[2,44],{58:[1,56]}),t(R,[2,45],{58:[1,57]}),t(D,[2,38]),t(D,[2,39]),t(D,[2,40]),t(D,[2,41]),t(D,[2,6]),t(D,[2,13]),{13:58,24:d,57:P},t(D,[2,17]),t(I,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(D,[2,29]),t(D,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(D,[2,14],{14:[1,71]}),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,72],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:C,45:S,48:k,51:E,52:_,53:M,54:L,57:P},t(D,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(D,[2,34]),t(D,[2,35]),t(D,[2,36]),t(D,[2,37]),t(R,[2,46]),t(R,[2,47]),t(D,[2,15]),t(D,[2,19]),t(I,i,{7:78}),t(D,[2,26]),t(D,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,81],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:C,45:S,48:k,51:E,52:_,53:M,54:L,57:P},t(D,[2,32]),t(D,[2,33]),t(D,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:x(function(z,V){if(V.recoverable)this.trace(z);else{var B=new Error(z);throw B.hash=V,B}},"parseError"),parse:x(function(z){var V=this,B=[0],G=[],H=[null],q=[],Z=this.table,Y="",ie=0,K=0,Q=2,te=1,J=q.slice.call(arguments,1),ge=Object.create(this.lexer),ee={yy:{}};for(var Re in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Re)&&(ee.yy[Re]=this.yy[Re]);ge.setInput(z,ee.yy),ee.yy.lexer=ge,ee.yy.parser=this,typeof ge.yylloc>"u"&&(ge.yylloc={});var Ie=ge.yylloc;q.push(Ie);var Be=ge.options&&ge.options.ranges;typeof ee.yy.parseError=="function"?this.parseError=ee.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(he){B.length=B.length-2*he,H.length=H.length-he,q.length=q.length-he}x(ce,"popStack");function oe(){var he;return he=G.pop()||ge.lex()||te,typeof he!="number"&&(he instanceof Array&&(G=he,he=G.pop()),he=V.symbols_[he]||he),he}x(oe,"lex");for(var be,fe,Pe,ve,Ce={},Ve,se,de,Te;;){if(fe=B[B.length-1],this.defaultActions[fe]?Pe=this.defaultActions[fe]:((be===null||typeof be>"u")&&(be=oe()),Pe=Z[fe]&&Z[fe][be]),typeof Pe>"u"||!Pe.length||!Pe[0]){var ae="";Te=[];for(Ve in Z[fe])this.terminals_[Ve]&&Ve>Q&&Te.push("'"+this.terminals_[Ve]+"'");ge.showPosition?ae="Parse error on line "+(ie+1)+`: +`,"getStyles"),G_e=BRt,FRt=x((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),zRt=x(function(t,e){return e.db.getClasses()},"getClasses"),VRt=x(async function(t,e,r,n){le.info("REF0:"),le.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=Fe();n.db.setDiagramId(e);const o=n.db.getData(),l=Ox(e,i);o.type=n.type,o.layoutAlgorithm=nS(s),o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await xx(o,l);const u=8;yr.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),mg(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),W_e={getClasses:zRt,draw:VRt,getDir:FRt},GRt={parser:z_e,get db(){return new V_e},renderer:W_e,styles:G_e,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const WRt=Object.freeze(Object.defineProperty({__proto__:null,diagram:GRt},Symbol.toStringTag,{value:"Module"}));var HRt={parser:z_e,get db(){return new V_e},renderer:W_e,styles:G_e,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const qRt=Object.freeze(Object.defineProperty({__proto__:null,diagram:HRt},Symbol.toStringTag,{value:"Module"}));var VB=(function(){var t=x(function(F,z,V,B){for(V=V||{},B=F.length;B--;V[F[B]]=z);return V},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,16],l=[1,17],u=[1,18],h=[1,19],d=[1,33],f=[1,20],p=[1,21],g=[1,22],m=[1,23],y=[1,24],v=[1,26],T=[1,27],b=[1,28],w=[1,29],C=[1,30],S=[1,31],k=[1,32],E=[1,35],_=[1,36],M=[1,37],L=[1,38],P=[1,34],D=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],R=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],I=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],$={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:x(function(z,V,B,G,H,q,Z){var Y=q.length-1;switch(H){case 3:return G.setRootDoc(q[Y]),q[Y];case 4:this.$=[];break;case 5:q[Y]!="nl"&&(q[Y-1].push(q[Y]),this.$=q[Y-1]);break;case 6:case 7:this.$=q[Y];break;case 8:this.$="nl";break;case 12:this.$=q[Y];break;case 13:const te=q[Y-1];te.description=G.trimColon(q[Y]),this.$=te;break;case 14:this.$={stmt:"relation",state1:q[Y-2],state2:q[Y]};break;case 15:const J=G.trimColon(q[Y]);this.$={stmt:"relation",state1:q[Y-3],state2:q[Y-1],description:J};break;case 19:this.$={stmt:"state",id:q[Y-3],type:"default",description:"",doc:q[Y-1]};break;case 20:var ie=q[Y],K=q[Y-2].trim();if(q[Y].match(":")){var Q=q[Y].split(":");ie=Q[0],K=[K,Q[1]]}this.$={stmt:"state",id:ie,type:"default",description:K};break;case 21:this.$={stmt:"state",id:q[Y-3],type:"default",description:q[Y-5],doc:q[Y-1]};break;case 22:this.$={stmt:"state",id:q[Y],type:"fork"};break;case 23:this.$={stmt:"state",id:q[Y],type:"join"};break;case 24:this.$={stmt:"state",id:q[Y],type:"choice"};break;case 25:this.$={stmt:"state",id:G.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:q[Y-1].trim(),note:{position:q[Y-2].trim(),text:q[Y].trim()}};break;case 29:this.$=q[Y].trim(),G.setAccTitle(this.$);break;case 30:case 31:this.$=q[Y].trim(),G.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:q[Y-3],url:q[Y-2],tooltip:q[Y-1]};break;case 33:this.$={stmt:"click",id:q[Y-3],url:q[Y-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:q[Y-1].trim(),classes:q[Y].trim()};break;case 36:this.$={stmt:"style",id:q[Y-1].trim(),styleClass:q[Y].trim()};break;case 37:this.$={stmt:"applyClass",id:q[Y-1].trim(),styleClass:q[Y].trim()};break;case 38:G.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:G.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:G.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:G.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:q[Y].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:q[Y-2].trim(),classes:[q[Y].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:q[Y-2].trim(),classes:[q[Y].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:C,45:S,48:k,51:E,52:_,53:M,54:L,57:P},t(D,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:C,45:S,48:k,51:E,52:_,53:M,54:L,57:P},t(D,[2,7]),t(D,[2,8]),t(D,[2,9]),t(D,[2,10]),t(D,[2,11]),t(D,[2,12],{14:[1,40],15:[1,41]}),t(D,[2,16]),{18:[1,42]},t(D,[2,18],{20:[1,43]}),{23:[1,44]},t(D,[2,22]),t(D,[2,23]),t(D,[2,24]),t(D,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(D,[2,28]),{34:[1,49]},{36:[1,50]},t(D,[2,31]),{13:51,24:d,57:P},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(R,[2,44],{58:[1,56]}),t(R,[2,45],{58:[1,57]}),t(D,[2,38]),t(D,[2,39]),t(D,[2,40]),t(D,[2,41]),t(D,[2,6]),t(D,[2,13]),{13:58,24:d,57:P},t(D,[2,17]),t(I,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(D,[2,29]),t(D,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(D,[2,14],{14:[1,71]}),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,72],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:C,45:S,48:k,51:E,52:_,53:M,54:L,57:P},t(D,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(D,[2,34]),t(D,[2,35]),t(D,[2,36]),t(D,[2,37]),t(R,[2,46]),t(R,[2,47]),t(D,[2,15]),t(D,[2,19]),t(I,i,{7:78}),t(D,[2,26]),t(D,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,81],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:C,45:S,48:k,51:E,52:_,53:M,54:L,57:P},t(D,[2,32]),t(D,[2,33]),t(D,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:x(function(z,V){if(V.recoverable)this.trace(z);else{var B=new Error(z);throw B.hash=V,B}},"parseError"),parse:x(function(z){var V=this,B=[0],G=[],H=[null],q=[],Z=this.table,Y="",ie=0,K=0,Q=2,te=1,J=q.slice.call(arguments,1),ge=Object.create(this.lexer),ee={yy:{}};for(var Re in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Re)&&(ee.yy[Re]=this.yy[Re]);ge.setInput(z,ee.yy),ee.yy.lexer=ge,ee.yy.parser=this,typeof ge.yylloc>"u"&&(ge.yylloc={});var Ie=ge.yylloc;q.push(Ie);var Be=ge.options&&ge.options.ranges;typeof ee.yy.parseError=="function"?this.parseError=ee.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(he){B.length=B.length-2*he,H.length=H.length-he,q.length=q.length-he}x(ce,"popStack");function oe(){var he;return he=G.pop()||ge.lex()||te,typeof he!="number"&&(he instanceof Array&&(G=he,he=G.pop()),he=V.symbols_[he]||he),he}x(oe,"lex");for(var be,fe,Pe,ve,Ce={},Ve,se,de,Te;;){if(fe=B[B.length-1],this.defaultActions[fe]?Pe=this.defaultActions[fe]:((be===null||typeof be>"u")&&(be=oe()),Pe=Z[fe]&&Z[fe][be]),typeof Pe>"u"||!Pe.length||!Pe[0]){var ae="";Te=[];for(Ve in Z[fe])this.terminals_[Ve]&&Ve>Q&&Te.push("'"+this.terminals_[Ve]+"'");ge.showPosition?ae="Parse error on line "+(ie+1)+`: `+ge.showPosition()+` Expecting `+Te.join(", ")+", got '"+(this.terminals_[be]||be)+"'":ae="Parse error on line "+(ie+1)+": Unexpected "+(be==te?"end of input":"'"+(this.terminals_[be]||be)+"'"),this.parseError(ae,{text:ge.match,token:this.terminals_[be]||be,line:ge.yylineno,loc:Ie,expected:Te})}if(Pe[0]instanceof Array&&Pe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+fe+", token: "+be);switch(Pe[0]){case 1:B.push(be),H.push(ge.yytext),q.push(ge.yylloc),B.push(Pe[1]),be=null,K=ge.yyleng,Y=ge.yytext,ie=ge.yylineno,Ie=ge.yylloc;break;case 2:if(se=this.productions_[Pe[1]][1],Ce.$=H[H.length-se],Ce._$={first_line:q[q.length-(se||1)].first_line,last_line:q[q.length-1].last_line,first_column:q[q.length-(se||1)].first_column,last_column:q[q.length-1].last_column},Be&&(Ce._$.range=[q[q.length-(se||1)].range[0],q[q.length-1].range[1]]),ve=this.performAction.apply(Ce,[Y,K,ie,ee.yy,Pe[1],H,q].concat(J)),typeof ve<"u")return ve;se&&(B=B.slice(0,-1*se*2),H=H.slice(0,-1*se),q=q.slice(0,-1*se)),B.push(this.productions_[Pe[1]][0]),H.push(Ce.$),q.push(Ce._$),de=Z[B[B.length-2]][B[B.length-1]],B.push(de);break;case 3:return!0}}return!0},"parse")},O=(function(){var F={EOF:1,parseError:x(function(V,B){if(this.yy.parser)this.yy.parser.parseError(V,B);else throw new Error(V)},"parseError"),setInput:x(function(z,V){return this.yy=V||this.yy||{},this._input=z,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var z=this._input[0];this.yytext+=z,this.yyleng++,this.offset++,this.match+=z,this.matched+=z;var V=z.match(/(?:\r\n?|\n).*/g);return V?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),z},"input"),unput:x(function(z){var V=z.length,B=z.split(/(?:\r\n?|\n)/g);this._input=z+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-V),this.offset-=V;var G=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),B.length-1&&(this.yylineno-=B.length-1);var H=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:B?(B.length===G.length?this.yylloc.first_column:0)+G[G.length-B.length].length-B[0].length:this.yylloc.first_column-V},this.options.ranges&&(this.yylloc.range=[H[0],H[0]+this.yyleng-V]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(z){this.unput(this.match.slice(z))},"less"),pastInput:x(function(){var z=this.matched.substr(0,this.matched.length-this.match.length);return(z.length>20?"...":"")+z.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var z=this.match;return z.length<20&&(z+=this._input.substr(0,20-z.length)),(z.substr(0,20)+(z.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var z=this.pastInput(),V=new Array(z.length+1).join("-");return z+this.upcomingInput()+` `+V+"^"},"showPosition"),test_match:x(function(z,V){var B,G,H;if(this.options.backtrack_lexer&&(H={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(H.yylloc.range=this.yylloc.range.slice(0))),G=z[0].match(/(?:\r\n?|\n).*/g),G&&(this.yylineno+=G.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:G?G[G.length-1].length-G[G.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+z[0].length},this.yytext+=z[0],this.match+=z[0],this.matches=z,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(z[0].length),this.matched+=z[0],B=this.performAction.call(this,this.yy,this,V,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),B)return B;if(this._backtrack){for(var q in H)this[q]=H[q];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var z,V,B,G;this._more||(this.yytext="",this.match="");for(var H=this._currentRules(),q=0;qV[0].length)){if(V=B,G=q,this.options.backtrack_lexer){if(z=this.test_match(B,H[q]),z!==!1)return z;if(this._backtrack){V=!1;continue}else return!1}else if(!this.options.flex)break}return V?(z=this.test_match(V,H[G]),z!==!1?z:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var V=this.next();return V||this.lex()},"lex"),begin:x(function(V){this.conditionStack.push(V)},"begin"),popState:x(function(){var V=this.conditionStack.length-1;return V>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(V){return V=this.conditionStack.length-1-Math.abs(V||0),V>=0?this.conditionStack[V]:"INITIAL"},"topState"),pushState:x(function(V){this.begin(V)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(V,B,G,H){function q(){const Z=B.yytext.indexOf("%%");if(Z===0)return!1;if(Z>0){const Y=B.yytext.slice(0,Z),ie=B.yytext.slice(Z);ie&&V.lexer.unput(ie),B.yytext=Y}return!0}switch(x(q,"processId"),G){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),B.yytext=B.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),B.yytext=B.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return q()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+B.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return q()?(this.popState(),"ID"):void 0;case 66:return q()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),B.yytext=B.yytext.substr(2).trim(),31;case 68:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return q()?24:void 0;case 74:return B.yytext=B.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return F})();$.lexer=O;function N(){this.yy={}}return x(N,"Parser"),N.prototype=$,$.Parser=N,new N})();VB.parser=VB;var W_e=VB,WRt="TB",H_e="TB",Tie="dir",Bm="state",cm="root",GB="relation",HRt="classDef",qRt="style",URt="applyClass",cC="default",q_e="divider",U_e="fill:none",Y_e="fill: #333",X_e="c",j_e="markdown",K_e="normal",VN="rect",GN="rectWithTitle",YRt="stateStart",XRt="stateEnd",wie="divider",Cie="roundedWithTitle",jRt="note",KRt="noteGroup",jS="statediagram",ZRt="state",QRt=`${jS}-${ZRt}`,Z_e="transition",JRt="note",eLt="note-edge",tLt=`${Z_e} ${eLt}`,rLt=`${jS}-${JRt}`,nLt="cluster",iLt=`${jS}-${nLt}`,aLt="cluster-alt",sLt=`${jS}-${aLt}`,Q_e="parent",J_e="note",oLt="state",IU="----",lLt=`${IU}${J_e}`,kie=`${IU}${Q_e}`,e6e=x((t,e=H_e)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),cLt=x(function(t,e){return e.db.getClasses()},"getClasses"),uLt=x(async function(t,e,r,n){le.info("REF0:"),le.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=Fe();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=Ox(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,Fe().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await xx(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var C;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"",m=o.nodes.find(S=>S.id===g);if(!g){le.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const y=(C=l.node())==null?void 0:C.querySelectorAll("g.node, g.rough-node");let v;if(y==null||y.forEach(S=>{var E;const k=(E=S.textContent)==null?void 0:E.trim();(S.id===(m==null?void 0:m.domId)||k===g)&&(v=S)}),!v){le.warn("⚠️ Could not find node matching text:",g);return}const T=v.parentNode;if(!T){le.warn("⚠️ Node has no parent, cannot wrap:",g);return}const b=document.createElementNS("http://www.w3.org/2000/svg","a"),w=f.url.replace(/^"+|"+$/g,"");if(b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",w),b.setAttribute("target","_blank"),f.tooltip){const S=f.tooltip.replace(/^"+|"+$/g,"");b.setAttribute("title",S),v.setAttribute("title",S)}T.replaceChild(b,v),b.appendChild(v),le.info("🔗 Wrapped node in
tag for:",g,f.url)})}catch(d){le.error("❌ Error injecting clickable links:",d)}yr.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),mg(l,h,jS,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),hLt={getClasses:cLt,draw:uLt,getDir:e6e},Z3=new Map,Sd=0;function Q3(t="",e=0,r="",n=IU){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${oLt}-${t}${i}-${e}`}x(Q3,"stateDomId");var dLt=x((t,e,r,n,i,a,s,o)=>{le.trace("items",e),e.forEach(l=>{switch(l.stmt){case Bm:vw(t,l,r,n,i,a,s,o);break;case cC:vw(t,l,r,n,i,a,s,o);break;case GB:{vw(t,l.state1,r,n,i,a,s,o),vw(t,l.state2,r,n,i,a,s,o);const u=s==="neo",h={id:"edge"+Sd,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:U_e,labelStyle:"",label:At.sanitizeText(l.description??"",Fe()),arrowheadStyle:Y_e,labelpos:X_e,labelType:j_e,thickness:K_e,classes:Z_e,look:s};i.push(h),Sd++}break}})},"setupDoc"),Sie=x((t,e=H_e)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function yw(t,e,r){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const a=r.get(i);a&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...a.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}x(yw,"insertOrUpdateNode");function t6e(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}x(t6e,"getClassesFromDbInfo");function r6e(t){return(t==null?void 0:t.styles)??[]}x(r6e,"getStylesFromDbInfo");var vw=x((t,e,r,n,i,a,s,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=t6e(u),d=r6e(u),f=Fe();if(le.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=VN;e.start===!0?y=YRt:e.start===!1&&(y=XRt),e.type!==cC&&(y=e.type),Z3.get(l)||Z3.set(l,{id:l,shape:y,description:At.sanitizeText(l,f),cssClasses:`${h} ${QRt}`,cssStyles:d});const v=Z3.get(l);e.description&&(Array.isArray(v.description)?(v.shape=GN,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=GN,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=VN,v.description=e.description),v.description=At.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===GN&&(v.type==="group"?v.shape=Cie:v.shape=VN),!v.type&&e.doc&&(le.info("Setting cluster for XCX",l,Sie(e)),v.type="group",v.isGroup=!0,v.dir=Sie(e),v.explicitDir=e.doc.some(b=>b.stmt==="dir"),v.shape=e.type===q_e?wie:Cie,v.cssClasses=`${v.cssClasses} ${iLt} ${a?sLt:""}`);const T={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:Q3(l,Sd),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:s,labelType:"markdown"};if(T.shape===wie&&(T.label=""),t&&t.id!=="root"&&(le.trace("Setting node ",l," to be child of its parent ",t.id),T.parentId=t.id),T.centerLabel=!0,e.note){const b={labelStyle:"",shape:jRt,label:e.note.text,labelType:"markdown",cssClasses:rLt,cssStyles:[],cssCompiledStyles:[],id:l+lLt+"-"+Sd,domId:Q3(l,Sd,J_e),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:s,position:e.note.position},w=l+kie,C={labelStyle:"",shape:KRt,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+kie,domId:Q3(l,Sd,Q_e),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};Sd++,C.id=w,b.parentId=w,yw(n,C,o),yw(n,b,o),yw(n,T,o);let S=l,k=b.id;e.note.position==="left of"&&(S=b.id,k=l),i.push({id:S+"-"+k,start:S,end:k,arrowhead:"none",arrowTypeEnd:"",style:U_e,labelStyle:"",classes:tLt,arrowheadStyle:Y_e,labelpos:X_e,labelType:j_e,thickness:K_e,look:s})}else yw(n,T,o)}e.doc&&(le.trace("Adding nodes children "),dLt(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),fLt=x(()=>{Z3.clear(),Sd=0},"reset"),_s={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Eie=x(()=>new Map,"newClassesList"),Aie=x(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),E4=x(t=>JSON.parse(JSON.stringify(t)),"clone"),v0,Gp=(v0=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Eie(),this.documents={root:Aie()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=ni,this.setAccTitle=Hn,this.getAccDescription=ai,this.setAccDescription=ii,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case Bm:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case GB:this.addRelation(i.state1,i.state2,i.description);break;case HRt:this.addStyleClass(i.id.trim(),i.classes);break;case qRt:this.handleStyleDef(i);break;case URt:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=Fe();fLt(),vw(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const r=e.id.trim().split(","),n=e.styleClass.split(",");for(const i of r){let a=this.getState(i);if(!a){const s=i.trim();this.addState(s),a=this.getState(s)}a&&(a.styles=n.map(s=>{var o;return(o=s.replace(/;/g,""))==null?void 0:o.trim()}))}}setRootDoc(e){le.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,r,n){if(r.stmt===GB){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===Bm&&(r.id===_s.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==cm&&r.stmt!==Bm||!r.doc)return;const i=[];let a=[];for(const s of r.doc)if(s.type===q_e){const o=E4(s);o.doc=E4(a),i.push(o),a=[]}else a.push(s);if(i.length>0&&a.length>0){const s={stmt:Bm,id:Lde(),type:"divider",doc:E4(a)};i.push(E4(s)),r.doc=i}r.doc.forEach(s=>this.docTranslator(r,s,!0))}getRootDocV2(){return this.docTranslator({id:cm,stmt:cm},{id:cm,stmt:cm,doc:this.rootDoc},!0),{id:cm,doc:this.rootDoc}}addState(e,r=cC,n=void 0,i=void 0,a=void 0,s=void 0,o=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))le.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:Bm,id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]});else{const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.doc||(h.doc=n),h.type||(h.type=r)}if(i&&(le.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(d=>this.addDescription(u,d.trim()))),a){const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.note=a,h.note.text=At.sanitizeText(h.note.text,Fe())}s&&(le.info("Setting state classes",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(le.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(le.info("Setting state styles",u,o),(Array.isArray(l)?l:[l]).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Aie()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Eie(),e||(this.links=new Map,On())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){le.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),le.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===_s.START_NODE?(this.startEndCount++,`${_s.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=cC){return e===_s.START_NODE?_s.START_TYPE:r}endIdIfNeeded(e=""){return e===_s.END_NODE?(this.startEndCount++,`${_s.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=cC){return e===_s.END_NODE?_s.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),s=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(s,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:At.sanitizeText(n,Fe())})}addRelation(e,r,n){if(typeof e=="object"&&typeof r=="object")this.addRelationObjs(e,r,n);else if(typeof e=="string"&&typeof r=="string"){const i=this.startIdIfNeeded(e.trim()),a=this.startTypeIfNeeded(e),s=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(s,o),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:n?At.sanitizeText(n,Fe()):void 0})}}addDescription(e,r){var a;const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;(a=n==null?void 0:n.descriptions)==null||a.push(At.sanitizeText(i,Fe()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r&&n&&r.split(_s.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(_s.COLOR_KEYWORD).exec(i)){const o=a.replace(_s.FILL_KEYWORD,_s.BG_FILL).replace(_s.COLOR_KEYWORD,_s.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setupToolTips(e){const r=fW();ut(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",a=>{var u;const s=ut(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(ph.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),ut(a.currentTarget).classed("hover",!1)})}setCssClass(e,r){e.split(",").forEach(n=>{var a;let i=this.getState(n);if(!i){const s=n.trim();this.addState(s),i=this.getState(s)}(a=i==null?void 0:i.classes)==null||a.push(r)})}setStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.styles)==null||i.push(r)}setTextStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.textStyles)==null||i.push(r)}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===Tie)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??WRt}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:Tie,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=Fe();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:e6e(this.getRootDocV2())}}getConfig(){return Fe().state}},x(v0,"StateDB"),v0.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},v0),pLt=x(t=>` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var V=this.next();return V||this.lex()},"lex"),begin:x(function(V){this.conditionStack.push(V)},"begin"),popState:x(function(){var V=this.conditionStack.length-1;return V>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(V){return V=this.conditionStack.length-1-Math.abs(V||0),V>=0?this.conditionStack[V]:"INITIAL"},"topState"),pushState:x(function(V){this.begin(V)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(V,B,G,H){function q(){const Z=B.yytext.indexOf("%%");if(Z===0)return!1;if(Z>0){const Y=B.yytext.slice(0,Z),ie=B.yytext.slice(Z);ie&&V.lexer.unput(ie),B.yytext=Y}return!0}switch(x(q,"processId"),G){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),B.yytext=B.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),B.yytext=B.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return q()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+B.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return q()?(this.popState(),"ID"):void 0;case 66:return q()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),B.yytext=B.yytext.substr(2).trim(),31;case 68:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return q()?24:void 0;case 74:return B.yytext=B.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return F})();$.lexer=O;function N(){this.yy={}}return x(N,"Parser"),N.prototype=$,$.Parser=N,new N})();VB.parser=VB;var H_e=VB,URt="TB",q_e="TB",wie="dir",Bm="state",cm="root",GB="relation",YRt="classDef",XRt="style",jRt="applyClass",cC="default",U_e="divider",Y_e="fill:none",X_e="fill: #333",j_e="c",K_e="markdown",Z_e="normal",VN="rect",GN="rectWithTitle",KRt="stateStart",ZRt="stateEnd",Cie="divider",kie="roundedWithTitle",QRt="note",JRt="noteGroup",jS="statediagram",eLt="state",tLt=`${jS}-${eLt}`,Q_e="transition",rLt="note",nLt="note-edge",iLt=`${Q_e} ${nLt}`,aLt=`${jS}-${rLt}`,sLt="cluster",oLt=`${jS}-${sLt}`,lLt="cluster-alt",cLt=`${jS}-${lLt}`,J_e="parent",e6e="note",uLt="state",IU="----",hLt=`${IU}${e6e}`,Sie=`${IU}${J_e}`,t6e=x((t,e=q_e)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),dLt=x(function(t,e){return e.db.getClasses()},"getClasses"),fLt=x(async function(t,e,r,n){le.info("REF0:"),le.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=Fe();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=Ox(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,Fe().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await xx(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var C;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"",m=o.nodes.find(S=>S.id===g);if(!g){le.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const y=(C=l.node())==null?void 0:C.querySelectorAll("g.node, g.rough-node");let v;if(y==null||y.forEach(S=>{var E;const k=(E=S.textContent)==null?void 0:E.trim();(S.id===(m==null?void 0:m.domId)||k===g)&&(v=S)}),!v){le.warn("⚠️ Could not find node matching text:",g);return}const T=v.parentNode;if(!T){le.warn("⚠️ Node has no parent, cannot wrap:",g);return}const b=document.createElementNS("http://www.w3.org/2000/svg","a"),w=f.url.replace(/^"+|"+$/g,"");if(b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",w),b.setAttribute("target","_blank"),f.tooltip){const S=f.tooltip.replace(/^"+|"+$/g,"");b.setAttribute("title",S),v.setAttribute("title",S)}T.replaceChild(b,v),b.appendChild(v),le.info("🔗 Wrapped node in tag for:",g,f.url)})}catch(d){le.error("❌ Error injecting clickable links:",d)}yr.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),mg(l,h,jS,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),pLt={getClasses:dLt,draw:fLt,getDir:t6e},Z3=new Map,Sd=0;function Q3(t="",e=0,r="",n=IU){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${uLt}-${t}${i}-${e}`}x(Q3,"stateDomId");var gLt=x((t,e,r,n,i,a,s,o)=>{le.trace("items",e),e.forEach(l=>{switch(l.stmt){case Bm:vw(t,l,r,n,i,a,s,o);break;case cC:vw(t,l,r,n,i,a,s,o);break;case GB:{vw(t,l.state1,r,n,i,a,s,o),vw(t,l.state2,r,n,i,a,s,o);const u=s==="neo",h={id:"edge"+Sd,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:Y_e,labelStyle:"",label:At.sanitizeText(l.description??"",Fe()),arrowheadStyle:X_e,labelpos:j_e,labelType:K_e,thickness:Z_e,classes:Q_e,look:s};i.push(h),Sd++}break}})},"setupDoc"),Eie=x((t,e=q_e)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function yw(t,e,r){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const a=r.get(i);a&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...a.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}x(yw,"insertOrUpdateNode");function r6e(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}x(r6e,"getClassesFromDbInfo");function n6e(t){return(t==null?void 0:t.styles)??[]}x(n6e,"getStylesFromDbInfo");var vw=x((t,e,r,n,i,a,s,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=r6e(u),d=n6e(u),f=Fe();if(le.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=VN;e.start===!0?y=KRt:e.start===!1&&(y=ZRt),e.type!==cC&&(y=e.type),Z3.get(l)||Z3.set(l,{id:l,shape:y,description:At.sanitizeText(l,f),cssClasses:`${h} ${tLt}`,cssStyles:d});const v=Z3.get(l);e.description&&(Array.isArray(v.description)?(v.shape=GN,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=GN,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=VN,v.description=e.description),v.description=At.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===GN&&(v.type==="group"?v.shape=kie:v.shape=VN),!v.type&&e.doc&&(le.info("Setting cluster for XCX",l,Eie(e)),v.type="group",v.isGroup=!0,v.dir=Eie(e),v.explicitDir=e.doc.some(b=>b.stmt==="dir"),v.shape=e.type===U_e?Cie:kie,v.cssClasses=`${v.cssClasses} ${oLt} ${a?cLt:""}`);const T={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:Q3(l,Sd),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:s,labelType:"markdown"};if(T.shape===Cie&&(T.label=""),t&&t.id!=="root"&&(le.trace("Setting node ",l," to be child of its parent ",t.id),T.parentId=t.id),T.centerLabel=!0,e.note){const b={labelStyle:"",shape:QRt,label:e.note.text,labelType:"markdown",cssClasses:aLt,cssStyles:[],cssCompiledStyles:[],id:l+hLt+"-"+Sd,domId:Q3(l,Sd,e6e),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:s,position:e.note.position},w=l+Sie,C={labelStyle:"",shape:JRt,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+Sie,domId:Q3(l,Sd,J_e),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};Sd++,C.id=w,b.parentId=w,yw(n,C,o),yw(n,b,o),yw(n,T,o);let S=l,k=b.id;e.note.position==="left of"&&(S=b.id,k=l),i.push({id:S+"-"+k,start:S,end:k,arrowhead:"none",arrowTypeEnd:"",style:Y_e,labelStyle:"",classes:iLt,arrowheadStyle:X_e,labelpos:j_e,labelType:K_e,thickness:Z_e,look:s})}else yw(n,T,o)}e.doc&&(le.trace("Adding nodes children "),gLt(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),mLt=x(()=>{Z3.clear(),Sd=0},"reset"),_s={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Aie=x(()=>new Map,"newClassesList"),_ie=x(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),E4=x(t=>JSON.parse(JSON.stringify(t)),"clone"),v0,Gp=(v0=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Aie(),this.documents={root:_ie()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=ni,this.setAccTitle=Hn,this.getAccDescription=ai,this.setAccDescription=ii,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case Bm:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case GB:this.addRelation(i.state1,i.state2,i.description);break;case YRt:this.addStyleClass(i.id.trim(),i.classes);break;case XRt:this.handleStyleDef(i);break;case jRt:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=Fe();mLt(),vw(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const r=e.id.trim().split(","),n=e.styleClass.split(",");for(const i of r){let a=this.getState(i);if(!a){const s=i.trim();this.addState(s),a=this.getState(s)}a&&(a.styles=n.map(s=>{var o;return(o=s.replace(/;/g,""))==null?void 0:o.trim()}))}}setRootDoc(e){le.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,r,n){if(r.stmt===GB){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===Bm&&(r.id===_s.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==cm&&r.stmt!==Bm||!r.doc)return;const i=[];let a=[];for(const s of r.doc)if(s.type===U_e){const o=E4(s);o.doc=E4(a),i.push(o),a=[]}else a.push(s);if(i.length>0&&a.length>0){const s={stmt:Bm,id:Mde(),type:"divider",doc:E4(a)};i.push(E4(s)),r.doc=i}r.doc.forEach(s=>this.docTranslator(r,s,!0))}getRootDocV2(){return this.docTranslator({id:cm,stmt:cm},{id:cm,stmt:cm,doc:this.rootDoc},!0),{id:cm,doc:this.rootDoc}}addState(e,r=cC,n=void 0,i=void 0,a=void 0,s=void 0,o=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))le.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:Bm,id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]});else{const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.doc||(h.doc=n),h.type||(h.type=r)}if(i&&(le.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(d=>this.addDescription(u,d.trim()))),a){const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.note=a,h.note.text=At.sanitizeText(h.note.text,Fe())}s&&(le.info("Setting state classes",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(le.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(le.info("Setting state styles",u,o),(Array.isArray(l)?l:[l]).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:_ie()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Aie(),e||(this.links=new Map,$n())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){le.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),le.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===_s.START_NODE?(this.startEndCount++,`${_s.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=cC){return e===_s.START_NODE?_s.START_TYPE:r}endIdIfNeeded(e=""){return e===_s.END_NODE?(this.startEndCount++,`${_s.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=cC){return e===_s.END_NODE?_s.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),s=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(s,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:At.sanitizeText(n,Fe())})}addRelation(e,r,n){if(typeof e=="object"&&typeof r=="object")this.addRelationObjs(e,r,n);else if(typeof e=="string"&&typeof r=="string"){const i=this.startIdIfNeeded(e.trim()),a=this.startTypeIfNeeded(e),s=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(s,o),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:n?At.sanitizeText(n,Fe()):void 0})}}addDescription(e,r){var a;const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;(a=n==null?void 0:n.descriptions)==null||a.push(At.sanitizeText(i,Fe()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r&&n&&r.split(_s.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(_s.COLOR_KEYWORD).exec(i)){const o=a.replace(_s.FILL_KEYWORD,_s.BG_FILL).replace(_s.COLOR_KEYWORD,_s.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setupToolTips(e){const r=fW();ut(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",a=>{var u;const s=ut(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(ph.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),ut(a.currentTarget).classed("hover",!1)})}setCssClass(e,r){e.split(",").forEach(n=>{var a;let i=this.getState(n);if(!i){const s=n.trim();this.addState(s),i=this.getState(s)}(a=i==null?void 0:i.classes)==null||a.push(r)})}setStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.styles)==null||i.push(r)}setTextStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.textStyles)==null||i.push(r)}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===wie)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??URt}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:wie,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=Fe();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:t6e(this.getRootDocV2())}}getConfig(){return Fe().state}},x(v0,"StateDB"),v0.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},v0),yLt=x(t=>` defs [id$="-barbEnd"] { fill: ${t.transitionColor}; stroke: ${t.transitionColor}; @@ -2696,12 +2698,12 @@ g.stateGroup line { ry: ${t.radius}px; filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} } -`,"getStyles"),n6e=pLt,gLt=x(t=>t.append("circle").attr("class","start-state").attr("r",Fe().state.sizeUnit).attr("cx",Fe().state.padding+Fe().state.sizeUnit).attr("cy",Fe().state.padding+Fe().state.sizeUnit),"drawStartState"),mLt=x(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Fe().state.textHeight).attr("class","divider").attr("x2",Fe().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),yLt=x((t,e)=>{const r=t.append("text").attr("x",2*Fe().state.padding).attr("y",Fe().state.textHeight+2*Fe().state.padding).attr("font-size",Fe().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",Fe().state.padding).attr("y",Fe().state.padding).attr("width",n.width+2*Fe().state.padding).attr("height",n.height+2*Fe().state.padding).attr("rx",Fe().state.radius),r},"drawSimpleState"),vLt=x((t,e)=>{const r=x(function(f,p,g){const m=f.append("tspan").attr("x",2*Fe().state.padding).text(p);g||m.attr("dy",Fe().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*Fe().state.padding).attr("y",Fe().state.textHeight+1.3*Fe().state.padding).attr("font-size",Fe().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",Fe().state.padding).attr("y",a+Fe().state.padding*.4+Fe().state.dividerMargin+Fe().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(s,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",Fe().state.padding).attr("y1",Fe().state.padding+a+Fe().state.dividerMargin/2).attr("y2",Fe().state.padding+a+Fe().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*Fe().state.padding),t.insert("rect",":first-child").attr("x",Fe().state.padding).attr("y",Fe().state.padding).attr("width",d+2*Fe().state.padding).attr("height",h.height+a+2*Fe().state.padding).attr("rx",Fe().state.radius),t},"drawDescrState"),bLt=x((t,e,r)=>{const n=Fe().state.padding,i=2*Fe().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",Fe().state.titleShift).attr("font-size",Fe().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,s);d===s&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>s&&(f=(s-d)/2+n),Math.abs(o-p.x)s&&(f=o-(h-s)/2);const g=1-Fe().state.textHeight;return t.insert("rect",":first-child").attr("x",f).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",p.height+Fe().state.textHeight+Fe().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=s&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",Fe().state.titleShift-Fe().state.textHeight-Fe().state.padding).attr("width",d).attr("height",Fe().state.textHeight*3).attr("rx",Fe().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",Fe().state.titleShift-Fe().state.textHeight-Fe().state.padding).attr("width",d).attr("height",p.height+3+2*Fe().state.textHeight).attr("rx",Fe().state.radius),t},"addTitleAndBox"),xLt=x(t=>(t.append("circle").attr("class","end-state-outer").attr("r",Fe().state.sizeUnit+Fe().state.miniPadding).attr("cx",Fe().state.padding+Fe().state.sizeUnit+Fe().state.miniPadding).attr("cy",Fe().state.padding+Fe().state.sizeUnit+Fe().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Fe().state.sizeUnit).attr("cx",Fe().state.padding+Fe().state.sizeUnit+2).attr("cy",Fe().state.padding+Fe().state.sizeUnit+2)),"drawEndState"),TLt=x((t,e)=>{let r=Fe().state.forkWidth,n=Fe().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",Fe().state.padding).attr("y",Fe().state.padding)},"drawForkJoinState"),wLt=x((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"
");s=s.replace(/\n/g,"
");const o=s.split(At.lineBreakRegex);let l=1.25*Fe().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=a.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+Fe().state.noteMargin),d.attr("y",r+i+1.25*Fe().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),CLt=x((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",Fe().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=wLt(t,0,0,n);return r.attr("height",a+2*Fe().state.noteMargin),r.attr("width",i+Fe().state.noteMargin*2),r},"drawNote"),_ie=x(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&gLt(i),e.type==="end"&&xLt(i),(e.type==="fork"||e.type==="join")&&TLt(i,e),e.type==="note"&&CLt(e.note.text,i),e.type==="divider"&&mLt(i),e.type==="default"&&e.descriptions.length===0&&yLt(i,e),e.type==="default"&&e.descriptions.length>0&&vLt(i,e);const a=i.node().getBBox();return n.width=a.width+2*Fe().state.padding,n.height=a.height+2*Fe().state.padding,n},"drawState"),Rie=0,kLt=x(function(t,e,r){const n=x(function(l){switch(l){case Gp.relationType.AGGREGATION:return"aggregation";case Gp.relationType.EXTENSION:return"extension";case Gp.relationType.COMPOSITION:return"composition";case Gp.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=NC().x(function(l){return l.x}).y(function(l){return l.y}).curve(DC),s=t.append("path").attr("d",a(i)).attr("id","edge"+Rie).attr("class","transition");let o="";if(Fe().state.arrowMarkerAbsolute&&(o=J6(!0)),s.attr("marker-end","url("+o+"#"+n(Gp.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=yr.calcLabelPosition(e.points),d=At.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let T=0;T<=d.length;T++){const b=l.append("text").attr("text-anchor","middle").text(d[T]).attr("x",u).attr("y",h+f),w=b.node().getBBox();g=Math.max(g,w.width),m=Math.min(m,w.x),le.info(w.x,u,h+f),f===0&&(f=b.node().getBBox().height,le.info("Title height",f,h)),p.push(b)}let y=f*d.length;if(d.length>1){const T=(d.length-1)*f*.5;p.forEach((b,w)=>b.attr("y",h+w*f-T)),y=f*d.length}const v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-Fe().state.padding/2).attr("y",h-y/2-Fe().state.padding/2-3.5).attr("width",g+Fe().state.padding).attr("height",y+Fe().state.padding),le.info(v)}Rie++},"drawEdge"),Ro,WN={},SLt=x(function(){},"setConf"),ELt=x(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),ALt=x(function(t,e,r,n){Ro=Fe().state;const i=Fe().securityLevel;let a;i==="sandbox"&&(a=ut("#i"+e));const s=ut(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;le.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);ELt(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");i6e(u,h,void 0,!1,s,o,n);const d=Ro.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;Ai(l,g,m,Ro.useMaxWidth),l.attr("viewBox",`${f.x-Ro.padding} ${f.y-Ro.padding} `+p+" "+g)},"draw"),_Lt=x(t=>t?t.length*Ro.fontSizeFactor:1,"getLabelWidth"),i6e=x((t,e,r,n,i,a,s)=>{const o=new ms({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const w=b.parentElement;let C=0,S=0;w&&(w.parentElement&&(C=w.parentElement.getBBox().width),S=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(S)&&(S=0)),b.setAttribute("x1",0-S+8),b.setAttribute("x2",C-S-8)})):le.debug("No Node "+v+": "+JSON.stringify(o.node(v)))});let m=g.getBBox();o.edges().forEach(function(v){v!==void 0&&o.edge(v)!==void 0&&(le.debug("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(o.edge(v))),kLt(e,o.edge(v),o.edge(v).relation))}),m=g.getBBox();const y={id:r||"root",label:r||"root",width:0,height:0};return y.width=m.width+2*Ro.padding,y.height=m.height+2*Ro.padding,le.debug("Doc rendered",y,o),y},"renderDoc"),RLt={setConf:SLt,draw:ALt},LLt={parser:W_e,get db(){return new Gp(1)},renderer:RLt,styles:n6e,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const MLt=Object.freeze(Object.defineProperty({__proto__:null,diagram:LLt},Symbol.toStringTag,{value:"Module"}));var ILt={parser:W_e,get db(){return new Gp(2)},renderer:hLt,styles:n6e,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const NLt=Object.freeze(Object.defineProperty({__proto__:null,diagram:ILt},Symbol.toStringTag,{value:"Module"}));var WB=(function(){var t=x(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],o=[1,14],l={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:x(function(f,p,g,m,y,v,T){var b=v.length-1;switch(y){case 1:return v[b-1];case 2:this.$=[];break;case 3:v[b-1].push(v[b]),this.$=v[b-1];break;case 4:case 5:this.$=v[b];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(v[b].substr(6)),this.$=v[b].substr(6);break;case 9:this.$=v[b].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=v[b].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(v[b].substr(8)),this.$=v[b].substr(8);break;case 13:m.addTask(v[b-1],v[b]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:x(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:x(function(f){var p=this,g=[0],m=[],y=[null],v=[],T=this.table,b="",w=0,C=0,S=2,k=1,E=v.slice.call(arguments,1),_=Object.create(this.lexer),M={yy:{}};for(var L in this.yy)Object.prototype.hasOwnProperty.call(this.yy,L)&&(M.yy[L]=this.yy[L]);_.setInput(f,M.yy),M.yy.lexer=_,M.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var P=_.yylloc;v.push(P);var D=_.options&&_.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function R(Z){g.length=g.length-2*Z,y.length=y.length-Z,v.length=v.length-Z}x(R,"popStack");function I(){var Z;return Z=m.pop()||_.lex()||k,typeof Z!="number"&&(Z instanceof Array&&(m=Z,Z=m.pop()),Z=p.symbols_[Z]||Z),Z}x(I,"lex");for(var $,O,N,F,z={},V,B,G,H;;){if(O=g[g.length-1],this.defaultActions[O]?N=this.defaultActions[O]:(($===null||typeof $>"u")&&($=I()),N=T[O]&&T[O][$]),typeof N>"u"||!N.length||!N[0]){var q="";H=[];for(V in T[O])this.terminals_[V]&&V>S&&H.push("'"+this.terminals_[V]+"'");_.showPosition?q="Parse error on line "+(w+1)+`: +`,"getStyles"),i6e=yLt,vLt=x(t=>t.append("circle").attr("class","start-state").attr("r",Fe().state.sizeUnit).attr("cx",Fe().state.padding+Fe().state.sizeUnit).attr("cy",Fe().state.padding+Fe().state.sizeUnit),"drawStartState"),bLt=x(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Fe().state.textHeight).attr("class","divider").attr("x2",Fe().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),xLt=x((t,e)=>{const r=t.append("text").attr("x",2*Fe().state.padding).attr("y",Fe().state.textHeight+2*Fe().state.padding).attr("font-size",Fe().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",Fe().state.padding).attr("y",Fe().state.padding).attr("width",n.width+2*Fe().state.padding).attr("height",n.height+2*Fe().state.padding).attr("rx",Fe().state.radius),r},"drawSimpleState"),TLt=x((t,e)=>{const r=x(function(f,p,g){const m=f.append("tspan").attr("x",2*Fe().state.padding).text(p);g||m.attr("dy",Fe().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*Fe().state.padding).attr("y",Fe().state.textHeight+1.3*Fe().state.padding).attr("font-size",Fe().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",Fe().state.padding).attr("y",a+Fe().state.padding*.4+Fe().state.dividerMargin+Fe().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(s,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",Fe().state.padding).attr("y1",Fe().state.padding+a+Fe().state.dividerMargin/2).attr("y2",Fe().state.padding+a+Fe().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*Fe().state.padding),t.insert("rect",":first-child").attr("x",Fe().state.padding).attr("y",Fe().state.padding).attr("width",d+2*Fe().state.padding).attr("height",h.height+a+2*Fe().state.padding).attr("rx",Fe().state.radius),t},"drawDescrState"),wLt=x((t,e,r)=>{const n=Fe().state.padding,i=2*Fe().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",Fe().state.titleShift).attr("font-size",Fe().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,s);d===s&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>s&&(f=(s-d)/2+n),Math.abs(o-p.x)s&&(f=o-(h-s)/2);const g=1-Fe().state.textHeight;return t.insert("rect",":first-child").attr("x",f).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",p.height+Fe().state.textHeight+Fe().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=s&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",Fe().state.titleShift-Fe().state.textHeight-Fe().state.padding).attr("width",d).attr("height",Fe().state.textHeight*3).attr("rx",Fe().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",Fe().state.titleShift-Fe().state.textHeight-Fe().state.padding).attr("width",d).attr("height",p.height+3+2*Fe().state.textHeight).attr("rx",Fe().state.radius),t},"addTitleAndBox"),CLt=x(t=>(t.append("circle").attr("class","end-state-outer").attr("r",Fe().state.sizeUnit+Fe().state.miniPadding).attr("cx",Fe().state.padding+Fe().state.sizeUnit+Fe().state.miniPadding).attr("cy",Fe().state.padding+Fe().state.sizeUnit+Fe().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Fe().state.sizeUnit).attr("cx",Fe().state.padding+Fe().state.sizeUnit+2).attr("cy",Fe().state.padding+Fe().state.sizeUnit+2)),"drawEndState"),kLt=x((t,e)=>{let r=Fe().state.forkWidth,n=Fe().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",Fe().state.padding).attr("y",Fe().state.padding)},"drawForkJoinState"),SLt=x((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"
");s=s.replace(/\n/g,"
");const o=s.split(At.lineBreakRegex);let l=1.25*Fe().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=a.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+Fe().state.noteMargin),d.attr("y",r+i+1.25*Fe().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),ELt=x((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",Fe().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=SLt(t,0,0,n);return r.attr("height",a+2*Fe().state.noteMargin),r.attr("width",i+Fe().state.noteMargin*2),r},"drawNote"),Rie=x(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&vLt(i),e.type==="end"&&CLt(i),(e.type==="fork"||e.type==="join")&&kLt(i,e),e.type==="note"&&ELt(e.note.text,i),e.type==="divider"&&bLt(i),e.type==="default"&&e.descriptions.length===0&&xLt(i,e),e.type==="default"&&e.descriptions.length>0&&TLt(i,e);const a=i.node().getBBox();return n.width=a.width+2*Fe().state.padding,n.height=a.height+2*Fe().state.padding,n},"drawState"),Lie=0,ALt=x(function(t,e,r){const n=x(function(l){switch(l){case Gp.relationType.AGGREGATION:return"aggregation";case Gp.relationType.EXTENSION:return"extension";case Gp.relationType.COMPOSITION:return"composition";case Gp.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=NC().x(function(l){return l.x}).y(function(l){return l.y}).curve(DC),s=t.append("path").attr("d",a(i)).attr("id","edge"+Lie).attr("class","transition");let o="";if(Fe().state.arrowMarkerAbsolute&&(o=J6(!0)),s.attr("marker-end","url("+o+"#"+n(Gp.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=yr.calcLabelPosition(e.points),d=At.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let T=0;T<=d.length;T++){const b=l.append("text").attr("text-anchor","middle").text(d[T]).attr("x",u).attr("y",h+f),w=b.node().getBBox();g=Math.max(g,w.width),m=Math.min(m,w.x),le.info(w.x,u,h+f),f===0&&(f=b.node().getBBox().height,le.info("Title height",f,h)),p.push(b)}let y=f*d.length;if(d.length>1){const T=(d.length-1)*f*.5;p.forEach((b,w)=>b.attr("y",h+w*f-T)),y=f*d.length}const v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-Fe().state.padding/2).attr("y",h-y/2-Fe().state.padding/2-3.5).attr("width",g+Fe().state.padding).attr("height",y+Fe().state.padding),le.info(v)}Lie++},"drawEdge"),Ro,WN={},_Lt=x(function(){},"setConf"),RLt=x(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),LLt=x(function(t,e,r,n){Ro=Fe().state;const i=Fe().securityLevel;let a;i==="sandbox"&&(a=ut("#i"+e));const s=ut(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;le.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);RLt(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");a6e(u,h,void 0,!1,s,o,n);const d=Ro.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;Ai(l,g,m,Ro.useMaxWidth),l.attr("viewBox",`${f.x-Ro.padding} ${f.y-Ro.padding} `+p+" "+g)},"draw"),MLt=x(t=>t?t.length*Ro.fontSizeFactor:1,"getLabelWidth"),a6e=x((t,e,r,n,i,a,s)=>{const o=new ms({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const w=b.parentElement;let C=0,S=0;w&&(w.parentElement&&(C=w.parentElement.getBBox().width),S=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(S)&&(S=0)),b.setAttribute("x1",0-S+8),b.setAttribute("x2",C-S-8)})):le.debug("No Node "+v+": "+JSON.stringify(o.node(v)))});let m=g.getBBox();o.edges().forEach(function(v){v!==void 0&&o.edge(v)!==void 0&&(le.debug("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(o.edge(v))),ALt(e,o.edge(v),o.edge(v).relation))}),m=g.getBBox();const y={id:r||"root",label:r||"root",width:0,height:0};return y.width=m.width+2*Ro.padding,y.height=m.height+2*Ro.padding,le.debug("Doc rendered",y,o),y},"renderDoc"),ILt={setConf:_Lt,draw:LLt},NLt={parser:H_e,get db(){return new Gp(1)},renderer:ILt,styles:i6e,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const DLt=Object.freeze(Object.defineProperty({__proto__:null,diagram:NLt},Symbol.toStringTag,{value:"Module"}));var OLt={parser:H_e,get db(){return new Gp(2)},renderer:pLt,styles:i6e,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const $Lt=Object.freeze(Object.defineProperty({__proto__:null,diagram:OLt},Symbol.toStringTag,{value:"Module"}));var WB=(function(){var t=x(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],o=[1,14],l={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:x(function(f,p,g,m,y,v,T){var b=v.length-1;switch(y){case 1:return v[b-1];case 2:this.$=[];break;case 3:v[b-1].push(v[b]),this.$=v[b-1];break;case 4:case 5:this.$=v[b];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(v[b].substr(6)),this.$=v[b].substr(6);break;case 9:this.$=v[b].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=v[b].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(v[b].substr(8)),this.$=v[b].substr(8);break;case 13:m.addTask(v[b-1],v[b]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:x(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:x(function(f){var p=this,g=[0],m=[],y=[null],v=[],T=this.table,b="",w=0,C=0,S=2,k=1,E=v.slice.call(arguments,1),_=Object.create(this.lexer),M={yy:{}};for(var L in this.yy)Object.prototype.hasOwnProperty.call(this.yy,L)&&(M.yy[L]=this.yy[L]);_.setInput(f,M.yy),M.yy.lexer=_,M.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var P=_.yylloc;v.push(P);var D=_.options&&_.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function R(Z){g.length=g.length-2*Z,y.length=y.length-Z,v.length=v.length-Z}x(R,"popStack");function I(){var Z;return Z=m.pop()||_.lex()||k,typeof Z!="number"&&(Z instanceof Array&&(m=Z,Z=m.pop()),Z=p.symbols_[Z]||Z),Z}x(I,"lex");for(var $,O,N,F,z={},V,B,G,H;;){if(O=g[g.length-1],this.defaultActions[O]?N=this.defaultActions[O]:(($===null||typeof $>"u")&&($=I()),N=T[O]&&T[O][$]),typeof N>"u"||!N.length||!N[0]){var q="";H=[];for(V in T[O])this.terminals_[V]&&V>S&&H.push("'"+this.terminals_[V]+"'");_.showPosition?q="Parse error on line "+(w+1)+`: `+_.showPosition()+` Expecting `+H.join(", ")+", got '"+(this.terminals_[$]||$)+"'":q="Parse error on line "+(w+1)+": Unexpected "+($==k?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(q,{text:_.match,token:this.terminals_[$]||$,line:_.yylineno,loc:P,expected:H})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+$);switch(N[0]){case 1:g.push($),y.push(_.yytext),v.push(_.yylloc),g.push(N[1]),$=null,C=_.yyleng,b=_.yytext,w=_.yylineno,P=_.yylloc;break;case 2:if(B=this.productions_[N[1]][1],z.$=y[y.length-B],z._$={first_line:v[v.length-(B||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(B||1)].first_column,last_column:v[v.length-1].last_column},D&&(z._$.range=[v[v.length-(B||1)].range[0],v[v.length-1].range[1]]),F=this.performAction.apply(z,[b,C,w,M.yy,N[1],y,v].concat(E)),typeof F<"u")return F;B&&(g=g.slice(0,-1*B*2),y=y.slice(0,-1*B),v=v.slice(0,-1*B)),g.push(this.productions_[N[1]][0]),y.push(z.$),v.push(z._$),G=T[g[g.length-2]][g[g.length-1]],g.push(G);break;case 3:return!0}}return!0},"parse")},u=(function(){var d={EOF:1,parseError:x(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:x(function(f,p){return this.yy=p||this.yy||{},this._input=f,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var p=f.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},"input"),unput:x(function(f){var p=f.length,g=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===m.length?this.yylloc.first_column:0)+m[m.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(f){this.unput(this.match.slice(f))},"less"),pastInput:x(function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+` `+p+"^"},"showPosition"),test_match:x(function(f,p){var g,m,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),m=f[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+f[0].length},this.yytext+=f[0],this.match+=f[0],this.matches=f,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(f[0].length),this.matched+=f[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var v in y)this[v]=y[v];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,p,g,m;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),v=0;vp[0].length)){if(p=g,m=v,this.options.backtrack_lexer){if(f=this.test_match(g,y[v]),f!==!1)return f;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(f=this.test_match(p,y[m]),f!==!1?f:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var p=this.next();return p||this.lex()},"lex"),begin:x(function(p){this.conditionStack.push(p)},"begin"),popState:x(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:x(function(p){this.begin(p)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(p,g,m,y){switch(m){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d})();l.lexer=u;function h(){this.yy={}}return x(h,"Parser"),h.prototype=l,l.Parser=h,new h})();WB.parser=WB;var DLt=WB,cx="",NU=[],Mk=[],Ik=[],OLt=x(function(){NU.length=0,Mk.length=0,cx="",Ik.length=0,On()},"clear"),$Lt=x(function(t){cx=t,NU.push(t)},"addSection"),PLt=x(function(){return NU},"getSections"),BLt=x(function(){let t=Lie();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),zLt=x(function(t,e){const r=e.substr(1).split(":");let n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const a=i.map(o=>o.trim()),s={section:cx,type:cx,people:a,task:t,score:n};Ik.push(s)},"addTask"),VLt=x(function(t){const e={section:cx,type:cx,description:t,task:t,classes:[]};Mk.push(e)},"addTaskOrg"),Lie=x(function(){const t=x(function(r){return Ik[r].processed},"compileTask");let e=!0;for(const[r,n]of Ik.entries())t(r),e=e&&n.processed;return e},"compileTasks"),GLt=x(function(){return FLt()},"getActors"),Mie={getConfig:x(()=>Fe().journey,"getConfig"),clear:OLt,setDiagramTitle:ti,getDiagramTitle:Yn,setAccTitle:Hn,getAccTitle:ni,setAccDescription:ii,getAccDescription:ai,addSection:$Lt,getSections:PLt,getTasks:BLt,addTask:zLt,addTaskOrg:VLt,getActors:GLt},WLt=x(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var p=this.next();return p||this.lex()},"lex"),begin:x(function(p){this.conditionStack.push(p)},"begin"),popState:x(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:x(function(p){this.begin(p)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(p,g,m,y){switch(m){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d})();l.lexer=u;function h(){this.yy={}}return x(h,"Parser"),h.prototype=l,l.Parser=h,new h})();WB.parser=WB;var PLt=WB,cx="",NU=[],Mk=[],Ik=[],BLt=x(function(){NU.length=0,Mk.length=0,cx="",Ik.length=0,$n()},"clear"),FLt=x(function(t){cx=t,NU.push(t)},"addSection"),zLt=x(function(){return NU},"getSections"),VLt=x(function(){let t=Mie();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),WLt=x(function(t,e){const r=e.substr(1).split(":");let n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const a=i.map(o=>o.trim()),s={section:cx,type:cx,people:a,task:t,score:n};Ik.push(s)},"addTask"),HLt=x(function(t){const e={section:cx,type:cx,description:t,task:t,classes:[]};Mk.push(e)},"addTaskOrg"),Mie=x(function(){const t=x(function(r){return Ik[r].processed},"compileTask");let e=!0;for(const[r,n]of Ik.entries())t(r),e=e&&n.processed;return e},"compileTasks"),qLt=x(function(){return GLt()},"getActors"),Iie={getConfig:x(()=>Fe().journey,"getConfig"),clear:BLt,setDiagramTitle:ti,getDiagramTitle:Yn,setAccTitle:Hn,getAccTitle:ni,setAccDescription:ii,getAccDescription:ai,addSection:FLt,getSections:zLt,getTasks:VLt,addTask:WLt,addTaskOrg:HLt,getActors:qLt},ULt=x(t=>`.label { font-family: ${t.fontFamily}; color: ${t.textColor}; } @@ -2834,12 +2836,12 @@ Expecting `+H.join(", ")+", got '"+(this.terminals_[$]||$)+"'":q="Parse error on ${t.actor5?`fill: ${t.actor5}`:""}; } ${CS()} -`,"getStyles"),HLt=WLt,DU=x(function(t,e){return xL(t,e)},"drawRect"),qLt=x(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=_b().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}x(a,"smile");function s(l){const u=_b().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}x(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return x(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),a6e=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),s6e=x(function(t,e){return cmt(t,e)},"drawText"),ULt=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,s6e(t,e)},"drawLabel"),YLt=x(function(t,e,r){const n=t.append("g"),i=Yo();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,DU(n,i),o6e(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),HB=-1,XLt=x(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");HB++,a.append("line").attr("id",n+"-task"+HB).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),qLt(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Yo();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,DU(a,o);let l=e.x+14;e.people.forEach(u=>{const h=e.actors[u].color,d={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};a6e(a,d),l+=10}),o6e(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),jLt=x(function(t,e){q2e(t,e)},"drawBackgroundRect"),o6e=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y{const a=ih[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:ih[i].position};Nk.drawCircle(t,s);let o=t.append("text").attr("visibility","hidden").text(i);const l=o.node().getBoundingClientRect().width;o.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";o=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(o.text(p),o.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,o.text(f),o.node().getBoundingClientRect().width>r){let m="";for(const y of f)m+=y,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=y);d=m}}else d=p}),d&&u.push(d),o.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=Nk.drawText(t,f).node().getBoundingClientRect().width;g>J3&&g>e.leftMargin-g&&(J3=g)}),n+=Math.max(20,u.length*20)})}x(l6e,"drawActorLegend");var Dl=Fe().journey,xd=0,QLt=x(function(t,e,r,n){const i=Fe(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=ut("#i"+e));const h=ut(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");il.init();const d=h.select("#"+e);Nk.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in ih)delete ih[w];let m=0;g.forEach(w=>{ih[w]={color:Dl.actorColours[m%Dl.actorColours.length],position:m},m++}),l6e(d),xd=Dl.leftMargin+J3,il.insert(0,0,xd,Object.keys(ih).length*50),JLt(d,f,0,e);const y=il.getBounds();p&&d.append("text").text(p).attr("x",xd).attr("font-size",s).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",o);const v=y.stopy-y.starty+2*Dl.diagramMarginY,T=xd+y.stopx+2*Dl.diagramMarginX;Ai(d,v,T,Dl.useMaxWidth),d.append("line").attr("x1",xd).attr("y1",Dl.height*4).attr("x2",T-xd-4).attr("y2",Dl.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const b=p?70:0;d.attr("viewBox",`${y.startx} -25 ${T} ${v+b}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",v+b+25)},"draw"),il={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:x(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=Fe().journey,a=this;let s=0;function o(l){return x(function(h){s++;const d=a.sequenceItems.length-s+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(il.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(il.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(h,"startx",t-d*i.boxMargin,Math.min),a.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),a.updateVal(il.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(il.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}x(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:x(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(il.data,"startx",i,Math.min),this.updateVal(il.data,"starty",s,Math.min),this.updateVal(il.data,"stopx",a,Math.max),this.updateVal(il.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return this.data},"getBounds")},HN=Dl.sectionFills,Iie=Dl.sectionColours,JLt=x(function(t,e,r,n){const i=Fe().journey;let a="";const s=i.height*2+i.diagramMarginY,o=r+s;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(a!==p.section){u=HN[l%HN.length],d=l%HN.length,h=Iie[l%Iie.length];let m=0;const y=p.section;for(let T=f;T(ih[y]&&(m[y]=ih[y]),m),{});p.x=f*i.taskMargin+f*i.width+xd,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,Nk.drawTask(t,p,i,n),il.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),Nie={setConf:ZLt,draw:QLt},e7t={parser:DLt,db:Mie,renderer:Nie,styles:HLt,init:x(t=>{Nie.setConf(t.journey),Mie.clear()},"init")};const t7t=Object.freeze(Object.defineProperty({__proto__:null,diagram:e7t},Symbol.toStringTag,{value:"Module"}));var qB=(function(){var t=x(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],a=[1,15],s=[1,16],o=[1,19],l=[1,20],u={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:x(function(p,g,m,y,v,T,b){var w=T.length-1;switch(v){case 1:return T[w-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:T[w-1].push(T[w]),this.$=T[w-1];break;case 7:case 8:this.$=T[w];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(T[w].substr(6)),this.$=T[w].substr(6);break;case 12:this.$=T[w].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=T[w].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(T[w].substr(8)),this.$=T[w].substr(8);break;case 18:y.addTask(T[w],0,""),this.$=T[w];break;case 19:y.addEvent(T[w].substr(2)),this.$=T[w];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(e,[2,5],{5:6}),t(e,[2,2]),t(e,[2,3]),t(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,8]),t(e,[2,9]),t(e,[2,11]),{16:[1,22]},{18:[1,23]},t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,7]),t(e,[2,12]),t(e,[2,13])],defaultActions:{},parseError:x(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:x(function(p){var g=this,m=[0],y=[],v=[null],T=[],b=this.table,w="",C=0,S=0,k=2,E=1,_=T.slice.call(arguments,1),M=Object.create(this.lexer),L={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(L.yy[P]=this.yy[P]);M.setInput(p,L.yy),L.yy.lexer=M,L.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var D=M.yylloc;T.push(D);var R=M.options&&M.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function I(Y){m.length=m.length-2*Y,v.length=v.length-Y,T.length=T.length-Y}x(I,"popStack");function $(){var Y;return Y=y.pop()||M.lex()||E,typeof Y!="number"&&(Y instanceof Array&&(y=Y,Y=y.pop()),Y=g.symbols_[Y]||Y),Y}x($,"lex");for(var O,N,F,z,V={},B,G,H,q;;){if(N=m[m.length-1],this.defaultActions[N]?F=this.defaultActions[N]:((O===null||typeof O>"u")&&(O=$()),F=b[N]&&b[N][O]),typeof F>"u"||!F.length||!F[0]){var Z="";q=[];for(B in b[N])this.terminals_[B]&&B>k&&q.push("'"+this.terminals_[B]+"'");M.showPosition?Z="Parse error on line "+(C+1)+`: +`,"getStyles"),YLt=ULt,DU=x(function(t,e){return xL(t,e)},"drawRect"),XLt=x(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=_b().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}x(a,"smile");function s(l){const u=_b().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}x(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return x(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),s6e=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),o6e=x(function(t,e){return dmt(t,e)},"drawText"),jLt=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,o6e(t,e)},"drawLabel"),KLt=x(function(t,e,r){const n=t.append("g"),i=Yo();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,DU(n,i),l6e(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),HB=-1,ZLt=x(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");HB++,a.append("line").attr("id",n+"-task"+HB).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),XLt(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Yo();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,DU(a,o);let l=e.x+14;e.people.forEach(u=>{const h=e.actors[u].color,d={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};s6e(a,d),l+=10}),l6e(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),QLt=x(function(t,e){U2e(t,e)},"drawBackgroundRect"),l6e=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y{const a=ih[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:ih[i].position};Nk.drawCircle(t,s);let o=t.append("text").attr("visibility","hidden").text(i);const l=o.node().getBoundingClientRect().width;o.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";o=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(o.text(p),o.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,o.text(f),o.node().getBoundingClientRect().width>r){let m="";for(const y of f)m+=y,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=y);d=m}}else d=p}),d&&u.push(d),o.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=Nk.drawText(t,f).node().getBoundingClientRect().width;g>J3&&g>e.leftMargin-g&&(J3=g)}),n+=Math.max(20,u.length*20)})}x(c6e,"drawActorLegend");var Dl=Fe().journey,xd=0,t7t=x(function(t,e,r,n){const i=Fe(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=ut("#i"+e));const h=ut(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");il.init();const d=h.select("#"+e);Nk.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in ih)delete ih[w];let m=0;g.forEach(w=>{ih[w]={color:Dl.actorColours[m%Dl.actorColours.length],position:m},m++}),c6e(d),xd=Dl.leftMargin+J3,il.insert(0,0,xd,Object.keys(ih).length*50),r7t(d,f,0,e);const y=il.getBounds();p&&d.append("text").text(p).attr("x",xd).attr("font-size",s).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",o);const v=y.stopy-y.starty+2*Dl.diagramMarginY,T=xd+y.stopx+2*Dl.diagramMarginX;Ai(d,v,T,Dl.useMaxWidth),d.append("line").attr("x1",xd).attr("y1",Dl.height*4).attr("x2",T-xd-4).attr("y2",Dl.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const b=p?70:0;d.attr("viewBox",`${y.startx} -25 ${T} ${v+b}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",v+b+25)},"draw"),il={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:x(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=Fe().journey,a=this;let s=0;function o(l){return x(function(h){s++;const d=a.sequenceItems.length-s+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(il.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(il.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(h,"startx",t-d*i.boxMargin,Math.min),a.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),a.updateVal(il.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(il.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}x(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:x(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(il.data,"startx",i,Math.min),this.updateVal(il.data,"starty",s,Math.min),this.updateVal(il.data,"stopx",a,Math.max),this.updateVal(il.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return this.data},"getBounds")},HN=Dl.sectionFills,Nie=Dl.sectionColours,r7t=x(function(t,e,r,n){const i=Fe().journey;let a="";const s=i.height*2+i.diagramMarginY,o=r+s;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(a!==p.section){u=HN[l%HN.length],d=l%HN.length,h=Nie[l%Nie.length];let m=0;const y=p.section;for(let T=f;T(ih[y]&&(m[y]=ih[y]),m),{});p.x=f*i.taskMargin+f*i.width+xd,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,Nk.drawTask(t,p,i,n),il.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),Die={setConf:e7t,draw:t7t},n7t={parser:PLt,db:Iie,renderer:Die,styles:YLt,init:x(t=>{Die.setConf(t.journey),Iie.clear()},"init")};const i7t=Object.freeze(Object.defineProperty({__proto__:null,diagram:n7t},Symbol.toStringTag,{value:"Module"}));var qB=(function(){var t=x(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],a=[1,15],s=[1,16],o=[1,19],l=[1,20],u={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:x(function(p,g,m,y,v,T,b){var w=T.length-1;switch(v){case 1:return T[w-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:T[w-1].push(T[w]),this.$=T[w-1];break;case 7:case 8:this.$=T[w];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(T[w].substr(6)),this.$=T[w].substr(6);break;case 12:this.$=T[w].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=T[w].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(T[w].substr(8)),this.$=T[w].substr(8);break;case 18:y.addTask(T[w],0,""),this.$=T[w];break;case 19:y.addEvent(T[w].substr(2)),this.$=T[w];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(e,[2,5],{5:6}),t(e,[2,2]),t(e,[2,3]),t(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,8]),t(e,[2,9]),t(e,[2,11]),{16:[1,22]},{18:[1,23]},t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,7]),t(e,[2,12]),t(e,[2,13])],defaultActions:{},parseError:x(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:x(function(p){var g=this,m=[0],y=[],v=[null],T=[],b=this.table,w="",C=0,S=0,k=2,E=1,_=T.slice.call(arguments,1),M=Object.create(this.lexer),L={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(L.yy[P]=this.yy[P]);M.setInput(p,L.yy),L.yy.lexer=M,L.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var D=M.yylloc;T.push(D);var R=M.options&&M.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function I(Y){m.length=m.length-2*Y,v.length=v.length-Y,T.length=T.length-Y}x(I,"popStack");function $(){var Y;return Y=y.pop()||M.lex()||E,typeof Y!="number"&&(Y instanceof Array&&(y=Y,Y=y.pop()),Y=g.symbols_[Y]||Y),Y}x($,"lex");for(var O,N,F,z,V={},B,G,H,q;;){if(N=m[m.length-1],this.defaultActions[N]?F=this.defaultActions[N]:((O===null||typeof O>"u")&&(O=$()),F=b[N]&&b[N][O]),typeof F>"u"||!F.length||!F[0]){var Z="";q=[];for(B in b[N])this.terminals_[B]&&B>k&&q.push("'"+this.terminals_[B]+"'");M.showPosition?Z="Parse error on line "+(C+1)+`: `+M.showPosition()+` Expecting `+q.join(", ")+", got '"+(this.terminals_[O]||O)+"'":Z="Parse error on line "+(C+1)+": Unexpected "+(O==E?"end of input":"'"+(this.terminals_[O]||O)+"'"),this.parseError(Z,{text:M.match,token:this.terminals_[O]||O,line:M.yylineno,loc:D,expected:q})}if(F[0]instanceof Array&&F.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+O);switch(F[0]){case 1:m.push(O),v.push(M.yytext),T.push(M.yylloc),m.push(F[1]),O=null,S=M.yyleng,w=M.yytext,C=M.yylineno,D=M.yylloc;break;case 2:if(G=this.productions_[F[1]][1],V.$=v[v.length-G],V._$={first_line:T[T.length-(G||1)].first_line,last_line:T[T.length-1].last_line,first_column:T[T.length-(G||1)].first_column,last_column:T[T.length-1].last_column},R&&(V._$.range=[T[T.length-(G||1)].range[0],T[T.length-1].range[1]]),z=this.performAction.apply(V,[w,S,C,L.yy,F[1],v,T].concat(_)),typeof z<"u")return z;G&&(m=m.slice(0,-1*G*2),v=v.slice(0,-1*G),T=T.slice(0,-1*G)),m.push(this.productions_[F[1]][0]),v.push(V.$),T.push(V._$),H=b[m[m.length-2]][m[m.length-1]],m.push(H);break;case 3:return!0}}return!0},"parse")},h=(function(){var f={EOF:1,parseError:x(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:x(function(p,g){return this.yy=g||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var g=p.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:x(function(p){var g=p.length,m=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var v=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:m?(m.length===y.length?this.yylloc.first_column:0)+y[y.length-m.length].length-m[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(p){this.unput(this.match.slice(p))},"less"),pastInput:x(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+` `+g+"^"},"showPosition"),test_match:x(function(p,g){var m,y,v;if(this.options.backtrack_lexer&&(v={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(v.yylloc.range=this.yylloc.range.slice(0))),y=p[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+p[0].length},this.yytext+=p[0],this.match+=p[0],this.matches=p,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(p[0].length),this.matched+=p[0],m=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack){for(var T in v)this[T]=v[T];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,g,m,y;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),T=0;Tg[0].length)){if(g=m,y=T,this.options.backtrack_lexer){if(p=this.test_match(m,v[T]),p!==!1)return p;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(p=this.test_match(g,v[y]),p!==!1?p:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var g=this.next();return g||this.lex()},"lex"),begin:x(function(g){this.conditionStack.push(g)},"begin"),popState:x(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:x(function(g){this.begin(g)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(g,m,y,v){switch(y){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f})();u.lexer=h;function d(){this.yy={}}return x(d,"Parser"),d.prototype=u,u.Parser=d,new d})();qB.parser=qB;var r7t=qB,c6e={};Z6(c6e,{addEvent:()=>b6e,addSection:()=>g6e,addTask:()=>v6e,addTaskOrg:()=>x6e,clear:()=>d6e,default:()=>n7t,getCommonDb:()=>h6e,getDirection:()=>p6e,getSections:()=>m6e,getTasks:()=>y6e,setDirection:()=>f6e});var ux="",u6e=0,OU="LR",$U=[],C6=[],hx=[],h6e=x(()=>Sz,"getCommonDb"),d6e=x(function(){$U.length=0,C6.length=0,ux="",hx.length=0,OU="LR",On()},"clear"),f6e=x(function(t){OU=t},"setDirection"),p6e=x(function(){return OU},"getDirection"),g6e=x(function(t){ux=t,$U.push(t)},"addSection"),m6e=x(function(){return $U},"getSections"),y6e=x(function(){let t=Die();const e=100;let r=0;for(;!t&&rr.id===u6e-1).events.push(t)},"addEvent"),x6e=x(function(t){const e={section:ux,type:ux,description:t,task:t,classes:[]};C6.push(e)},"addTaskOrg"),Die=x(function(){const t=x(function(r){return hx[r].processed},"compileTask");let e=!0;for(const[r,n]of hx.entries())t(r),e=e&&n.processed;return e},"compileTasks"),n7t={clear:d6e,getCommonDb:h6e,getDirection:p6e,setDirection:f6e,addSection:g6e,getSections:m6e,getTasks:y6e,addTask:v6e,addTaskOrg:x6e,addEvent:b6e},T6e=0,B7=x(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),i7t=x(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=_b().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}x(a,"smile");function s(l){const u=_b().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}x(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return x(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),a7t=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),w6e=x(function(t,e){const r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),s7t=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,w6e(t,e)},"drawLabel"),o7t=x(function(t,e,r){const n=t.append("g"),i=PU();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,B7(n,i),C6e(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),UB=-1,l7t=x(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");UB++,a.append("line").attr("id",n+"-task"+UB).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),i7t(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=PU();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,B7(a,o),C6e(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),c7t=x(function(t,e){B7(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),u7t=x(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),PU=x(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),C6e=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y)/).reverse(),i,a=[],s=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;he||i==="
")&&(a.pop(),u.text(a.join(" ").trim()),i==="
"?a=[""]:a=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em").text(i))})}x(BU,"wrap");var d7t=x(function(t,e,r,n,i,a=!1){var v,T,b;const{theme:s,look:o}=n,l=s==null?void 0:s.includes("redux"),u=((v=n==null?void 0:n.themeVariables)==null?void 0:v.THEME_COLOR_LIMIT)??12,h=r%u-1,d=t.append("g");e.section=h,d.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+h));const f=d.append("g"),p=d.append("g"),m=p.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(BU,e.width).node().getBBox(),y=(T=n.fontSize)!=null&&T.replace?n.fontSize.replace("px",""):n.fontSize;if(e.height=m.height+y*1.1*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,p.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),l&&p.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),p7t(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const w=s.includes("dark"),C=((b=t.node())==null?void 0:b.ownerSVGElement)??t.node(),S=ut(C),k=S.attr("id")??"",E=k?`${k}-drop-shadow`:"drop-shadow";if(S.select(`#${E}`).empty()){const _=S.select("defs");(_.empty()?S.append("defs"):_).append("filter").attr("id",E).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",w?"0.2":"0.06").attr("flood-color",w?"#FFFFFF":"#000000")}}return e},"drawNode"),f7t=x(function(t,e,r){var o;const n=t.append("g"),a=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(BU,e.width).node().getBBox(),s=(o=r.fontSize)!=null&&o.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),a.height+s*1.1*.5+e.padding},"getVirtualNodeHeight"),p7t=x(function(t,e,r,n,i){const{theme:a}=i,s=a!=null&&a.includes("redux")?0:5,o=5,l=s>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${s},${s},-${s} h${e.width-2*o} q${s},0,${s},${s} v${e.height-o} H0 Z`:`M0 ${e.height-o} v${-(e.height-o)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+T6e++).attr("class","node-bkg node-"+e.type).attr("d",l),a!=null&&a.includes("redux")||t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),mo={drawRect:B7,drawCircle:a7t,drawSection:o7t,drawText:w6e,drawLabel:s7t,drawTask:l7t,drawBackgroundRect:c7t,getTextObj:u7t,getNoteRect:PU,initGraphics:h7t,drawNode:d7t,getVirtualNodeHeight:f7t},g7t=x(function(t,e,r,n){var I,$,O;const i=Fe(),{look:a,theme:s,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((I=i.timeline)==null?void 0:I.leftMargin)??50;le.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=ut("#i"+e));const m=ut(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();le.debug("task",y),mo.initGraphics(m,e);const T=n.db.getSections();le.debug("sections",T);let b=0,w=0,C=0,S=0,k=50+d,E=50;S=50;let _=0,M=!0;T.forEach(function(N){const F={number:_,descr:N,section:_,width:150,padding:20,maxHeight:b},z=mo.getVirtualNodeHeight(m,F,i);le.debug("sectionHeight before draw",z),b=Math.max(b,z+20)});let L=0,P=0;le.debug("tasks.length",y.length);for(const[N,F]of y.entries()){const z={number:N,descr:F,section:F.section,width:150,padding:20,maxHeight:w},V=mo.getVirtualNodeHeight(m,z,i);le.debug("taskHeight before draw",V),w=Math.max(w,V+20),L=Math.max(L,F.events.length);let B=0;for(const G of F.events){const H={descr:G,section:F.section,number:F.section,width:150,padding:20,maxHeight:50};B+=mo.getVirtualNodeHeight(m,H,i)}F.events.length>0&&(B+=(F.events.length-1)*10),P=Math.max(P,B)}le.debug("maxSectionHeight before draw",b),le.debug("maxTaskHeight before draw",w),T&&T.length>0?T.forEach(N=>{const F=y.filter(G=>G.section===N),z={number:_,descr:N,section:_,width:200*Math.max(F.length,1)-50,padding:20,maxHeight:b};le.debug("sectionNode",z);const V=m.append("g"),B=mo.drawNode(V,z,_,i,e);le.debug("sectionNode output",B),V.attr("transform",`translate(${k}, ${S})`),E+=b+50,F.length>0&&Oie(m,F,_,k,E,w,i,L,P,b,!1,e),k+=200*Math.max(F.length,1),E=S,_++}):(M=!1,Oie(m,y,_,k,E,w,i,L,P,b,!0,e));const D=m.node().getBBox();if(le.debug("bounds",D),v&&m.append("text").text(v).attr("x",a==="neo"?D.x*2+d:D.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),C=M?b+w+150:w+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",C).attr("x2",D.width+3*d).attr("y2",C).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),a==="neo"&&l&&s!=="neutral"){const N=m.select("defs"),z=(N.empty()?m.append("defs"):N).append("linearGradient").attr("id",m.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");z.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),z.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}mx(void 0,m,(($=i.timeline)==null?void 0:$.padding)??50,((O=i.timeline)==null?void 0:O.useMaxWidth)??!1)},"draw"),Oie=x(function(t,e,r,n,i,a,s,o,l,u,h,d){var f;for(const p of e){const g={descr:p.task,section:r,number:r,width:150,padding:20,maxHeight:a};le.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),v=mo.drawNode(m,g,r,s,d).height;if(le.debug("taskHeight after draw",v),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,v),p.events){const T=t.append("g").attr("class","lineWrapper");let b=a;i+=100,b=b+m7t(t,p.events,r,n,i,s,d),i-=100,T.append("line").attr("x1",n+190/2).attr("y1",i+a).attr("x2",n+190/2).attr("y2",i+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${d}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,h&&!((f=s.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),m7t=x(function(t,e,r,n,i,a,s){let o=0;const l=i;i=i+100;for(const u of e){const h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};le.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=mo.drawNode(d,h,r,a,s,!0).height;o=o+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,o},"drawEvents"),y7t={setConf:x(()=>{},"setConf"),draw:g7t},F7=200,Yu=5,v7t=F7+Yu*2,FU=F7+100,b7t=FU+Yu*2,k6e=10,x7t=0,$ie=20,S6e=20,Pie=30,E6e=50,T7t=x(function(t,e,r,n){var I,$,O,N,F;const i=Fe(),a=((I=i.timeline)==null?void 0:I.leftMargin)??50;le.debug("timeline",n.db);const s=xs(e);s.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();le.debug("task",o),mo.initGraphics(s);const u=n.db.getSections();le.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,y=v7t+S6e,v=b7t+E6e,T=m+y;let b=0;const w=u&&u.length>0,C=w?T:f+y,S=Math.max(50,y+v-Yu*2);u.forEach(function(z){const V={number:b,descr:z,section:b,width:S,padding:Yu,maxHeight:h},B=mo.getVirtualNodeHeight(s,V,i);le.debug("sectionHeight before draw",B),h=Math.max(h,B)});let k=0;le.debug("tasks.length",o.length);for(const[z,V]of o.entries()){const B={number:z,descr:V,section:V.section,width:F7,padding:Yu,maxHeight:d},G=mo.getVirtualNodeHeight(s,B,i);le.debug("taskHeight before draw",G),d=Math.max(d,G);let H=0;for(const q of V.events){const Z={descr:q,section:V.section,number:V.section,width:FU,padding:Yu,maxHeight:50};H+=mo.getVirtualNodeHeight(s,Z,i)}V.events.length>0&&(H+=(V.events.length-1)*k6e),k=Math.max(k,H)+x7t}le.debug("maxSectionHeight before draw",h),le.debug("maxTaskHeight before draw",d);const _=Math.max(d,k)+Pie;w?u.forEach(z=>{const V=o.filter(K=>K.section===z),B={number:b,descr:z,section:b,width:S,padding:Yu,maxHeight:h};le.debug("sectionNode",B);const G=s.append("g"),H=mo.drawNode(G,B,b,i);le.debug("sectionNode output",H);const q=C-y;G.attr("transform",`translate(${q}, ${p})`);const Z=p+H.height+$ie;V.length>0&&Bie(s,V,b,C,Z,d,i,_,!1);const Y=V.length,ie=H.height+$ie+_*Math.max(Y,1)-(Y>0?Pie*2:0);p+=ie,b++}):Bie(s,o,b,C,p,d,i,_,!0);let M=($=s.node())==null?void 0:$.getBBox();if(!M)throw new Error("bbox not found");if(le.debug("bounds",M),l){if(s.append("text").text(l).attr("x",M.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),M=(O=s.node())==null?void 0:O.getBBox(),!M)throw new Error("bbox not found");le.debug("bounds after title",M)}const[L]=Oh(i.fontSize),P=(L??16)*2,D=(L??16)*.5+20,R=s.append("g").attr("class","lineWrapper");R.append("line").attr("x1",C).attr("y1",g-P).attr("x2",C).attr("y2",M.y+M.height+D).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),R.lower(),mx(void 0,s,((N=i.timeline)==null?void 0:N.padding)??50,((F=i.timeline)==null?void 0:F.useMaxWidth)??!1)},"draw"),Bie=x(function(t,e,r,n,i,a,s,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:F7,padding:Yu,maxHeight:a};le.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=mo.drawNode(f,d,r,s),g=p.height;le.debug("taskHeight after draw",g);const m=n-S6e-p.width;if(f.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,g),h.events&&h.events.length>0){const y=i,v=n+E6e;w7t(t,h.events,r,n,v,y,s)}i=i+o,l&&!((u=s.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),w7t=x(function(t,e,r,n,i,a,s){let o=a;for(const l of e){const u={descr:l,section:r,number:r,width:FU,padding:Yu,maxHeight:0};le.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=mo.drawNode(h,u,r,s).height;h.attr("transform",`translate(${i}, ${o})`);const p=t.append("g").attr("class","lineWrapper"),g=o+f/2;p.append("line").attr("x1",n).attr("y1",g).attr("x2",i).attr("y2",g).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+f+k6e}return o-a},"drawEvents"),C7t={setConf:x(()=>{},"setConf"),draw:T7t},k7t=x(t=>{var o;const{theme:e}=Xt(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"",a=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let s="";for(let l=0;l0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:x(function(g){this.begin(g)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(g,m,y,v){switch(y){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f})();u.lexer=h;function d(){this.yy={}}return x(d,"Parser"),d.prototype=u,u.Parser=d,new d})();qB.parser=qB;var a7t=qB,u6e={};Z6(u6e,{addEvent:()=>x6e,addSection:()=>m6e,addTask:()=>b6e,addTaskOrg:()=>T6e,clear:()=>f6e,default:()=>s7t,getCommonDb:()=>d6e,getDirection:()=>g6e,getSections:()=>y6e,getTasks:()=>v6e,setDirection:()=>p6e});var ux="",h6e=0,OU="LR",$U=[],C6=[],hx=[],d6e=x(()=>Sz,"getCommonDb"),f6e=x(function(){$U.length=0,C6.length=0,ux="",hx.length=0,OU="LR",$n()},"clear"),p6e=x(function(t){OU=t},"setDirection"),g6e=x(function(){return OU},"getDirection"),m6e=x(function(t){ux=t,$U.push(t)},"addSection"),y6e=x(function(){return $U},"getSections"),v6e=x(function(){let t=Oie();const e=100;let r=0;for(;!t&&rr.id===h6e-1).events.push(t)},"addEvent"),T6e=x(function(t){const e={section:ux,type:ux,description:t,task:t,classes:[]};C6.push(e)},"addTaskOrg"),Oie=x(function(){const t=x(function(r){return hx[r].processed},"compileTask");let e=!0;for(const[r,n]of hx.entries())t(r),e=e&&n.processed;return e},"compileTasks"),s7t={clear:f6e,getCommonDb:d6e,getDirection:g6e,setDirection:p6e,addSection:m6e,getSections:y6e,getTasks:v6e,addTask:b6e,addTaskOrg:T6e,addEvent:x6e},w6e=0,B7=x(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),o7t=x(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=_b().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}x(a,"smile");function s(l){const u=_b().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}x(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return x(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),l7t=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),C6e=x(function(t,e){const r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),c7t=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,C6e(t,e)},"drawLabel"),u7t=x(function(t,e,r){const n=t.append("g"),i=PU();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,B7(n,i),k6e(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),UB=-1,h7t=x(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");UB++,a.append("line").attr("id",n+"-task"+UB).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),o7t(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=PU();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,B7(a,o),k6e(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),d7t=x(function(t,e){B7(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),f7t=x(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),PU=x(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),k6e=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y)/).reverse(),i,a=[],s=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;he||i==="
")&&(a.pop(),u.text(a.join(" ").trim()),i==="
"?a=[""]:a=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em").text(i))})}x(BU,"wrap");var g7t=x(function(t,e,r,n,i,a=!1){var v,T,b;const{theme:s,look:o}=n,l=s==null?void 0:s.includes("redux"),u=((v=n==null?void 0:n.themeVariables)==null?void 0:v.THEME_COLOR_LIMIT)??12,h=r%u-1,d=t.append("g");e.section=h,d.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+h));const f=d.append("g"),p=d.append("g"),m=p.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(BU,e.width).node().getBBox(),y=(T=n.fontSize)!=null&&T.replace?n.fontSize.replace("px",""):n.fontSize;if(e.height=m.height+y*1.1*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,p.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),l&&p.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),y7t(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const w=s.includes("dark"),C=((b=t.node())==null?void 0:b.ownerSVGElement)??t.node(),S=ut(C),k=S.attr("id")??"",E=k?`${k}-drop-shadow`:"drop-shadow";if(S.select(`#${E}`).empty()){const _=S.select("defs");(_.empty()?S.append("defs"):_).append("filter").attr("id",E).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",w?"0.2":"0.06").attr("flood-color",w?"#FFFFFF":"#000000")}}return e},"drawNode"),m7t=x(function(t,e,r){var o;const n=t.append("g"),a=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(BU,e.width).node().getBBox(),s=(o=r.fontSize)!=null&&o.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),a.height+s*1.1*.5+e.padding},"getVirtualNodeHeight"),y7t=x(function(t,e,r,n,i){const{theme:a}=i,s=a!=null&&a.includes("redux")?0:5,o=5,l=s>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${s},${s},-${s} h${e.width-2*o} q${s},0,${s},${s} v${e.height-o} H0 Z`:`M0 ${e.height-o} v${-(e.height-o)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+w6e++).attr("class","node-bkg node-"+e.type).attr("d",l),a!=null&&a.includes("redux")||t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),mo={drawRect:B7,drawCircle:l7t,drawSection:u7t,drawText:C6e,drawLabel:c7t,drawTask:h7t,drawBackgroundRect:d7t,getTextObj:f7t,getNoteRect:PU,initGraphics:p7t,drawNode:g7t,getVirtualNodeHeight:m7t},v7t=x(function(t,e,r,n){var I,$,O;const i=Fe(),{look:a,theme:s,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((I=i.timeline)==null?void 0:I.leftMargin)??50;le.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=ut("#i"+e));const m=ut(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();le.debug("task",y),mo.initGraphics(m,e);const T=n.db.getSections();le.debug("sections",T);let b=0,w=0,C=0,S=0,k=50+d,E=50;S=50;let _=0,M=!0;T.forEach(function(N){const F={number:_,descr:N,section:_,width:150,padding:20,maxHeight:b},z=mo.getVirtualNodeHeight(m,F,i);le.debug("sectionHeight before draw",z),b=Math.max(b,z+20)});let L=0,P=0;le.debug("tasks.length",y.length);for(const[N,F]of y.entries()){const z={number:N,descr:F,section:F.section,width:150,padding:20,maxHeight:w},V=mo.getVirtualNodeHeight(m,z,i);le.debug("taskHeight before draw",V),w=Math.max(w,V+20),L=Math.max(L,F.events.length);let B=0;for(const G of F.events){const H={descr:G,section:F.section,number:F.section,width:150,padding:20,maxHeight:50};B+=mo.getVirtualNodeHeight(m,H,i)}F.events.length>0&&(B+=(F.events.length-1)*10),P=Math.max(P,B)}le.debug("maxSectionHeight before draw",b),le.debug("maxTaskHeight before draw",w),T&&T.length>0?T.forEach(N=>{const F=y.filter(G=>G.section===N),z={number:_,descr:N,section:_,width:200*Math.max(F.length,1)-50,padding:20,maxHeight:b};le.debug("sectionNode",z);const V=m.append("g"),B=mo.drawNode(V,z,_,i,e);le.debug("sectionNode output",B),V.attr("transform",`translate(${k}, ${S})`),E+=b+50,F.length>0&&$ie(m,F,_,k,E,w,i,L,P,b,!1,e),k+=200*Math.max(F.length,1),E=S,_++}):(M=!1,$ie(m,y,_,k,E,w,i,L,P,b,!0,e));const D=m.node().getBBox();if(le.debug("bounds",D),v&&m.append("text").text(v).attr("x",a==="neo"?D.x*2+d:D.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),C=M?b+w+150:w+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",C).attr("x2",D.width+3*d).attr("y2",C).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),a==="neo"&&l&&s!=="neutral"){const N=m.select("defs"),z=(N.empty()?m.append("defs"):N).append("linearGradient").attr("id",m.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");z.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),z.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}mx(void 0,m,(($=i.timeline)==null?void 0:$.padding)??50,((O=i.timeline)==null?void 0:O.useMaxWidth)??!1)},"draw"),$ie=x(function(t,e,r,n,i,a,s,o,l,u,h,d){var f;for(const p of e){const g={descr:p.task,section:r,number:r,width:150,padding:20,maxHeight:a};le.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),v=mo.drawNode(m,g,r,s,d).height;if(le.debug("taskHeight after draw",v),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,v),p.events){const T=t.append("g").attr("class","lineWrapper");let b=a;i+=100,b=b+b7t(t,p.events,r,n,i,s,d),i-=100,T.append("line").attr("x1",n+190/2).attr("y1",i+a).attr("x2",n+190/2).attr("y2",i+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${d}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,h&&!((f=s.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),b7t=x(function(t,e,r,n,i,a,s){let o=0;const l=i;i=i+100;for(const u of e){const h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};le.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=mo.drawNode(d,h,r,a,s,!0).height;o=o+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,o},"drawEvents"),x7t={setConf:x(()=>{},"setConf"),draw:v7t},F7=200,Yu=5,T7t=F7+Yu*2,FU=F7+100,w7t=FU+Yu*2,S6e=10,C7t=0,Pie=20,E6e=20,Bie=30,A6e=50,k7t=x(function(t,e,r,n){var I,$,O,N,F;const i=Fe(),a=((I=i.timeline)==null?void 0:I.leftMargin)??50;le.debug("timeline",n.db);const s=xs(e);s.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();le.debug("task",o),mo.initGraphics(s);const u=n.db.getSections();le.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,y=T7t+E6e,v=w7t+A6e,T=m+y;let b=0;const w=u&&u.length>0,C=w?T:f+y,S=Math.max(50,y+v-Yu*2);u.forEach(function(z){const V={number:b,descr:z,section:b,width:S,padding:Yu,maxHeight:h},B=mo.getVirtualNodeHeight(s,V,i);le.debug("sectionHeight before draw",B),h=Math.max(h,B)});let k=0;le.debug("tasks.length",o.length);for(const[z,V]of o.entries()){const B={number:z,descr:V,section:V.section,width:F7,padding:Yu,maxHeight:d},G=mo.getVirtualNodeHeight(s,B,i);le.debug("taskHeight before draw",G),d=Math.max(d,G);let H=0;for(const q of V.events){const Z={descr:q,section:V.section,number:V.section,width:FU,padding:Yu,maxHeight:50};H+=mo.getVirtualNodeHeight(s,Z,i)}V.events.length>0&&(H+=(V.events.length-1)*S6e),k=Math.max(k,H)+C7t}le.debug("maxSectionHeight before draw",h),le.debug("maxTaskHeight before draw",d);const _=Math.max(d,k)+Bie;w?u.forEach(z=>{const V=o.filter(K=>K.section===z),B={number:b,descr:z,section:b,width:S,padding:Yu,maxHeight:h};le.debug("sectionNode",B);const G=s.append("g"),H=mo.drawNode(G,B,b,i);le.debug("sectionNode output",H);const q=C-y;G.attr("transform",`translate(${q}, ${p})`);const Z=p+H.height+Pie;V.length>0&&Fie(s,V,b,C,Z,d,i,_,!1);const Y=V.length,ie=H.height+Pie+_*Math.max(Y,1)-(Y>0?Bie*2:0);p+=ie,b++}):Fie(s,o,b,C,p,d,i,_,!0);let M=($=s.node())==null?void 0:$.getBBox();if(!M)throw new Error("bbox not found");if(le.debug("bounds",M),l){if(s.append("text").text(l).attr("x",M.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),M=(O=s.node())==null?void 0:O.getBBox(),!M)throw new Error("bbox not found");le.debug("bounds after title",M)}const[L]=Oh(i.fontSize),P=(L??16)*2,D=(L??16)*.5+20,R=s.append("g").attr("class","lineWrapper");R.append("line").attr("x1",C).attr("y1",g-P).attr("x2",C).attr("y2",M.y+M.height+D).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),R.lower(),mx(void 0,s,((N=i.timeline)==null?void 0:N.padding)??50,((F=i.timeline)==null?void 0:F.useMaxWidth)??!1)},"draw"),Fie=x(function(t,e,r,n,i,a,s,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:F7,padding:Yu,maxHeight:a};le.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=mo.drawNode(f,d,r,s),g=p.height;le.debug("taskHeight after draw",g);const m=n-E6e-p.width;if(f.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,g),h.events&&h.events.length>0){const y=i,v=n+A6e;S7t(t,h.events,r,n,v,y,s)}i=i+o,l&&!((u=s.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),S7t=x(function(t,e,r,n,i,a,s){let o=a;for(const l of e){const u={descr:l,section:r,number:r,width:FU,padding:Yu,maxHeight:0};le.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=mo.drawNode(h,u,r,s).height;h.attr("transform",`translate(${i}, ${o})`);const p=t.append("g").attr("class","lineWrapper"),g=o+f/2;p.append("line").attr("x1",n).attr("y1",g).attr("x2",i).attr("y2",g).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+f+S6e}return o-a},"drawEvents"),E7t={setConf:x(()=>{},"setConf"),draw:k7t},A7t=x(t=>{var o;const{theme:e}=Xt(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"",a=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let s="";for(let l=0;l{let e="";for(let r=0;r{let e="";for(let r=0;r{var s;const{theme:e}=Xt(),r=e==null?void 0:e.includes("redux"),n=e==="neutral",i=((s=t.svgId)==null?void 0:s.replace(/^#/,""))??"";let a="";if(t.useGradient&&i&&t.THEME_COLOR_LIMIT&&!n)for(let o=0;o{var s;const{theme:e}=Xt(),r=e==null?void 0:e.includes("redux"),n=e==="neutral",i=((s=t.svgId)==null?void 0:s.replace(/^#/,""))??"";let a="";if(t.useGradient&&i&&t.THEME_COLOR_LIMIT&&!n)for(let o=0;o{},"setConf"),draw:x((t,e,r,n)=>{var a,s;return(((s=(a=n==null?void 0:n.db)==null?void 0:a.getDirection)==null?void 0:s.call(a))??"LR")==="TD"?C7t.draw(t,e,r,n):y7t.draw(t,e,r,n)},"draw")},R7t={db:c6e,renderer:_7t,parser:r7t,styles:A7t};const L7t=Object.freeze(Object.defineProperty({__proto__:null,diagram:R7t},Symbol.toStringTag,{value:"Module"})),za=[];for(let t=0;t<256;++t)za.push((t+256).toString(16).slice(1));function M7t(t,e=0){return(za[t[e+0]]+za[t[e+1]]+za[t[e+2]]+za[t[e+3]]+"-"+za[t[e+4]]+za[t[e+5]]+"-"+za[t[e+6]]+za[t[e+7]]+"-"+za[t[e+8]]+za[t[e+9]]+"-"+za[t[e+10]]+za[t[e+11]]+za[t[e+12]]+za[t[e+13]]+za[t[e+14]]+za[t[e+15]]).toLowerCase()}const I7t=new Uint8Array(16);function N7t(){return crypto.getRandomValues(I7t)}function D7t(t,e,r){return crypto.randomUUID?crypto.randomUUID():O7t(t)}function O7t(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??N7t();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,M7t(n)}var YB=(function(){var t=x(function(w,C,S,k){for(S=S||{},k=w.length;k--;S[w[k]]=C);return S},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:x(function(C,S,k,E,_,M,L){var P=M.length-1;switch(_){case 6:case 7:return E;case 8:E.getLogger().trace("Stop NL ");break;case 9:E.getLogger().trace("Stop EOF ");break;case 11:E.getLogger().trace("Stop NL2 ");break;case 12:E.getLogger().trace("Stop EOF2 ");break;case 15:E.getLogger().info("Node: ",M[P].id),E.addNode(M[P-1].length,M[P].id,M[P].descr,M[P].type);break;case 16:E.getLogger().trace("Icon: ",M[P]),E.decorateNode({icon:M[P]});break;case 17:case 21:E.decorateNode({class:M[P]});break;case 18:E.getLogger().trace("SPACELIST");break;case 19:E.getLogger().trace("Node: ",M[P].id),E.addNode(0,M[P].id,M[P].descr,M[P].type);break;case 20:E.decorateNode({icon:M[P]});break;case 25:E.getLogger().trace("node found ..",M[P-2]),this.$={id:M[P-1],descr:M[P-1],type:E.getType(M[P-2],M[P])};break;case 26:this.$={id:M[P],descr:M[P],type:E.nodeType.DEFAULT};break;case 27:E.getLogger().trace("node found ..",M[P-3]),this.$={id:M[P-3],descr:M[P-1],type:E.getType(M[P-2],M[P])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:u,7:h,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(p,[2,14],{7:g,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(C,S){if(S.recoverable)this.trace(C);else{var k=new Error(C);throw k.hash=S,k}},"parseError"),parse:x(function(C){var S=this,k=[0],E=[],_=[null],M=[],L=this.table,P="",D=0,R=0,I=2,$=1,O=M.slice.call(arguments,1),N=Object.create(this.lexer),F={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(F.yy[z]=this.yy[z]);N.setInput(C,F.yy),F.yy.lexer=N,F.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var V=N.yylloc;M.push(V);var B=N.options&&N.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function G(Re){k.length=k.length-2*Re,_.length=_.length-Re,M.length=M.length-Re}x(G,"popStack");function H(){var Re;return Re=E.pop()||N.lex()||$,typeof Re!="number"&&(Re instanceof Array&&(E=Re,Re=E.pop()),Re=S.symbols_[Re]||Re),Re}x(H,"lex");for(var q,Z,Y,ie,K={},Q,te,J,ge;;){if(Z=k[k.length-1],this.defaultActions[Z]?Y=this.defaultActions[Z]:((q===null||typeof q>"u")&&(q=H()),Y=L[Z]&&L[Z][q]),typeof Y>"u"||!Y.length||!Y[0]){var ee="";ge=[];for(Q in L[Z])this.terminals_[Q]&&Q>I&&ge.push("'"+this.terminals_[Q]+"'");N.showPosition?ee="Parse error on line "+(D+1)+`: +`},"getStyles"),L7t=R7t,M7t={setConf:x(()=>{},"setConf"),draw:x((t,e,r,n)=>{var a,s;return(((s=(a=n==null?void 0:n.db)==null?void 0:a.getDirection)==null?void 0:s.call(a))??"LR")==="TD"?E7t.draw(t,e,r,n):x7t.draw(t,e,r,n)},"draw")},I7t={db:u6e,renderer:M7t,parser:a7t,styles:L7t};const N7t=Object.freeze(Object.defineProperty({__proto__:null,diagram:I7t},Symbol.toStringTag,{value:"Module"})),za=[];for(let t=0;t<256;++t)za.push((t+256).toString(16).slice(1));function D7t(t,e=0){return(za[t[e+0]]+za[t[e+1]]+za[t[e+2]]+za[t[e+3]]+"-"+za[t[e+4]]+za[t[e+5]]+"-"+za[t[e+6]]+za[t[e+7]]+"-"+za[t[e+8]]+za[t[e+9]]+"-"+za[t[e+10]]+za[t[e+11]]+za[t[e+12]]+za[t[e+13]]+za[t[e+14]]+za[t[e+15]]).toLowerCase()}const O7t=new Uint8Array(16);function $7t(){return crypto.getRandomValues(O7t)}function P7t(t,e,r){return crypto.randomUUID?crypto.randomUUID():B7t(t)}function B7t(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??$7t();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,D7t(n)}var YB=(function(){var t=x(function(w,C,S,k){for(S=S||{},k=w.length;k--;S[w[k]]=C);return S},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:x(function(C,S,k,E,_,M,L){var P=M.length-1;switch(_){case 6:case 7:return E;case 8:E.getLogger().trace("Stop NL ");break;case 9:E.getLogger().trace("Stop EOF ");break;case 11:E.getLogger().trace("Stop NL2 ");break;case 12:E.getLogger().trace("Stop EOF2 ");break;case 15:E.getLogger().info("Node: ",M[P].id),E.addNode(M[P-1].length,M[P].id,M[P].descr,M[P].type);break;case 16:E.getLogger().trace("Icon: ",M[P]),E.decorateNode({icon:M[P]});break;case 17:case 21:E.decorateNode({class:M[P]});break;case 18:E.getLogger().trace("SPACELIST");break;case 19:E.getLogger().trace("Node: ",M[P].id),E.addNode(0,M[P].id,M[P].descr,M[P].type);break;case 20:E.decorateNode({icon:M[P]});break;case 25:E.getLogger().trace("node found ..",M[P-2]),this.$={id:M[P-1],descr:M[P-1],type:E.getType(M[P-2],M[P])};break;case 26:this.$={id:M[P],descr:M[P],type:E.nodeType.DEFAULT};break;case 27:E.getLogger().trace("node found ..",M[P-3]),this.$={id:M[P-3],descr:M[P-1],type:E.getType(M[P-2],M[P])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:u,7:h,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(p,[2,14],{7:g,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(C,S){if(S.recoverable)this.trace(C);else{var k=new Error(C);throw k.hash=S,k}},"parseError"),parse:x(function(C){var S=this,k=[0],E=[],_=[null],M=[],L=this.table,P="",D=0,R=0,I=2,$=1,O=M.slice.call(arguments,1),N=Object.create(this.lexer),F={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(F.yy[z]=this.yy[z]);N.setInput(C,F.yy),F.yy.lexer=N,F.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var V=N.yylloc;M.push(V);var B=N.options&&N.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function G(Re){k.length=k.length-2*Re,_.length=_.length-Re,M.length=M.length-Re}x(G,"popStack");function H(){var Re;return Re=E.pop()||N.lex()||$,typeof Re!="number"&&(Re instanceof Array&&(E=Re,Re=E.pop()),Re=S.symbols_[Re]||Re),Re}x(H,"lex");for(var q,Z,Y,ie,K={},Q,te,J,ge;;){if(Z=k[k.length-1],this.defaultActions[Z]?Y=this.defaultActions[Z]:((q===null||typeof q>"u")&&(q=H()),Y=L[Z]&&L[Z][q]),typeof Y>"u"||!Y.length||!Y[0]){var ee="";ge=[];for(Q in L[Z])this.terminals_[Q]&&Q>I&&ge.push("'"+this.terminals_[Q]+"'");N.showPosition?ee="Parse error on line "+(D+1)+`: `+N.showPosition()+` Expecting `+ge.join(", ")+", got '"+(this.terminals_[q]||q)+"'":ee="Parse error on line "+(D+1)+": Unexpected "+(q==$?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(ee,{text:N.match,token:this.terminals_[q]||q,line:N.yylineno,loc:V,expected:ge})}if(Y[0]instanceof Array&&Y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+q);switch(Y[0]){case 1:k.push(q),_.push(N.yytext),M.push(N.yylloc),k.push(Y[1]),q=null,R=N.yyleng,P=N.yytext,D=N.yylineno,V=N.yylloc;break;case 2:if(te=this.productions_[Y[1]][1],K.$=_[_.length-te],K._$={first_line:M[M.length-(te||1)].first_line,last_line:M[M.length-1].last_line,first_column:M[M.length-(te||1)].first_column,last_column:M[M.length-1].last_column},B&&(K._$.range=[M[M.length-(te||1)].range[0],M[M.length-1].range[1]]),ie=this.performAction.apply(K,[P,R,D,F.yy,Y[1],_,M].concat(O)),typeof ie<"u")return ie;te&&(k=k.slice(0,-1*te*2),_=_.slice(0,-1*te),M=M.slice(0,-1*te)),k.push(this.productions_[Y[1]][0]),_.push(K.$),M.push(K._$),J=L[k[k.length-2]][k[k.length-1]],k.push(J);break;case 3:return!0}}return!0},"parse")},T=(function(){var w={EOF:1,parseError:x(function(S,k){if(this.yy.parser)this.yy.parser.parseError(S,k);else throw new Error(S)},"parseError"),setInput:x(function(C,S){return this.yy=S||this.yy||{},this._input=C,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var S=C.match(/(?:\r\n?|\n).*/g);return S?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),C},"input"),unput:x(function(C){var S=C.length,k=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-S),this.offset-=S;var E=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),k.length-1&&(this.yylineno-=k.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:k?(k.length===E.length?this.yylloc.first_column:0)+E[E.length-k.length].length-k[0].length:this.yylloc.first_column-S},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-S]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(C){this.unput(this.match.slice(C))},"less"),pastInput:x(function(){var C=this.matched.substr(0,this.matched.length-this.match.length);return(C.length>20?"...":"")+C.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var C=this.match;return C.length<20&&(C+=this._input.substr(0,20-C.length)),(C.substr(0,20)+(C.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var C=this.pastInput(),S=new Array(C.length+1).join("-");return C+this.upcomingInput()+` `+S+"^"},"showPosition"),test_match:x(function(C,S){var k,E,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),E=C[0].match(/(?:\r\n?|\n).*/g),E&&(this.yylineno+=E.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:E?E[E.length-1].length-E[E.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+C[0].length},this.yytext+=C[0],this.match+=C[0],this.matches=C,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(C[0].length),this.matched+=C[0],k=this.performAction.call(this,this.yy,this,S,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var M in _)this[M]=_[M];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var C,S,k,E;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),M=0;M<_.length;M++)if(k=this._input.match(this.rules[_[M]]),k&&(!S||k[0].length>S[0].length)){if(S=k,E=M,this.options.backtrack_lexer){if(C=this.test_match(k,_[M]),C!==!1)return C;if(this._backtrack){S=!1;continue}else return!1}else if(!this.options.flex)break}return S?(C=this.test_match(S,_[E]),C!==!1?C:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var S=this.next();return S||this.lex()},"lex"),begin:x(function(S){this.conditionStack.push(S)},"begin"),popState:x(function(){var S=this.conditionStack.length-1;return S>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:x(function(S){this.begin(S)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(S,k,E,_){switch(E){case 0:return S.getLogger().trace("Found comment",k.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:S.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return S.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:S.getLogger().trace("end icon"),this.popState();break;case 10:return S.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return S.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return S.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return S.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:S.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return S.getLogger().trace("description:",k.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),S.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),S.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),S.getLogger().trace("node end ...",k.yytext),"NODE_DEND";case 30:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 35:return S.getLogger().trace("Long description:",k.yytext),20;case 36:return S.getLogger().trace("Long description:",k.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return w})();v.lexer=T;function b(){this.yy={}}return x(b,"Parser"),b.prototype=v,v.Parser=b,new b})();YB.parser=YB;var $7t=YB,P7t=12,Du={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},ib,B7t=(ib=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=Du,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level0?this.nodes[0]:null}addNode(e,r,n,i){var h,d;le.info("addNode",e,r,n,i);let a=!1;this.nodes.length===0?(this.baseLevel=e,e=0,a=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,a=!1);const s=Fe();let o=((h=s.mindmap)==null?void 0:h.padding)??Vr.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2;break}const l={id:this.count++,nodeId:Wr(r,s),level:e,descr:Wr(n,s),type:i,children:[],width:((d=s.mindmap)==null?void 0:d.maxNodeWidth)??Vr.mindmap.maxNodeWidth,padding:o,isRoot:a},u=this.getParent(e);if(u)u.children.push(l),this.nodes.push(l);else if(a)this.nodes.push(l);else throw new Error(`There can be only one root. No parent could be found for ("${l.descr}")`)}getType(e,r){switch(le.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const r=Fe(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=Wr(e.icon,r)),e.class&&(n.class=Wr(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(const[n,i]of e.children.entries()){const a=e.level===0?n%(P7t-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=Fe(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const a=i.join(" "),s=x(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case Du.CIRCLE:return"mindmapCircle";case Du.RECT:return"rect";case Du.ROUNDED_RECT:return"rounded";case Du.CLOUD:return"cloud";case Du.BANG:return"bang";case Du.HEXAGON:return"hexagon";case Du.DEFAULT:return h?"rounded":"defaultMindmapNode";case Du.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:s(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:a,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(o),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=Fe();for(const i of e.children){let a="edge";i.section!==void 0&&(a+=` section-edge-${i.section}`);const s=e.level+1;a+=` edge-depth-${s}`;const o={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:n.look,classes:a,depth:e.level,section:i.section};r.push(o),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=Fe(),i=Zle().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};le.debug("getData: mindmapRoot",e,r),this.assignSections(e);const s=[],o=[];this.flattenNodes(e,s),this.generateEdges(e,o),le.debug(`getData: processed ${s.length} nodes and ${o.length} edges`);const l=new Map;for(const u of s)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:s,edges:o,config:a,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+D7t()}}getLogger(){return le}},x(ib,"MindmapDB"),ib),F7t=x(async(t,e,r,n)=>{var f,p;le.debug(`Rendering mindmap diagram -`+t);const i=n.db,a=i.getData(),s=Ox(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=nS(a.config.layout,{fallback:"cose-bilkent"}),a.diagramId=e,!i.getMindmap())return;a.nodes.forEach(g=>{g.shape==="rounded"?(g.radius=15,g.taper=15,g.stroke="none",g.width=0,g.padding=15):g.shape==="circle"?g.padding=10:g.shape==="rect"?(g.width=0,g.padding=10):g.shape==="hexagon"&&(g.width=0,g.height=0)}),await xx(a,s);const{themeVariables:l}=Xt(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=s.attr("id"),m=s.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");m.append("stop").attr("offset","0%").attr("stop-color",h).attr("stop-opacity",1),m.append("stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}mg(s,((f=a.config.mindmap)==null?void 0:f.padding)??Vr.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??Vr.mindmap.useMaxWidth)},"draw"),z7t={draw:F7t},V7t=x(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:x(function(S){this.begin(S)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(S,k,E,_){switch(E){case 0:return S.getLogger().trace("Found comment",k.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:S.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return S.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:S.getLogger().trace("end icon"),this.popState();break;case 10:return S.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return S.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return S.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return S.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:S.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return S.getLogger().trace("description:",k.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),S.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),S.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),S.getLogger().trace("node end ...",k.yytext),"NODE_DEND";case 30:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 35:return S.getLogger().trace("Long description:",k.yytext),20;case 36:return S.getLogger().trace("Long description:",k.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return w})();v.lexer=T;function b(){this.yy={}}return x(b,"Parser"),b.prototype=v,v.Parser=b,new b})();YB.parser=YB;var F7t=YB,z7t=12,Du={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},ib,V7t=(ib=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=Du,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level0?this.nodes[0]:null}addNode(e,r,n,i){var h,d;le.info("addNode",e,r,n,i);let a=!1;this.nodes.length===0?(this.baseLevel=e,e=0,a=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,a=!1);const s=Fe();let o=((h=s.mindmap)==null?void 0:h.padding)??Vr.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2;break}const l={id:this.count++,nodeId:Wr(r,s),level:e,descr:Wr(n,s),type:i,children:[],width:((d=s.mindmap)==null?void 0:d.maxNodeWidth)??Vr.mindmap.maxNodeWidth,padding:o,isRoot:a},u=this.getParent(e);if(u)u.children.push(l),this.nodes.push(l);else if(a)this.nodes.push(l);else throw new Error(`There can be only one root. No parent could be found for ("${l.descr}")`)}getType(e,r){switch(le.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const r=Fe(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=Wr(e.icon,r)),e.class&&(n.class=Wr(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(const[n,i]of e.children.entries()){const a=e.level===0?n%(z7t-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=Fe(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const a=i.join(" "),s=x(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case Du.CIRCLE:return"mindmapCircle";case Du.RECT:return"rect";case Du.ROUNDED_RECT:return"rounded";case Du.CLOUD:return"cloud";case Du.BANG:return"bang";case Du.HEXAGON:return"hexagon";case Du.DEFAULT:return h?"rounded":"defaultMindmapNode";case Du.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:s(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:a,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(o),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=Fe();for(const i of e.children){let a="edge";i.section!==void 0&&(a+=` section-edge-${i.section}`);const s=e.level+1;a+=` edge-depth-${s}`;const o={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:n.look,classes:a,depth:e.level,section:i.section};r.push(o),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=Fe(),i=Qle().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};le.debug("getData: mindmapRoot",e,r),this.assignSections(e);const s=[],o=[];this.flattenNodes(e,s),this.generateEdges(e,o),le.debug(`getData: processed ${s.length} nodes and ${o.length} edges`);const l=new Map;for(const u of s)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:s,edges:o,config:a,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+P7t()}}getLogger(){return le}},x(ib,"MindmapDB"),ib),G7t=x(async(t,e,r,n)=>{var f,p;le.debug(`Rendering mindmap diagram +`+t);const i=n.db,a=i.getData(),s=Ox(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=nS(a.config.layout,{fallback:"cose-bilkent"}),a.diagramId=e,!i.getMindmap())return;a.nodes.forEach(g=>{g.shape==="rounded"?(g.radius=15,g.taper=15,g.stroke="none",g.width=0,g.padding=15):g.shape==="circle"?g.padding=10:g.shape==="rect"?(g.width=0,g.padding=10):g.shape==="hexagon"&&(g.width=0,g.height=0)}),await xx(a,s);const{themeVariables:l}=Xt(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=s.attr("id"),m=s.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");m.append("stop").attr("offset","0%").attr("stop-color",h).attr("stop-opacity",1),m.append("stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}mg(s,((f=a.config.mindmap)==null?void 0:f.padding)??Vr.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??Vr.mindmap.useMaxWidth)},"draw"),W7t={draw:G7t},H7t=x(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i{let n="";for(let i=0;i{let n="";for(let i=0;i{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` + }`;return n},"genGradient"),U7t=x(t=>{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` .edge { stroke-width: 3; } - ${V7t(t)} + ${H7t(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -3047,18 +3049,18 @@ Expecting `+ge.join(", ")+", got '"+(this.terminals_[q]||q)+"'":ee="Parse error [data-look="neo"].mindmap-node.section-root .text-inner-tspan { fill: ${e!=null&&e.includes("redux")?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:0)]}; } - ${t.useGradient&&r&&t.mainBkg?G7t(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} -`},"getStyles"),H7t=W7t,q7t={get db(){return new B7t},renderer:z7t,parser:$7t,styles:H7t};const U7t=Object.freeze(Object.defineProperty({__proto__:null,diagram:q7t},Symbol.toStringTag,{value:"Module"}));var XB=(function(){var t=x(function(k,E,_,M){for(_=_||{},M=k.length;M--;_[k[M]]=E);return _},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,31],g=[6,7,11,24],m=[1,6,13,16,17,20,23],y=[1,35],v=[1,36],T=[1,6,7,11,13,16,17,20,23],b=[1,38],w={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:x(function(E,_,M,L,P,D,R){var I=D.length-1;switch(P){case 6:case 7:return L;case 8:L.getLogger().trace("Stop NL ");break;case 9:L.getLogger().trace("Stop EOF ");break;case 11:L.getLogger().trace("Stop NL2 ");break;case 12:L.getLogger().trace("Stop EOF2 ");break;case 15:L.getLogger().info("Node: ",D[I-1].id),L.addNode(D[I-2].length,D[I-1].id,D[I-1].descr,D[I-1].type,D[I]);break;case 16:L.getLogger().info("Node: ",D[I].id),L.addNode(D[I-1].length,D[I].id,D[I].descr,D[I].type);break;case 17:L.getLogger().trace("Icon: ",D[I]),L.decorateNode({icon:D[I]});break;case 18:case 23:L.decorateNode({class:D[I]});break;case 19:L.getLogger().trace("SPACELIST");break;case 20:L.getLogger().trace("Node: ",D[I-1].id),L.addNode(0,D[I-1].id,D[I-1].descr,D[I-1].type,D[I]);break;case 21:L.getLogger().trace("Node: ",D[I].id),L.addNode(0,D[I].id,D[I].descr,D[I].type);break;case 22:L.decorateNode({icon:D[I]});break;case 27:L.getLogger().trace("node found ..",D[I-2]),this.$={id:D[I-1],descr:D[I-1],type:L.getType(D[I-2],D[I])};break;case 28:this.$={id:D[I],descr:D[I],type:0};break;case 29:L.getLogger().trace("node found ..",D[I-3]),this.$={id:D[I-3],descr:D[I-1],type:L.getType(D[I-2],D[I])};break;case 30:this.$=D[I-1]+D[I];break;case 31:this.$=D[I];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:u,7:h,10:23,11:d},t(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:o}),t(f,[2,19]),t(f,[2,21],{15:30,24:p}),t(f,[2,22]),t(f,[2,23]),t(g,[2,25]),t(g,[2,26]),t(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:h,10:34,11:d},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(m,[2,14],{7:y,11:v}),t(T,[2,8]),t(T,[2,9]),t(T,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:b}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:y,11:v}),t(T,[2,11]),t(T,[2,12]),t(f,[2,15],{24:b}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(E,_){if(_.recoverable)this.trace(E);else{var M=new Error(E);throw M.hash=_,M}},"parseError"),parse:x(function(E){var _=this,M=[0],L=[],P=[null],D=[],R=this.table,I="",$=0,O=0,N=2,F=1,z=D.slice.call(arguments,1),V=Object.create(this.lexer),B={yy:{}};for(var G in this.yy)Object.prototype.hasOwnProperty.call(this.yy,G)&&(B.yy[G]=this.yy[G]);V.setInput(E,B.yy),B.yy.lexer=V,B.yy.parser=this,typeof V.yylloc>"u"&&(V.yylloc={});var H=V.yylloc;D.push(H);var q=V.options&&V.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Z(ce){M.length=M.length-2*ce,P.length=P.length-ce,D.length=D.length-ce}x(Z,"popStack");function Y(){var ce;return ce=L.pop()||V.lex()||F,typeof ce!="number"&&(ce instanceof Array&&(L=ce,ce=L.pop()),ce=_.symbols_[ce]||ce),ce}x(Y,"lex");for(var ie,K,Q,te,J={},ge,ee,Re,Ie;;){if(K=M[M.length-1],this.defaultActions[K]?Q=this.defaultActions[K]:((ie===null||typeof ie>"u")&&(ie=Y()),Q=R[K]&&R[K][ie]),typeof Q>"u"||!Q.length||!Q[0]){var Be="";Ie=[];for(ge in R[K])this.terminals_[ge]&&ge>N&&Ie.push("'"+this.terminals_[ge]+"'");V.showPosition?Be="Parse error on line "+($+1)+`: + ${t.useGradient&&r&&t.mainBkg?q7t(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} +`},"getStyles"),Y7t=U7t,X7t={get db(){return new V7t},renderer:W7t,parser:F7t,styles:Y7t};const j7t=Object.freeze(Object.defineProperty({__proto__:null,diagram:X7t},Symbol.toStringTag,{value:"Module"}));var XB=(function(){var t=x(function(k,E,_,M){for(_=_||{},M=k.length;M--;_[k[M]]=E);return _},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,31],g=[6,7,11,24],m=[1,6,13,16,17,20,23],y=[1,35],v=[1,36],T=[1,6,7,11,13,16,17,20,23],b=[1,38],w={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:x(function(E,_,M,L,P,D,R){var I=D.length-1;switch(P){case 6:case 7:return L;case 8:L.getLogger().trace("Stop NL ");break;case 9:L.getLogger().trace("Stop EOF ");break;case 11:L.getLogger().trace("Stop NL2 ");break;case 12:L.getLogger().trace("Stop EOF2 ");break;case 15:L.getLogger().info("Node: ",D[I-1].id),L.addNode(D[I-2].length,D[I-1].id,D[I-1].descr,D[I-1].type,D[I]);break;case 16:L.getLogger().info("Node: ",D[I].id),L.addNode(D[I-1].length,D[I].id,D[I].descr,D[I].type);break;case 17:L.getLogger().trace("Icon: ",D[I]),L.decorateNode({icon:D[I]});break;case 18:case 23:L.decorateNode({class:D[I]});break;case 19:L.getLogger().trace("SPACELIST");break;case 20:L.getLogger().trace("Node: ",D[I-1].id),L.addNode(0,D[I-1].id,D[I-1].descr,D[I-1].type,D[I]);break;case 21:L.getLogger().trace("Node: ",D[I].id),L.addNode(0,D[I].id,D[I].descr,D[I].type);break;case 22:L.decorateNode({icon:D[I]});break;case 27:L.getLogger().trace("node found ..",D[I-2]),this.$={id:D[I-1],descr:D[I-1],type:L.getType(D[I-2],D[I])};break;case 28:this.$={id:D[I],descr:D[I],type:0};break;case 29:L.getLogger().trace("node found ..",D[I-3]),this.$={id:D[I-3],descr:D[I-1],type:L.getType(D[I-2],D[I])};break;case 30:this.$=D[I-1]+D[I];break;case 31:this.$=D[I];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:u,7:h,10:23,11:d},t(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:o}),t(f,[2,19]),t(f,[2,21],{15:30,24:p}),t(f,[2,22]),t(f,[2,23]),t(g,[2,25]),t(g,[2,26]),t(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:h,10:34,11:d},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(m,[2,14],{7:y,11:v}),t(T,[2,8]),t(T,[2,9]),t(T,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:b}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:y,11:v}),t(T,[2,11]),t(T,[2,12]),t(f,[2,15],{24:b}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(E,_){if(_.recoverable)this.trace(E);else{var M=new Error(E);throw M.hash=_,M}},"parseError"),parse:x(function(E){var _=this,M=[0],L=[],P=[null],D=[],R=this.table,I="",$=0,O=0,N=2,F=1,z=D.slice.call(arguments,1),V=Object.create(this.lexer),B={yy:{}};for(var G in this.yy)Object.prototype.hasOwnProperty.call(this.yy,G)&&(B.yy[G]=this.yy[G]);V.setInput(E,B.yy),B.yy.lexer=V,B.yy.parser=this,typeof V.yylloc>"u"&&(V.yylloc={});var H=V.yylloc;D.push(H);var q=V.options&&V.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Z(ce){M.length=M.length-2*ce,P.length=P.length-ce,D.length=D.length-ce}x(Z,"popStack");function Y(){var ce;return ce=L.pop()||V.lex()||F,typeof ce!="number"&&(ce instanceof Array&&(L=ce,ce=L.pop()),ce=_.symbols_[ce]||ce),ce}x(Y,"lex");for(var ie,K,Q,te,J={},ge,ee,Re,Ie;;){if(K=M[M.length-1],this.defaultActions[K]?Q=this.defaultActions[K]:((ie===null||typeof ie>"u")&&(ie=Y()),Q=R[K]&&R[K][ie]),typeof Q>"u"||!Q.length||!Q[0]){var Be="";Ie=[];for(ge in R[K])this.terminals_[ge]&&ge>N&&Ie.push("'"+this.terminals_[ge]+"'");V.showPosition?Be="Parse error on line "+($+1)+`: `+V.showPosition()+` Expecting `+Ie.join(", ")+", got '"+(this.terminals_[ie]||ie)+"'":Be="Parse error on line "+($+1)+": Unexpected "+(ie==F?"end of input":"'"+(this.terminals_[ie]||ie)+"'"),this.parseError(Be,{text:V.match,token:this.terminals_[ie]||ie,line:V.yylineno,loc:H,expected:Ie})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+K+", token: "+ie);switch(Q[0]){case 1:M.push(ie),P.push(V.yytext),D.push(V.yylloc),M.push(Q[1]),ie=null,O=V.yyleng,I=V.yytext,$=V.yylineno,H=V.yylloc;break;case 2:if(ee=this.productions_[Q[1]][1],J.$=P[P.length-ee],J._$={first_line:D[D.length-(ee||1)].first_line,last_line:D[D.length-1].last_line,first_column:D[D.length-(ee||1)].first_column,last_column:D[D.length-1].last_column},q&&(J._$.range=[D[D.length-(ee||1)].range[0],D[D.length-1].range[1]]),te=this.performAction.apply(J,[I,O,$,B.yy,Q[1],P,D].concat(z)),typeof te<"u")return te;ee&&(M=M.slice(0,-1*ee*2),P=P.slice(0,-1*ee),D=D.slice(0,-1*ee)),M.push(this.productions_[Q[1]][0]),P.push(J.$),D.push(J._$),Re=R[M[M.length-2]][M[M.length-1]],M.push(Re);break;case 3:return!0}}return!0},"parse")},C=(function(){var k={EOF:1,parseError:x(function(_,M){if(this.yy.parser)this.yy.parser.parseError(_,M);else throw new Error(_)},"parseError"),setInput:x(function(E,_){return this.yy=_||this.yy||{},this._input=E,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var E=this._input[0];this.yytext+=E,this.yyleng++,this.offset++,this.match+=E,this.matched+=E;var _=E.match(/(?:\r\n?|\n).*/g);return _?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),E},"input"),unput:x(function(E){var _=E.length,M=E.split(/(?:\r\n?|\n)/g);this._input=E+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-_),this.offset-=_;var L=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),M.length-1&&(this.yylineno-=M.length-1);var P=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:M?(M.length===L.length?this.yylloc.first_column:0)+L[L.length-M.length].length-M[0].length:this.yylloc.first_column-_},this.options.ranges&&(this.yylloc.range=[P[0],P[0]+this.yyleng-_]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(E){this.unput(this.match.slice(E))},"less"),pastInput:x(function(){var E=this.matched.substr(0,this.matched.length-this.match.length);return(E.length>20?"...":"")+E.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var E=this.match;return E.length<20&&(E+=this._input.substr(0,20-E.length)),(E.substr(0,20)+(E.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var E=this.pastInput(),_=new Array(E.length+1).join("-");return E+this.upcomingInput()+` `+_+"^"},"showPosition"),test_match:x(function(E,_){var M,L,P;if(this.options.backtrack_lexer&&(P={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(P.yylloc.range=this.yylloc.range.slice(0))),L=E[0].match(/(?:\r\n?|\n).*/g),L&&(this.yylineno+=L.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:L?L[L.length-1].length-L[L.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+E[0].length},this.yytext+=E[0],this.match+=E[0],this.matches=E,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(E[0].length),this.matched+=E[0],M=this.performAction.call(this,this.yy,this,_,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),M)return M;if(this._backtrack){for(var D in P)this[D]=P[D];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var E,_,M,L;this._more||(this.yytext="",this.match="");for(var P=this._currentRules(),D=0;D_[0].length)){if(_=M,L=D,this.options.backtrack_lexer){if(E=this.test_match(M,P[D]),E!==!1)return E;if(this._backtrack){_=!1;continue}else return!1}else if(!this.options.flex)break}return _?(E=this.test_match(_,P[L]),E!==!1?E:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var _=this.next();return _||this.lex()},"lex"),begin:x(function(_){this.conditionStack.push(_)},"begin"),popState:x(function(){var _=this.conditionStack.length-1;return _>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(_){return _=this.conditionStack.length-1-Math.abs(_||0),_>=0?this.conditionStack[_]:"INITIAL"},"topState"),pushState:x(function(_){this.begin(_)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(_,M,L,P){switch(L){case 0:return this.pushState("shapeData"),M.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const D=/\n\s*/g;return M.yytext=M.yytext.replace(D,"
"),24;case 4:return 24;case 5:this.popState();break;case 6:return _.getLogger().trace("Found comment",M.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:_.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return _.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:_.getLogger().trace("end icon"),this.popState();break;case 16:return _.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return _.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return _.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return _.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:_.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return _.getLogger().trace("description:",M.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),_.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),_.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),_.getLogger().trace("node end ...",M.yytext),"NODE_DEND";case 36:return this.popState(),_.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),_.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),_.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),_.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),_.getLogger().trace("node end (("),"NODE_DEND";case 41:return _.getLogger().trace("Long description:",M.yytext),21;case 42:return _.getLogger().trace("Long description:",M.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return k})();w.lexer=C;function S(){this.yy={}}return x(S,"Parser"),S.prototype=w,w.Parser=S,new S})();XB.parser=XB;var Y7t=XB,sl=[],zU=[],jB=0,VU={},X7t=x(()=>{sl=[],zU=[],jB=0,VU={}},"clear"),j7t=x(t=>{if(sl.length===0)return null;const e=sl[0].level;let r=null;for(let n=sl.length-1;n>=0;n--)if(sl[n].level===e&&!r&&(r=sl[n]),sl[n].levelo.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:Wr(o.label??"",n),labelType:"markdown",isGroup:!1,ticket:o==null?void 0:o.ticket,priority:o==null?void 0:o.priority,assigned:o==null?void 0:o.assigned,icon:o==null?void 0:o.icon,shape:"kanbanItem",level:o.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:Fe()}},"getData"),Z7t=x((t,e,r,n,i)=>{var u,h;const a=Fe();let s=((u=a.mindmap)==null?void 0:u.padding)??Vr.mindmap.padding;switch(n){case ia.ROUNDED_RECT:case ia.RECT:case ia.HEXAGON:s*=2}const o={id:Wr(e,a)||"kbn"+jB++,level:t,label:Wr(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??Vr.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let d;i.includes(` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var _=this.next();return _||this.lex()},"lex"),begin:x(function(_){this.conditionStack.push(_)},"begin"),popState:x(function(){var _=this.conditionStack.length-1;return _>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(_){return _=this.conditionStack.length-1-Math.abs(_||0),_>=0?this.conditionStack[_]:"INITIAL"},"topState"),pushState:x(function(_){this.begin(_)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(_,M,L,P){switch(L){case 0:return this.pushState("shapeData"),M.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const D=/\n\s*/g;return M.yytext=M.yytext.replace(D,"
"),24;case 4:return 24;case 5:this.popState();break;case 6:return _.getLogger().trace("Found comment",M.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:_.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return _.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:_.getLogger().trace("end icon"),this.popState();break;case 16:return _.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return _.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return _.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return _.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:_.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return _.getLogger().trace("description:",M.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),_.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),_.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),_.getLogger().trace("node end ...",M.yytext),"NODE_DEND";case 36:return this.popState(),_.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),_.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),_.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),_.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),_.getLogger().trace("node end (("),"NODE_DEND";case 41:return _.getLogger().trace("Long description:",M.yytext),21;case 42:return _.getLogger().trace("Long description:",M.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return k})();w.lexer=C;function S(){this.yy={}}return x(S,"Parser"),S.prototype=w,w.Parser=S,new S})();XB.parser=XB;var K7t=XB,sl=[],zU=[],jB=0,VU={},Z7t=x(()=>{sl=[],zU=[],jB=0,VU={}},"clear"),Q7t=x(t=>{if(sl.length===0)return null;const e=sl[0].level;let r=null;for(let n=sl.length-1;n>=0;n--)if(sl[n].level===e&&!r&&(r=sl[n]),sl[n].levelo.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:Wr(o.label??"",n),labelType:"markdown",isGroup:!1,ticket:o==null?void 0:o.ticket,priority:o==null?void 0:o.priority,assigned:o==null?void 0:o.assigned,icon:o==null?void 0:o.icon,shape:"kanbanItem",level:o.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:Fe()}},"getData"),eMt=x((t,e,r,n,i)=>{var u,h;const a=Fe();let s=((u=a.mindmap)==null?void 0:u.padding)??Vr.mindmap.padding;switch(n){case ia.ROUNDED_RECT:case ia.RECT:case ia.HEXAGON:s*=2}const o={id:Wr(e,a)||"kbn"+jB++,level:t,label:Wr(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??Vr.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let d;i.includes(` `)?d=i+` `:d=`{ `+i+` -}`;const f=dR(d,{schema:hR});if(f.shape&&(f.shape!==f.shape.toLowerCase()||f.shape.includes("_")))throw new Error(`No such shape: ${f.shape}. Shape names should be lowercase.`);f!=null&&f.shape&&f.shape==="kanbanItem"&&(o.shape=f==null?void 0:f.shape),f!=null&&f.label&&(o.label=f==null?void 0:f.label),f!=null&&f.icon&&(o.icon=f==null?void 0:f.icon.toString()),f!=null&&f.assigned&&(o.assigned=f==null?void 0:f.assigned.toString()),f!=null&&f.ticket&&(o.ticket=f==null?void 0:f.ticket.toString()),f!=null&&f.priority&&(o.priority=f==null?void 0:f.priority)}const l=j7t(t);l?o.parentId=l.id||"kbn"+jB++:zU.push(o),sl.push(o)},"addNode"),ia={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Q7t=x((t,e)=>{switch(le.debug("In get type",t,e),t){case"[":return ia.RECT;case"(":return e===")"?ia.ROUNDED_RECT:ia.CLOUD;case"((":return ia.CIRCLE;case")":return ia.CLOUD;case"))":return ia.BANG;case"{{":return ia.HEXAGON;default:return ia.DEFAULT}},"getType"),J7t=x((t,e)=>{VU[t]=e},"setElementForId"),eMt=x(t=>{if(!t)return;const e=Fe(),r=sl[sl.length-1];t.icon&&(r.icon=Wr(t.icon,e)),t.class&&(r.cssClasses=Wr(t.class,e))},"decorateNode"),tMt=x(t=>{switch(t){case ia.DEFAULT:return"no-border";case ia.RECT:return"rect";case ia.ROUNDED_RECT:return"rounded-rect";case ia.CIRCLE:return"circle";case ia.CLOUD:return"cloud";case ia.BANG:return"bang";case ia.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),rMt=x(()=>le,"getLogger"),nMt=x(t=>VU[t],"getElementById"),iMt={clear:X7t,addNode:Z7t,getSections:A6e,getData:K7t,nodeType:ia,getType:Q7t,setElementForId:J7t,decorateNode:eMt,type2Str:tMt,getLogger:rMt,getElementById:nMt},aMt=iMt,sMt=x(async(t,e,r,n)=>{var y,v,T,b,w;le.debug(`Rendering kanban diagram -`+t);const a=n.db.getData(),s=Fe();s.htmlLabels=!1;const o=xs(e);for(const C of a.nodes)C.domId=`${e}-${C.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=a.nodes.filter(C=>C.isGroup);let d=0;const f=10,p=[];let g=25;for(const C of h){const S=((y=s==null?void 0:s.kanban)==null?void 0:y.sectionWidth)||200;d=d+1,C.x=S*d+(d-1)*f/2,C.width=S,C.y=0,C.height=S*3,C.rx=5,C.ry=5,C.cssClasses=C.cssClasses+" section-"+d;const k=await xR(l,C);g=Math.max(g,(v=k==null?void 0:k.labelBBox)==null?void 0:v.height),p.push(k)}let m=0;for(const C of h){const S=p[m];m=m+1;const k=((T=s==null?void 0:s.kanban)==null?void 0:T.sectionWidth)||200,E=-k*3/2+g;let _=E;const M=a.nodes.filter(D=>D.parentId===C.id);for(const D of M){if(D.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");D.x=C.x,D.width=k-1.5*f;const I=(await rS(u,D,{config:s})).node().getBBox();D.y=_+I.height/2,await FA(D),_=D.y+I.height/2+f/2}const L=S.cluster.select("rect"),P=Math.max(_-E+3*f,50)+(g-25);L.attr("height",P)}mx(void 0,o,((b=s.mindmap)==null?void 0:b.padding)??Vr.kanban.padding,((w=s.mindmap)==null?void 0:w.useMaxWidth)??Vr.kanban.useMaxWidth)},"draw"),oMt={draw:sMt},lMt=x(t=>{let e="";for(let n=0;nt.darkMode?et(n,i):Je(n,i),"adjuster");for(let n=0;n{switch(le.debug("In get type",t,e),t){case"[":return ia.RECT;case"(":return e===")"?ia.ROUNDED_RECT:ia.CLOUD;case"((":return ia.CIRCLE;case")":return ia.CLOUD;case"))":return ia.BANG;case"{{":return ia.HEXAGON;default:return ia.DEFAULT}},"getType"),rMt=x((t,e)=>{VU[t]=e},"setElementForId"),nMt=x(t=>{if(!t)return;const e=Fe(),r=sl[sl.length-1];t.icon&&(r.icon=Wr(t.icon,e)),t.class&&(r.cssClasses=Wr(t.class,e))},"decorateNode"),iMt=x(t=>{switch(t){case ia.DEFAULT:return"no-border";case ia.RECT:return"rect";case ia.ROUNDED_RECT:return"rounded-rect";case ia.CIRCLE:return"circle";case ia.CLOUD:return"cloud";case ia.BANG:return"bang";case ia.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),aMt=x(()=>le,"getLogger"),sMt=x(t=>VU[t],"getElementById"),oMt={clear:Z7t,addNode:eMt,getSections:_6e,getData:J7t,nodeType:ia,getType:tMt,setElementForId:rMt,decorateNode:nMt,type2Str:iMt,getLogger:aMt,getElementById:sMt},lMt=oMt,cMt=x(async(t,e,r,n)=>{var y,v,T,b,w;le.debug(`Rendering kanban diagram +`+t);const a=n.db.getData(),s=Fe();s.htmlLabels=!1;const o=xs(e);for(const C of a.nodes)C.domId=`${e}-${C.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=a.nodes.filter(C=>C.isGroup);let d=0;const f=10,p=[];let g=25;for(const C of h){const S=((y=s==null?void 0:s.kanban)==null?void 0:y.sectionWidth)||200;d=d+1,C.x=S*d+(d-1)*f/2,C.width=S,C.y=0,C.height=S*3,C.rx=5,C.ry=5,C.cssClasses=C.cssClasses+" section-"+d;const k=await xR(l,C);g=Math.max(g,(v=k==null?void 0:k.labelBBox)==null?void 0:v.height),p.push(k)}let m=0;for(const C of h){const S=p[m];m=m+1;const k=((T=s==null?void 0:s.kanban)==null?void 0:T.sectionWidth)||200,E=-k*3/2+g;let _=E;const M=a.nodes.filter(D=>D.parentId===C.id);for(const D of M){if(D.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");D.x=C.x,D.width=k-1.5*f;const I=(await rS(u,D,{config:s})).node().getBBox();D.y=_+I.height/2,await FA(D),_=D.y+I.height/2+f/2}const L=S.cluster.select("rect"),P=Math.max(_-E+3*f,50)+(g-25);L.attr("height",P)}mx(void 0,o,((b=s.mindmap)==null?void 0:b.padding)??Vr.kanban.padding,((w=s.mindmap)==null?void 0:w.useMaxWidth)??Vr.kanban.useMaxWidth)},"draw"),uMt={draw:cMt},hMt=x(t=>{let e="";for(let n=0;nt.darkMode?et(n,i):Je(n,i),"adjuster");for(let n=0;n` + `}return e},"genSections"),dMt=x(t=>` .edge { stroke-width: 3; } - ${lMt(t)} + ${hMt(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -3136,14 +3138,14 @@ Expecting `+Ie.join(", ")+", got '"+(this.terminals_[ie]||ie)+"'":Be="Parse erro text-align: center; } ${CS()} -`,"getStyles"),uMt=cMt,hMt={db:aMt,renderer:oMt,parser:Y7t,styles:uMt};const dMt=Object.freeze(Object.defineProperty({__proto__:null,diagram:hMt},Symbol.toStringTag,{value:"Module"}));function Fie(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function _6e(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function qN(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function fMt(t){return t.target.depth}function pMt(t){return t.depth}function gMt(t,e){return e-1-t.height}function R6e(t,e){return t.sourceLinks.length?t.depth:e-1}function mMt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?_6e(t.sourceLinks,fMt)-1:0}function A4(t){return function(){return t}}function zie(t,e){return k6(t.source,e.source)||t.index-e.index}function Vie(t,e){return k6(t.target,e.target)||t.index-e.index}function k6(t,e){return t.y0-e.y0}function UN(t){return t.value}function yMt(t){return t.index}function vMt(t){return t.nodes}function bMt(t){return t.links}function Gie(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function Wie({nodes:t}){for(const e of t){let r=e.y0,n=r;for(const i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(const i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function xMt(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=yMt,l=R6e,u,h,d=vMt,f=bMt,p=6;function g(){const I={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(I),y(I),v(I),T(I),C(I),Wie(I),I}g.update=function(I){return Wie(I),I},g.nodeId=function(I){return arguments.length?(o=typeof I=="function"?I:A4(I),g):o},g.nodeAlign=function(I){return arguments.length?(l=typeof I=="function"?I:A4(I),g):l},g.nodeSort=function(I){return arguments.length?(u=I,g):u},g.nodeWidth=function(I){return arguments.length?(i=+I,g):i},g.nodePadding=function(I){return arguments.length?(a=s=+I,g):a},g.nodes=function(I){return arguments.length?(d=typeof I=="function"?I:A4(I),g):d},g.links=function(I){return arguments.length?(f=typeof I=="function"?I:A4(I),g):f},g.linkSort=function(I){return arguments.length?(h=I,g):h},g.size=function(I){return arguments.length?(t=e=0,r=+I[0],n=+I[1],g):[r-t,n-e]},g.extent=function(I){return arguments.length?(t=+I[0][0],r=+I[1][0],e=+I[0][1],n=+I[1][1],g):[[t,e],[r,n]]},g.iterations=function(I){return arguments.length?(p=+I,g):p};function m({nodes:I,links:$}){for(const[N,F]of I.entries())F.index=N,F.sourceLinks=[],F.targetLinks=[];const O=new Map(I.map((N,F)=>[o(N,F,I),N]));for(const[N,F]of $.entries()){F.index=N;let{source:z,target:V}=F;typeof z!="object"&&(z=F.source=Gie(O,z)),typeof V!="object"&&(V=F.target=Gie(O,V)),z.sourceLinks.push(F),V.targetLinks.push(F)}if(h!=null)for(const{sourceLinks:N,targetLinks:F}of I)N.sort(h),F.sort(h)}function y({nodes:I}){for(const $ of I)$.value=$.fixedValue===void 0?Math.max(qN($.sourceLinks,UN),qN($.targetLinks,UN)):$.fixedValue}function v({nodes:I}){const $=I.length;let O=new Set(I),N=new Set,F=0;for(;O.size;){for(const z of O){z.depth=F;for(const{target:V}of z.sourceLinks)N.add(V)}if(++F>$)throw new Error("circular link");O=N,N=new Set}}function T({nodes:I}){const $=I.length;let O=new Set(I),N=new Set,F=0;for(;O.size;){for(const z of O){z.height=F;for(const{source:V}of z.targetLinks)N.add(V)}if(++F>$)throw new Error("circular link");O=N,N=new Set}}function b({nodes:I}){const $=Fie(I,F=>F.depth)+1,O=(r-t-i)/($-1),N=new Array($);for(const F of I){const z=Math.max(0,Math.min($-1,Math.floor(l.call(null,F,$))));F.layer=z,F.x0=t+z*O,F.x1=F.x0+i,N[z]?N[z].push(F):N[z]=[F]}if(u)for(const F of N)F.sort(u);return N}function w(I){const $=_6e(I,O=>(n-e-(O.length-1)*s)/qN(O,UN));for(const O of I){let N=e;for(const F of O){F.y0=N,F.y1=N+F.value*$,N=F.y1+s;for(const z of F.sourceLinks)z.width=z.value*$}N=(n-N+s)/(O.length+1);for(let F=0;FO.length)-1)),w($);for(let O=0;O0))continue;let H=(B/G-V.y0)*$;V.y0+=H,V.y1+=H,L(V)}u===void 0&&z.sort(k6),E(z,O)}}function k(I,$,O){for(let N=I.length,F=N-2;F>=0;--F){const z=I[F];for(const V of z){let B=0,G=0;for(const{target:q,value:Z}of V.sourceLinks){let Y=Z*(q.layer-V.layer);B+=R(V,q)*Y,G+=Y}if(!(G>0))continue;let H=(B/G-V.y0)*$;V.y0+=H,V.y1+=H,L(V)}u===void 0&&z.sort(k6),E(z,O)}}function E(I,$){const O=I.length>>1,N=I[O];M(I,N.y0-s,O-1,$),_(I,N.y1+s,O+1,$),M(I,n,I.length-1,$),_(I,e,0,$)}function _(I,$,O,N){for(;O1e-6&&(F.y0+=z,F.y1+=z),$=F.y1+s}}function M(I,$,O,N){for(;O>=0;--O){const F=I[O],z=(F.y1-$)*N;z>1e-6&&(F.y0-=z,F.y1-=z),$=F.y0-s}}function L({sourceLinks:I,targetLinks:$}){if(h===void 0){for(const{source:{sourceLinks:O}}of $)O.sort(Vie);for(const{target:{targetLinks:O}}of I)O.sort(zie)}}function P(I){if(h===void 0)for(const{sourceLinks:$,targetLinks:O}of I)$.sort(Vie),O.sort(zie)}function D(I,$){let O=I.y0-(I.sourceLinks.length-1)*s/2;for(const{target:N,width:F}of I.sourceLinks){if(N===$)break;O+=F+s}for(const{source:N,width:F}of $.targetLinks){if(N===I)break;O-=F}return O}function R(I,$){let O=$.y0-($.targetLinks.length-1)*s/2;for(const{source:N,width:F}of $.targetLinks){if(N===I)break;O+=F+s}for(const{target:N,width:F}of I.sourceLinks){if(N===$)break;O-=F}return O}return g}var KB=Math.PI,ZB=2*KB,xp=1e-6,TMt=ZB-xp;function QB(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function L6e(){return new QB}QB.prototype=L6e.prototype={constructor:QB,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,o=r-t,l=n-e,u=a-t,h=s-e,d=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>xp)if(!(Math.abs(h*o-l*u)>xp)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-a,p=n-s,g=o*o+l*l,m=f*f+p*p,y=Math.sqrt(g),v=Math.sqrt(d),T=i*Math.tan((KB-Math.acos((g+d-m)/(2*y*v)))/2),b=T/v,w=T/y;Math.abs(b-1)>xp&&(this._+="L"+(t+b*u)+","+(e+b*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+w*o)+","+(this._y1=e+w*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,u=e+o,h=1^a,d=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>xp||Math.abs(this._y1-u)>xp)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%ZB+ZB),d>TMt?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>xp&&(this._+="A"+r+","+r+",0,"+ +(d>=KB)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function Hie(t){return function(){return t}}function wMt(t){return t[0]}function CMt(t){return t[1]}var kMt=Array.prototype.slice;function SMt(t){return t.source}function EMt(t){return t.target}function AMt(t){var e=SMt,r=EMt,n=wMt,i=CMt,a=null;function s(){var o,l=kMt.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=L6e()),t(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(e=o,s):e},s.target=function(o){return arguments.length?(r=o,s):r},s.x=function(o){return arguments.length?(n=typeof o=="function"?o:Hie(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:Hie(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function _Mt(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function RMt(){return AMt(_Mt)}function LMt(t){return[t.source.x1,t.y0]}function MMt(t){return[t.target.x0,t.y1]}function IMt(){return RMt().source(LMt).target(MMt)}var JB=(function(){var t=x(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:x(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const y=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),v=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),T=parseFloat(p[m].trim());d.addLink(y,v,T);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:x(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:x(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",y=0,v=0,T=2,b=1,w=p.slice.call(arguments,1),C=Object.create(this.lexer),S={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(S.yy[k]=this.yy[k]);C.setInput(l,S.yy),S.yy.lexer=C,S.yy.parser=this,typeof C.yylloc>"u"&&(C.yylloc={});var E=C.yylloc;p.push(E);var _=C.options&&C.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function M(B){h.length=h.length-2*B,f.length=f.length-B,p.length=p.length-B}x(M,"popStack");function L(){var B;return B=d.pop()||C.lex()||b,typeof B!="number"&&(B instanceof Array&&(d=B,B=d.pop()),B=u.symbols_[B]||B),B}x(L,"lex");for(var P,D,R,I,$={},O,N,F,z;;){if(D=h[h.length-1],this.defaultActions[D]?R=this.defaultActions[D]:((P===null||typeof P>"u")&&(P=L()),R=g[D]&&g[D][P]),typeof R>"u"||!R.length||!R[0]){var V="";z=[];for(O in g[D])this.terminals_[O]&&O>T&&z.push("'"+this.terminals_[O]+"'");C.showPosition?V="Parse error on line "+(y+1)+`: +`,"getStyles"),fMt=dMt,pMt={db:lMt,renderer:uMt,parser:K7t,styles:fMt};const gMt=Object.freeze(Object.defineProperty({__proto__:null,diagram:pMt},Symbol.toStringTag,{value:"Module"}));function zie(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function R6e(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function qN(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function mMt(t){return t.target.depth}function yMt(t){return t.depth}function vMt(t,e){return e-1-t.height}function L6e(t,e){return t.sourceLinks.length?t.depth:e-1}function bMt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?R6e(t.sourceLinks,mMt)-1:0}function A4(t){return function(){return t}}function Vie(t,e){return k6(t.source,e.source)||t.index-e.index}function Gie(t,e){return k6(t.target,e.target)||t.index-e.index}function k6(t,e){return t.y0-e.y0}function UN(t){return t.value}function xMt(t){return t.index}function TMt(t){return t.nodes}function wMt(t){return t.links}function Wie(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function Hie({nodes:t}){for(const e of t){let r=e.y0,n=r;for(const i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(const i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function CMt(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=xMt,l=L6e,u,h,d=TMt,f=wMt,p=6;function g(){const I={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(I),y(I),v(I),T(I),C(I),Hie(I),I}g.update=function(I){return Hie(I),I},g.nodeId=function(I){return arguments.length?(o=typeof I=="function"?I:A4(I),g):o},g.nodeAlign=function(I){return arguments.length?(l=typeof I=="function"?I:A4(I),g):l},g.nodeSort=function(I){return arguments.length?(u=I,g):u},g.nodeWidth=function(I){return arguments.length?(i=+I,g):i},g.nodePadding=function(I){return arguments.length?(a=s=+I,g):a},g.nodes=function(I){return arguments.length?(d=typeof I=="function"?I:A4(I),g):d},g.links=function(I){return arguments.length?(f=typeof I=="function"?I:A4(I),g):f},g.linkSort=function(I){return arguments.length?(h=I,g):h},g.size=function(I){return arguments.length?(t=e=0,r=+I[0],n=+I[1],g):[r-t,n-e]},g.extent=function(I){return arguments.length?(t=+I[0][0],r=+I[1][0],e=+I[0][1],n=+I[1][1],g):[[t,e],[r,n]]},g.iterations=function(I){return arguments.length?(p=+I,g):p};function m({nodes:I,links:$}){for(const[N,F]of I.entries())F.index=N,F.sourceLinks=[],F.targetLinks=[];const O=new Map(I.map((N,F)=>[o(N,F,I),N]));for(const[N,F]of $.entries()){F.index=N;let{source:z,target:V}=F;typeof z!="object"&&(z=F.source=Wie(O,z)),typeof V!="object"&&(V=F.target=Wie(O,V)),z.sourceLinks.push(F),V.targetLinks.push(F)}if(h!=null)for(const{sourceLinks:N,targetLinks:F}of I)N.sort(h),F.sort(h)}function y({nodes:I}){for(const $ of I)$.value=$.fixedValue===void 0?Math.max(qN($.sourceLinks,UN),qN($.targetLinks,UN)):$.fixedValue}function v({nodes:I}){const $=I.length;let O=new Set(I),N=new Set,F=0;for(;O.size;){for(const z of O){z.depth=F;for(const{target:V}of z.sourceLinks)N.add(V)}if(++F>$)throw new Error("circular link");O=N,N=new Set}}function T({nodes:I}){const $=I.length;let O=new Set(I),N=new Set,F=0;for(;O.size;){for(const z of O){z.height=F;for(const{source:V}of z.targetLinks)N.add(V)}if(++F>$)throw new Error("circular link");O=N,N=new Set}}function b({nodes:I}){const $=zie(I,F=>F.depth)+1,O=(r-t-i)/($-1),N=new Array($);for(const F of I){const z=Math.max(0,Math.min($-1,Math.floor(l.call(null,F,$))));F.layer=z,F.x0=t+z*O,F.x1=F.x0+i,N[z]?N[z].push(F):N[z]=[F]}if(u)for(const F of N)F.sort(u);return N}function w(I){const $=R6e(I,O=>(n-e-(O.length-1)*s)/qN(O,UN));for(const O of I){let N=e;for(const F of O){F.y0=N,F.y1=N+F.value*$,N=F.y1+s;for(const z of F.sourceLinks)z.width=z.value*$}N=(n-N+s)/(O.length+1);for(let F=0;FO.length)-1)),w($);for(let O=0;O0))continue;let H=(B/G-V.y0)*$;V.y0+=H,V.y1+=H,L(V)}u===void 0&&z.sort(k6),E(z,O)}}function k(I,$,O){for(let N=I.length,F=N-2;F>=0;--F){const z=I[F];for(const V of z){let B=0,G=0;for(const{target:q,value:Z}of V.sourceLinks){let Y=Z*(q.layer-V.layer);B+=R(V,q)*Y,G+=Y}if(!(G>0))continue;let H=(B/G-V.y0)*$;V.y0+=H,V.y1+=H,L(V)}u===void 0&&z.sort(k6),E(z,O)}}function E(I,$){const O=I.length>>1,N=I[O];M(I,N.y0-s,O-1,$),_(I,N.y1+s,O+1,$),M(I,n,I.length-1,$),_(I,e,0,$)}function _(I,$,O,N){for(;O1e-6&&(F.y0+=z,F.y1+=z),$=F.y1+s}}function M(I,$,O,N){for(;O>=0;--O){const F=I[O],z=(F.y1-$)*N;z>1e-6&&(F.y0-=z,F.y1-=z),$=F.y0-s}}function L({sourceLinks:I,targetLinks:$}){if(h===void 0){for(const{source:{sourceLinks:O}}of $)O.sort(Gie);for(const{target:{targetLinks:O}}of I)O.sort(Vie)}}function P(I){if(h===void 0)for(const{sourceLinks:$,targetLinks:O}of I)$.sort(Gie),O.sort(Vie)}function D(I,$){let O=I.y0-(I.sourceLinks.length-1)*s/2;for(const{target:N,width:F}of I.sourceLinks){if(N===$)break;O+=F+s}for(const{source:N,width:F}of $.targetLinks){if(N===I)break;O-=F}return O}function R(I,$){let O=$.y0-($.targetLinks.length-1)*s/2;for(const{source:N,width:F}of $.targetLinks){if(N===I)break;O+=F+s}for(const{target:N,width:F}of I.sourceLinks){if(N===$)break;O-=F}return O}return g}var KB=Math.PI,ZB=2*KB,xp=1e-6,kMt=ZB-xp;function QB(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function M6e(){return new QB}QB.prototype=M6e.prototype={constructor:QB,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,o=r-t,l=n-e,u=a-t,h=s-e,d=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>xp)if(!(Math.abs(h*o-l*u)>xp)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-a,p=n-s,g=o*o+l*l,m=f*f+p*p,y=Math.sqrt(g),v=Math.sqrt(d),T=i*Math.tan((KB-Math.acos((g+d-m)/(2*y*v)))/2),b=T/v,w=T/y;Math.abs(b-1)>xp&&(this._+="L"+(t+b*u)+","+(e+b*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+w*o)+","+(this._y1=e+w*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,u=e+o,h=1^a,d=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>xp||Math.abs(this._y1-u)>xp)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%ZB+ZB),d>kMt?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>xp&&(this._+="A"+r+","+r+",0,"+ +(d>=KB)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function qie(t){return function(){return t}}function SMt(t){return t[0]}function EMt(t){return t[1]}var AMt=Array.prototype.slice;function _Mt(t){return t.source}function RMt(t){return t.target}function LMt(t){var e=_Mt,r=RMt,n=SMt,i=EMt,a=null;function s(){var o,l=AMt.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=M6e()),t(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(e=o,s):e},s.target=function(o){return arguments.length?(r=o,s):r},s.x=function(o){return arguments.length?(n=typeof o=="function"?o:qie(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:qie(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function MMt(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function IMt(){return LMt(MMt)}function NMt(t){return[t.source.x1,t.y0]}function DMt(t){return[t.target.x0,t.y1]}function OMt(){return IMt().source(NMt).target(DMt)}var JB=(function(){var t=x(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:x(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const y=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),v=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),T=parseFloat(p[m].trim());d.addLink(y,v,T);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:x(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:x(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",y=0,v=0,T=2,b=1,w=p.slice.call(arguments,1),C=Object.create(this.lexer),S={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(S.yy[k]=this.yy[k]);C.setInput(l,S.yy),S.yy.lexer=C,S.yy.parser=this,typeof C.yylloc>"u"&&(C.yylloc={});var E=C.yylloc;p.push(E);var _=C.options&&C.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function M(B){h.length=h.length-2*B,f.length=f.length-B,p.length=p.length-B}x(M,"popStack");function L(){var B;return B=d.pop()||C.lex()||b,typeof B!="number"&&(B instanceof Array&&(d=B,B=d.pop()),B=u.symbols_[B]||B),B}x(L,"lex");for(var P,D,R,I,$={},O,N,F,z;;){if(D=h[h.length-1],this.defaultActions[D]?R=this.defaultActions[D]:((P===null||typeof P>"u")&&(P=L()),R=g[D]&&g[D][P]),typeof R>"u"||!R.length||!R[0]){var V="";z=[];for(O in g[D])this.terminals_[O]&&O>T&&z.push("'"+this.terminals_[O]+"'");C.showPosition?V="Parse error on line "+(y+1)+`: `+C.showPosition()+` Expecting `+z.join(", ")+", got '"+(this.terminals_[P]||P)+"'":V="Parse error on line "+(y+1)+": Unexpected "+(P==b?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(V,{text:C.match,token:this.terminals_[P]||P,line:C.yylineno,loc:E,expected:z})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+P);switch(R[0]){case 1:h.push(P),f.push(C.yytext),p.push(C.yylloc),h.push(R[1]),P=null,v=C.yyleng,m=C.yytext,y=C.yylineno,E=C.yylloc;break;case 2:if(N=this.productions_[R[1]][1],$.$=f[f.length-N],$._$={first_line:p[p.length-(N||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(N||1)].first_column,last_column:p[p.length-1].last_column},_&&($._$.range=[p[p.length-(N||1)].range[0],p[p.length-1].range[1]]),I=this.performAction.apply($,[m,v,y,S.yy,R[1],f,p].concat(w)),typeof I<"u")return I;N&&(h=h.slice(0,-1*N*2),f=f.slice(0,-1*N),p=p.slice(0,-1*N)),h.push(this.productions_[R[1]][0]),f.push($.$),p.push($._$),F=g[h[h.length-2]][h[h.length-1]],h.push(F);break;case 3:return!0}}return!0},"parse")},a=(function(){var o={EOF:1,parseError:x(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:x(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:x(function(l){var u=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(l){this.unput(this.match.slice(l))},"less"),pastInput:x(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` `+u+"^"},"showPosition"),test_match:x(function(l,u){var h,d,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),d=l[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],h=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,h,d;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;pu[0].length)){if(u=h,d=p,this.options.backtrack_lexer){if(l=this.test_match(h,f[p]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,f[d]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var u=this.next();return u||this.lex()},"lex"),begin:x(function(u){this.conditionStack.push(u)},"begin"),popState:x(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:x(function(u){this.begin(u)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o})();i.lexer=a;function s(){this.yy={}}return x(s,"Parser"),s.prototype=i,i.Parser=s,new s})();JB.parser=JB;var S6=JB,z7=[],V7=[],E6=new Map,NMt=x(()=>{z7=[],V7=[],E6=new Map,On()},"clear"),ab,DMt=(ab=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},x(ab,"SankeyLink"),ab),OMt=x((t,e,r)=>{z7.push(new DMt(t,e,r))},"addLink"),sb,$Mt=(sb=class{constructor(e){this.ID=e}},x(sb,"SankeyNode"),sb),PMt=x(t=>{t=At.sanitizeText(t,Fe());let e=E6.get(t);return e===void 0&&(e=new $Mt(t),E6.set(t,e),V7.push(e)),e},"findOrCreateNode"),BMt=x(()=>V7,"getNodes"),FMt=x(()=>z7,"getLinks"),zMt=x(()=>({nodes:V7.map(t=>({id:t.ID})),links:z7.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),VMt={nodesMap:E6,getConfig:x(()=>Fe().sankey,"getConfig"),getNodes:BMt,getLinks:FMt,getGraph:zMt,addLink:OMt,findOrCreateNode:PMt,getAccTitle:ni,setAccTitle:Hn,getAccDescription:ai,setAccDescription:ii,getDiagramTitle:Yn,setDiagramTitle:ti,clear:NMt},ah,qie=(ah=class{static next(e){return new ah(e+ ++ah.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},x(ah,"Uid"),ah.count=0,ah),GMt={left:pMt,right:gMt,center:mMt,justify:R6e},WMt=x(t=>{let e=0,r=0;for(const n of t){const i=n.value??0;i>e&&(e=i,r=n.layer??0)}return r},"findCentralNodeLayer"),HMt=x(function(t,e,r,n){const{securityLevel:i,sankey:a}=Fe(),s=ice.sankey;let o;i==="sandbox"&&(o=ut("#i"+e));const l=ut(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):ut(`[id="${e}"]`),h=(a==null?void 0:a.width)??s.width,d=(a==null?void 0:a.height)??s.width,f=(a==null?void 0:a.useMaxWidth)??s.useMaxWidth,p=(a==null?void 0:a.nodeAlignment)??s.nodeAlignment,g=(a==null?void 0:a.prefix)??s.prefix,m=(a==null?void 0:a.suffix)??s.suffix,y=(a==null?void 0:a.showValues)??s.showValues,v=(a==null?void 0:a.nodeWidth)??s.nodeWidth??10,T=(a==null?void 0:a.nodePadding)??s.nodePadding??12,b=(a==null?void 0:a.labelStyle)??s.labelStyle??"legacy",w=(a==null?void 0:a.nodeColors)??{},C=n.db.getGraph(),S=GMt[p];xMt().nodeId(N=>N.id).nodeWidth(v).nodePadding(T+(y?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(C);const E=WMt(C.nodes),_=h0(Qqe),M=x(N=>w[N]??_(N),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(C.nodes).join("g").attr("class","node").attr("id",N=>(N.uid=qie.next("node-")).id).attr("transform",function(N){return"translate("+N.x0+","+N.y0+")"}).attr("x",N=>N.x0).attr("y",N=>N.y0).append("rect").attr("height",N=>N.y1-N.y0).attr("width",N=>N.x1-N.x0).attr("fill",N=>M(N.id));const L=x(({id:N,value:F})=>y?`${N} -${g}${Math.round(F*100)/100}${m}`:N,"getText"),P=x(N=>b==="outlined"?(N.layer??0)D.selectAll(N?`.${N}`:"text").data(C.nodes).join("text").attr("class",N??null).attr("x",F=>P(F).x).attr("y",F=>(F.y1+F.y0)/2).attr("dy",`${y?"0":"0.35"}em`).attr("text-anchor",F=>P(F).anchor).text(L),"appendLabel");b==="outlined"?(R("sankey-label-bg"),R("sankey-label-fg")):R();const I=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(C.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),$=(a==null?void 0:a.linkColor)??"gradient";if($==="gradient"){const N=I.append("linearGradient").attr("id",F=>(F.uid=qie.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",F=>F.source.x1).attr("x2",F=>F.target.x0);N.append("stop").attr("offset","0%").attr("stop-color",F=>M(F.source.id)),N.append("stop").attr("offset","100%").attr("stop-color",F=>M(F.target.id))}let O;switch($){case"gradient":O=x(N=>N.uid,"coloring");break;case"source":O=x(N=>M(N.source.id),"coloring");break;case"target":O=x(N=>M(N.target.id),"coloring");break;default:O=$}I.append("path").attr("d",IMt()).attr("stroke",O).attr("stroke-width",N=>Math.max(1,N.width)),mx(void 0,u,0,f)},"draw"),qMt={draw:HMt},UMt=x(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` -`).trim(),"prepareTextForParsing"),YMt=x(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var u=this.next();return u||this.lex()},"lex"),begin:x(function(u){this.conditionStack.push(u)},"begin"),popState:x(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:x(function(u){this.begin(u)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o})();i.lexer=a;function s(){this.yy={}}return x(s,"Parser"),s.prototype=i,i.Parser=s,new s})();JB.parser=JB;var S6=JB,z7=[],V7=[],E6=new Map,$Mt=x(()=>{z7=[],V7=[],E6=new Map,$n()},"clear"),ab,PMt=(ab=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},x(ab,"SankeyLink"),ab),BMt=x((t,e,r)=>{z7.push(new PMt(t,e,r))},"addLink"),sb,FMt=(sb=class{constructor(e){this.ID=e}},x(sb,"SankeyNode"),sb),zMt=x(t=>{t=At.sanitizeText(t,Fe());let e=E6.get(t);return e===void 0&&(e=new FMt(t),E6.set(t,e),V7.push(e)),e},"findOrCreateNode"),VMt=x(()=>V7,"getNodes"),GMt=x(()=>z7,"getLinks"),WMt=x(()=>({nodes:V7.map(t=>({id:t.ID})),links:z7.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),HMt={nodesMap:E6,getConfig:x(()=>Fe().sankey,"getConfig"),getNodes:VMt,getLinks:GMt,getGraph:WMt,addLink:BMt,findOrCreateNode:zMt,getAccTitle:ni,setAccTitle:Hn,getAccDescription:ai,setAccDescription:ii,getDiagramTitle:Yn,setDiagramTitle:ti,clear:$Mt},ah,Uie=(ah=class{static next(e){return new ah(e+ ++ah.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},x(ah,"Uid"),ah.count=0,ah),qMt={left:yMt,right:vMt,center:bMt,justify:L6e},UMt=x(t=>{let e=0,r=0;for(const n of t){const i=n.value??0;i>e&&(e=i,r=n.layer??0)}return r},"findCentralNodeLayer"),YMt=x(function(t,e,r,n){const{securityLevel:i,sankey:a}=Fe(),s=ace.sankey;let o;i==="sandbox"&&(o=ut("#i"+e));const l=ut(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):ut(`[id="${e}"]`),h=(a==null?void 0:a.width)??s.width,d=(a==null?void 0:a.height)??s.width,f=(a==null?void 0:a.useMaxWidth)??s.useMaxWidth,p=(a==null?void 0:a.nodeAlignment)??s.nodeAlignment,g=(a==null?void 0:a.prefix)??s.prefix,m=(a==null?void 0:a.suffix)??s.suffix,y=(a==null?void 0:a.showValues)??s.showValues,v=(a==null?void 0:a.nodeWidth)??s.nodeWidth??10,T=(a==null?void 0:a.nodePadding)??s.nodePadding??12,b=(a==null?void 0:a.labelStyle)??s.labelStyle??"legacy",w=(a==null?void 0:a.nodeColors)??{},C=n.db.getGraph(),S=qMt[p];CMt().nodeId(N=>N.id).nodeWidth(v).nodePadding(T+(y?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(C);const E=UMt(C.nodes),_=h0(Jqe),M=x(N=>w[N]??_(N),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(C.nodes).join("g").attr("class","node").attr("id",N=>(N.uid=Uie.next("node-")).id).attr("transform",function(N){return"translate("+N.x0+","+N.y0+")"}).attr("x",N=>N.x0).attr("y",N=>N.y0).append("rect").attr("height",N=>N.y1-N.y0).attr("width",N=>N.x1-N.x0).attr("fill",N=>M(N.id));const L=x(({id:N,value:F})=>y?`${N} +${g}${Math.round(F*100)/100}${m}`:N,"getText"),P=x(N=>b==="outlined"?(N.layer??0)D.selectAll(N?`.${N}`:"text").data(C.nodes).join("text").attr("class",N??null).attr("x",F=>P(F).x).attr("y",F=>(F.y1+F.y0)/2).attr("dy",`${y?"0":"0.35"}em`).attr("text-anchor",F=>P(F).anchor).text(L),"appendLabel");b==="outlined"?(R("sankey-label-bg"),R("sankey-label-fg")):R();const I=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(C.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),$=(a==null?void 0:a.linkColor)??"gradient";if($==="gradient"){const N=I.append("linearGradient").attr("id",F=>(F.uid=Uie.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",F=>F.source.x1).attr("x2",F=>F.target.x0);N.append("stop").attr("offset","0%").attr("stop-color",F=>M(F.source.id)),N.append("stop").attr("offset","100%").attr("stop-color",F=>M(F.target.id))}let O;switch($){case"gradient":O=x(N=>N.uid,"coloring");break;case"source":O=x(N=>M(N.source.id),"coloring");break;case"target":O=x(N=>M(N.target.id),"coloring");break;default:O=$}I.append("path").attr("d",OMt()).attr("stroke",O).attr("stroke-width",N=>Math.max(1,N.width)),mx(void 0,u,0,f)},"draw"),XMt={draw:YMt},jMt=x(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` +`).trim(),"prepareTextForParsing"),KMt=x(t=>`.label { font-family: ${t.fontFamily}; } @@ -3175,7 +3177,7 @@ ${g}${Math.round(F*100)/100}${m}`:N,"getText"),P=x(N=>b==="outlined"?(N.layer??0 stroke-opacity: 0.5; mix-blend-mode: multiply; } -`,"getStyles"),XMt=YMt,jMt=S6.parse.bind(S6);S6.parse=t=>jMt(UMt(t));var KMt={styles:XMt,parser:S6,db:VMt,renderer:qMt};const ZMt=Object.freeze(Object.defineProperty({__proto__:null,diagram:KMt},Symbol.toStringTag,{value:"Module"}));var QMt=Vr.packet,ob,M6e=(ob=class{constructor(){this.packet=[],this.setAccTitle=Hn,this.getAccTitle=ni,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getAccDescription=ai,this.setAccDescription=ii}getConfig(){const e=ri({...QMt,...Xt().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){On(),this.packet=[]}},x(ob,"PacketDB"),ob),JMt=1e4,eIt=x((t,e)=>{eo(t,e);let r=-1,n=[],i=1;const{bitsPerRow:a}=e.getConfig();for(let{start:s,end:o,bits:l,label:u}of t.blocks){if(s!==void 0&&o!==void 0&&o{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const n=e*r-1,i=e*r;return[{start:t.start,end:n,label:t.label,bits:n-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),I6e={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Al("packet",t),r=(n=I6e.parser)==null?void 0:n.yy;if(!(r instanceof M6e))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");le.debug(e),eIt(e,r)},"parse")},rIt=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),{rowHeight:s,paddingY:o,bitWidth:l,bitsPerRow:u}=a,h=i.getPacket(),d=i.getDiagramTitle(),f=s+o,p=f*(h.length+1)-(d?0:s),g=l*u+2,m=xs(e);m.attr("viewBox",`0 0 ${g} ${p}`),Ai(m,p,g,a.useMaxWidth);for(const[y,v]of h.entries())nIt(m,v,y,a);m.append("text").text(d).attr("x",g/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),nIt=x((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const u=t.append("g"),h=r*(n+a)+a;for(const d of e){const f=d.start%o*s+1,p=(d.end-d.start+1)*s-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),iIt={draw:rIt},aIt={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},sIt=x(({packet:t}={})=>{const e=ri(aIt,t);return` +`,"getStyles"),ZMt=KMt,QMt=S6.parse.bind(S6);S6.parse=t=>QMt(jMt(t));var JMt={styles:ZMt,parser:S6,db:HMt,renderer:XMt};const eIt=Object.freeze(Object.defineProperty({__proto__:null,diagram:JMt},Symbol.toStringTag,{value:"Module"}));var tIt=Vr.packet,ob,I6e=(ob=class{constructor(){this.packet=[],this.setAccTitle=Hn,this.getAccTitle=ni,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getAccDescription=ai,this.setAccDescription=ii}getConfig(){const e=ri({...tIt,...Xt().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){$n(),this.packet=[]}},x(ob,"PacketDB"),ob),rIt=1e4,nIt=x((t,e)=>{eo(t,e);let r=-1,n=[],i=1;const{bitsPerRow:a}=e.getConfig();for(let{start:s,end:o,bits:l,label:u}of t.blocks){if(s!==void 0&&o!==void 0&&o{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const n=e*r-1,i=e*r;return[{start:t.start,end:n,label:t.label,bits:n-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),N6e={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Al("packet",t),r=(n=N6e.parser)==null?void 0:n.yy;if(!(r instanceof I6e))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");le.debug(e),nIt(e,r)},"parse")},aIt=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),{rowHeight:s,paddingY:o,bitWidth:l,bitsPerRow:u}=a,h=i.getPacket(),d=i.getDiagramTitle(),f=s+o,p=f*(h.length+1)-(d?0:s),g=l*u+2,m=xs(e);m.attr("viewBox",`0 0 ${g} ${p}`),Ai(m,p,g,a.useMaxWidth);for(const[y,v]of h.entries())sIt(m,v,y,a);m.append("text").text(d).attr("x",g/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),sIt=x((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const u=t.append("g"),h=r*(n+a)+a;for(const d of e){const f=d.start%o*s+1,p=(d.end-d.start+1)*s-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),oIt={draw:aIt},lIt={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},cIt=x(({packet:t}={})=>{const e=ri(lIt,t);return` .packetByte { font-size: ${e.byteFontSize}; } @@ -3198,7 +3200,7 @@ ${g}${Math.round(F*100)/100}${m}`:N,"getText"),P=x(N=>b==="outlined"?(N.layer??0 stroke-width: ${e.blockStrokeWidth}; fill: ${e.blockFillColor}; } - `},"styles"),oIt={parser:I6e,get db(){return new M6e},renderer:iIt,styles:sIt};const lIt=Object.freeze(Object.defineProperty({__proto__:null,diagram:oIt},Symbol.toStringTag,{value:"Module"}));var Fm={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},_4=32,N6e={axes:[],curves:[],options:Fm},Wc=structuredClone(N6e),cIt=Vr.radar,uIt=x(()=>ri({...cIt,...Xt().radar}),"getConfig"),D6e=x(()=>Wc.axes,"getAxes"),hIt=x(()=>Wc.curves,"getCurves"),dIt=x(()=>Wc.options,"getOptions"),fIt=x(t=>{Wc.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),pIt=x(t=>{Wc.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:gIt(e.entries)}))},"setCurves"),gIt=x(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=D6e();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(r=>{const n=t.find(i=>{var a;return((a=i.axis)==null?void 0:a.$refText)===r.name});if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),mIt=x(t=>{var r,n,i,a,s;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});Wc.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??Fm.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??Fm.ticks,max:((i=e.max)==null?void 0:i.value)??Fm.max,min:((a=e.min)==null?void 0:a.value)??Fm.min,graticule:((s=e.graticule)==null?void 0:s.value)??Fm.graticule},Wc.options.ticks>_4&&(le.warn(`Radar diagram ticks (${Wc.options.ticks}) exceeds maximum allowed (${_4}). Using ${_4} instead.`),Wc.options.ticks=_4)},"setOptions"),yIt=x(()=>{On(),Wc=structuredClone(N6e)},"clear"),bw={getAxes:D6e,getCurves:hIt,getOptions:dIt,setAxes:fIt,setCurves:pIt,setOptions:mIt,getConfig:uIt,clear:yIt,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii},vIt=x(t=>{eo(t,bw);const{axes:e,curves:r,options:n}=t;bw.setAxes(e),bw.setCurves(r),bw.setOptions(n)},"populate"),bIt={parse:x(async t=>{const e=await Al("radar",t);le.debug(e),vIt(e)},"parse")},xIt=x((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=xs(e),d=TIt(h,l),f=o.max??Math.max(...s.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;wIt(d,a,g,o.ticks,o.graticule),CIt(d,a,g,l),O6e(d,a,s,p,f,o.graticule,l),B6e(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),TIt=x((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return Ai(t,n,r,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${r} ${n}`).attr("overflow","visible"),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),wIt=x((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a{const d=2*h*Math.PI/a-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),CIt=x((t,e,r,n)=>{const i=e.length;for(let a=0;a.01?"start":l<-.01?"end":"middle",d=u>.01?"hanging":u<-.01?"auto":"central",f=4;t.append("text").text(s).attr("x",r*n.axisLabelFactor*l+f*l).attr("y",r*n.axisLabelFactor*u+f*u).attr("text-anchor",h).attr("dominant-baseline",d).attr("class","radarAxisLabel")}},"drawAxes");function O6e(t,e,r,n,i,a,s){const o=e.length,l=Math.min(s.width,s.height)/2;r.forEach((u,h)=>{if(u.entries.length!==o)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/o-Math.PI/2,m=$6e(f,n,i,l),y=m*Math.cos(g),v=m*Math.sin(g);return{x:y,y:v}});a==="circle"?t.append("path").attr("d",P6e(d,s.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}x(O6e,"drawCurves");function $6e(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}x($6e,"relativeRadius");function P6e(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i{const u=t.append("g").attr("transform",`translate(${i}, ${a+l*s})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}x(B6e,"drawLegend");var kIt={draw:xIt},SIt=x((t,e)=>{let r="";for(let n=0;nri({...dIt,...Xt().radar}),"getConfig"),O6e=x(()=>Wc.axes,"getAxes"),pIt=x(()=>Wc.curves,"getCurves"),gIt=x(()=>Wc.options,"getOptions"),mIt=x(t=>{Wc.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),yIt=x(t=>{Wc.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:vIt(e.entries)}))},"setCurves"),vIt=x(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=O6e();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(r=>{const n=t.find(i=>{var a;return((a=i.axis)==null?void 0:a.$refText)===r.name});if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),bIt=x(t=>{var r,n,i,a,s;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});Wc.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??Fm.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??Fm.ticks,max:((i=e.max)==null?void 0:i.value)??Fm.max,min:((a=e.min)==null?void 0:a.value)??Fm.min,graticule:((s=e.graticule)==null?void 0:s.value)??Fm.graticule},Wc.options.ticks>_4&&(le.warn(`Radar diagram ticks (${Wc.options.ticks}) exceeds maximum allowed (${_4}). Using ${_4} instead.`),Wc.options.ticks=_4)},"setOptions"),xIt=x(()=>{$n(),Wc=structuredClone(D6e)},"clear"),bw={getAxes:O6e,getCurves:pIt,getOptions:gIt,setAxes:mIt,setCurves:yIt,setOptions:bIt,getConfig:fIt,clear:xIt,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii},TIt=x(t=>{eo(t,bw);const{axes:e,curves:r,options:n}=t;bw.setAxes(e),bw.setCurves(r),bw.setOptions(n)},"populate"),wIt={parse:x(async t=>{const e=await Al("radar",t);le.debug(e),TIt(e)},"parse")},CIt=x((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=xs(e),d=kIt(h,l),f=o.max??Math.max(...s.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;SIt(d,a,g,o.ticks,o.graticule),EIt(d,a,g,l),$6e(d,a,s,p,f,o.graticule,l),F6e(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),kIt=x((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return Ai(t,n,r,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${r} ${n}`).attr("overflow","visible"),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),SIt=x((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a{const d=2*h*Math.PI/a-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),EIt=x((t,e,r,n)=>{const i=e.length;for(let a=0;a.01?"start":l<-.01?"end":"middle",d=u>.01?"hanging":u<-.01?"auto":"central",f=4;t.append("text").text(s).attr("x",r*n.axisLabelFactor*l+f*l).attr("y",r*n.axisLabelFactor*u+f*u).attr("text-anchor",h).attr("dominant-baseline",d).attr("class","radarAxisLabel")}},"drawAxes");function $6e(t,e,r,n,i,a,s){const o=e.length,l=Math.min(s.width,s.height)/2;r.forEach((u,h)=>{if(u.entries.length!==o)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/o-Math.PI/2,m=P6e(f,n,i,l),y=m*Math.cos(g),v=m*Math.sin(g);return{x:y,y:v}});a==="circle"?t.append("path").attr("d",B6e(d,s.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}x($6e,"drawCurves");function P6e(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}x(P6e,"relativeRadius");function B6e(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i{const u=t.append("g").attr("transform",`translate(${i}, ${a+l*s})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}x(F6e,"drawLegend");var AIt={draw:CIt},_It=x((t,e)=>{let r="";for(let n=0;nb==="outlined"?(N.layer??0 fill-opacity: ${e.curveOpacity}; stroke: ${i}; } - `}return r},"genIndexStyles"),EIt=x(t=>{const e=Dh(),r=Xt(),n=ri(e,r.themeVariables),i=ri(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),AIt=x(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=EIt(t);return` + `}return r},"genIndexStyles"),RIt=x(t=>{const e=Dh(),r=Xt(),n=ri(e,r.themeVariables),i=ri(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),LIt=x(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=RIt(t);return` .radarTitle { font-size: ${e.fontSize}; color: ${e.titleColor}; @@ -3237,13 +3239,13 @@ ${g}${Math.round(F*100)/100}${m}`:N,"getText"),P=x(N=>b==="outlined"?(N.layer??0 font-size: ${r.legendFontSize}px; dominant-baseline: hanging; } - ${SIt(e,r)} - `},"styles"),_It={parser:bIt,db:bw,renderer:kIt,styles:AIt};const RIt=Object.freeze(Object.defineProperty({__proto__:null,diagram:_It},Symbol.toStringTag,{value:"Module"}));var eF=(function(){var t=x(function(b,w,C,S){for(C=C||{},S=b.length;S--;C[b[S]]=w);return C},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],a=[1,19],s=[1,16],o=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],m=[1,49],y={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:x(function(w,C,S,k,E,_,M){var L=_.length-1;switch(E){case 4:k.getLogger().debug("Rule: separator (NL) ");break;case 5:k.getLogger().debug("Rule: separator (Space) ");break;case 6:k.getLogger().debug("Rule: separator (EOF) ");break;case 7:k.getLogger().debug("Rule: hierarchy: ",_[L-1]),k.setHierarchy(_[L-1]);break;case 8:k.getLogger().debug("Stop NL ");break;case 9:k.getLogger().debug("Stop EOF ");break;case 10:k.getLogger().debug("Stop NL2 ");break;case 11:k.getLogger().debug("Stop EOF2 ");break;case 12:k.getLogger().debug("Rule: statement: ",_[L]),typeof _[L].length=="number"?this.$=_[L]:this.$=[_[L]];break;case 13:k.getLogger().debug("Rule: statement #2: ",_[L-1]),this.$=[_[L-1]].concat(_[L]);break;case 14:k.getLogger().debug("Rule: link: ",_[L],w),this.$={edgeTypeStr:_[L],label:""};break;case 15:k.getLogger().debug("Rule: LABEL link: ",_[L-3],_[L-1],_[L]),this.$={edgeTypeStr:_[L],label:_[L-1]};break;case 18:const P=parseInt(_[L]),D=k.generateId();this.$={id:D,type:"space",label:"",width:P,children:[]};break;case 23:k.getLogger().debug("Rule: (nodeStatement link node) ",_[L-2],_[L-1],_[L]," typestr: ",_[L-1].edgeTypeStr);const R=k.edgeStrToEdgeData(_[L-1].edgeTypeStr),I=k.edgeStrToEdgeStartData(_[L-1].edgeTypeStr),$=k.edgeStrToThickness(_[L-1].edgeTypeStr),O=k.edgeStrToPattern(_[L-1].edgeTypeStr);this.$=[{id:_[L-2].id,label:_[L-2].label,type:_[L-2].type,directions:_[L-2].directions},{id:_[L-2].id+"-"+_[L].id,start:_[L-2].id,end:_[L].id,label:_[L-1].label,type:"edge",thickness:$,pattern:O,directions:_[L].directions,arrowTypeEnd:R,arrowTypeStart:I},{id:_[L].id,label:_[L].label,type:k.typeStr2Type(_[L].typeStr),directions:_[L].directions}];break;case 24:k.getLogger().debug("Rule: nodeStatement (abc88 node size) ",_[L-1],_[L]),this.$={id:_[L-1].id,label:_[L-1].label,type:k.typeStr2Type(_[L-1].typeStr),directions:_[L-1].directions,widthInColumns:parseInt(_[L],10)};break;case 25:k.getLogger().debug("Rule: nodeStatement (node) ",_[L]),this.$={id:_[L].id,label:_[L].label,type:k.typeStr2Type(_[L].typeStr),directions:_[L].directions,widthInColumns:1};break;case 26:k.getLogger().debug("APA123",this?this:"na"),k.getLogger().debug("COLUMNS: ",_[L]),this.$={type:"column-setting",columns:_[L]==="auto"?-1:parseInt(_[L])};break;case 27:k.getLogger().debug("Rule: id-block statement : ",_[L-2],_[L-1]),k.generateId(),this.$={..._[L-2],type:"composite",children:_[L-1]};break;case 28:k.getLogger().debug("Rule: blockStatement : ",_[L-2],_[L-1],_[L]);const N=k.generateId();this.$={id:N,type:"composite",label:"",children:_[L-1]};break;case 29:k.getLogger().debug("Rule: node (NODE_ID separator): ",_[L]),this.$={id:_[L]};break;case 30:k.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",_[L-1],_[L]),this.$={id:_[L-1],label:_[L].label,typeStr:_[L].typeStr,directions:_[L].directions};break;case 31:k.getLogger().debug("Rule: dirList: ",_[L]),this.$=[_[L]];break;case 32:k.getLogger().debug("Rule: dirList: ",_[L-1],_[L]),this.$=[_[L-1]].concat(_[L]);break;case 33:k.getLogger().debug("Rule: nodeShapeNLabel: ",_[L-2],_[L-1],_[L]),this.$={typeStr:_[L-2]+_[L],label:_[L-1]};break;case 34:k.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",_[L-3],_[L-2]," #3:",_[L-1],_[L]),this.$={typeStr:_[L-3]+_[L],label:_[L-2],directions:_[L-1]};break;case 35:case 36:this.$={type:"classDef",id:_[L-1].trim(),css:_[L].trim()};break;case 37:this.$={type:"applyClass",id:_[L-1].trim(),styleClass:_[L].trim()};break;case 38:this.$={type:"applyStyles",id:_[L-1].trim(),stylesStr:_[L].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:a,39:s,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:a},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:x(function(w,C){if(C.recoverable)this.trace(w);else{var S=new Error(w);throw S.hash=C,S}},"parseError"),parse:x(function(w){var C=this,S=[0],k=[],E=[null],_=[],M=this.table,L="",P=0,D=0,R=2,I=1,$=_.slice.call(arguments,1),O=Object.create(this.lexer),N={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(N.yy[F]=this.yy[F]);O.setInput(w,N.yy),N.yy.lexer=O,N.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var z=O.yylloc;_.push(z);var V=O.options&&O.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function B(ee){S.length=S.length-2*ee,E.length=E.length-ee,_.length=_.length-ee}x(B,"popStack");function G(){var ee;return ee=k.pop()||O.lex()||I,typeof ee!="number"&&(ee instanceof Array&&(k=ee,ee=k.pop()),ee=C.symbols_[ee]||ee),ee}x(G,"lex");for(var H,q,Z,Y,ie={},K,Q,te,J;;){if(q=S[S.length-1],this.defaultActions[q]?Z=this.defaultActions[q]:((H===null||typeof H>"u")&&(H=G()),Z=M[q]&&M[q][H]),typeof Z>"u"||!Z.length||!Z[0]){var ge="";J=[];for(K in M[q])this.terminals_[K]&&K>R&&J.push("'"+this.terminals_[K]+"'");O.showPosition?ge="Parse error on line "+(P+1)+`: + ${_It(e,r)} + `},"styles"),MIt={parser:wIt,db:bw,renderer:AIt,styles:LIt};const IIt=Object.freeze(Object.defineProperty({__proto__:null,diagram:MIt},Symbol.toStringTag,{value:"Module"}));var eF=(function(){var t=x(function(b,w,C,S){for(C=C||{},S=b.length;S--;C[b[S]]=w);return C},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],a=[1,19],s=[1,16],o=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],m=[1,49],y={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:x(function(w,C,S,k,E,_,M){var L=_.length-1;switch(E){case 4:k.getLogger().debug("Rule: separator (NL) ");break;case 5:k.getLogger().debug("Rule: separator (Space) ");break;case 6:k.getLogger().debug("Rule: separator (EOF) ");break;case 7:k.getLogger().debug("Rule: hierarchy: ",_[L-1]),k.setHierarchy(_[L-1]);break;case 8:k.getLogger().debug("Stop NL ");break;case 9:k.getLogger().debug("Stop EOF ");break;case 10:k.getLogger().debug("Stop NL2 ");break;case 11:k.getLogger().debug("Stop EOF2 ");break;case 12:k.getLogger().debug("Rule: statement: ",_[L]),typeof _[L].length=="number"?this.$=_[L]:this.$=[_[L]];break;case 13:k.getLogger().debug("Rule: statement #2: ",_[L-1]),this.$=[_[L-1]].concat(_[L]);break;case 14:k.getLogger().debug("Rule: link: ",_[L],w),this.$={edgeTypeStr:_[L],label:""};break;case 15:k.getLogger().debug("Rule: LABEL link: ",_[L-3],_[L-1],_[L]),this.$={edgeTypeStr:_[L],label:_[L-1]};break;case 18:const P=parseInt(_[L]),D=k.generateId();this.$={id:D,type:"space",label:"",width:P,children:[]};break;case 23:k.getLogger().debug("Rule: (nodeStatement link node) ",_[L-2],_[L-1],_[L]," typestr: ",_[L-1].edgeTypeStr);const R=k.edgeStrToEdgeData(_[L-1].edgeTypeStr),I=k.edgeStrToEdgeStartData(_[L-1].edgeTypeStr),$=k.edgeStrToThickness(_[L-1].edgeTypeStr),O=k.edgeStrToPattern(_[L-1].edgeTypeStr);this.$=[{id:_[L-2].id,label:_[L-2].label,type:_[L-2].type,directions:_[L-2].directions},{id:_[L-2].id+"-"+_[L].id,start:_[L-2].id,end:_[L].id,label:_[L-1].label,type:"edge",thickness:$,pattern:O,directions:_[L].directions,arrowTypeEnd:R,arrowTypeStart:I},{id:_[L].id,label:_[L].label,type:k.typeStr2Type(_[L].typeStr),directions:_[L].directions}];break;case 24:k.getLogger().debug("Rule: nodeStatement (abc88 node size) ",_[L-1],_[L]),this.$={id:_[L-1].id,label:_[L-1].label,type:k.typeStr2Type(_[L-1].typeStr),directions:_[L-1].directions,widthInColumns:parseInt(_[L],10)};break;case 25:k.getLogger().debug("Rule: nodeStatement (node) ",_[L]),this.$={id:_[L].id,label:_[L].label,type:k.typeStr2Type(_[L].typeStr),directions:_[L].directions,widthInColumns:1};break;case 26:k.getLogger().debug("APA123",this?this:"na"),k.getLogger().debug("COLUMNS: ",_[L]),this.$={type:"column-setting",columns:_[L]==="auto"?-1:parseInt(_[L])};break;case 27:k.getLogger().debug("Rule: id-block statement : ",_[L-2],_[L-1]),k.generateId(),this.$={..._[L-2],type:"composite",children:_[L-1]};break;case 28:k.getLogger().debug("Rule: blockStatement : ",_[L-2],_[L-1],_[L]);const N=k.generateId();this.$={id:N,type:"composite",label:"",children:_[L-1]};break;case 29:k.getLogger().debug("Rule: node (NODE_ID separator): ",_[L]),this.$={id:_[L]};break;case 30:k.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",_[L-1],_[L]),this.$={id:_[L-1],label:_[L].label,typeStr:_[L].typeStr,directions:_[L].directions};break;case 31:k.getLogger().debug("Rule: dirList: ",_[L]),this.$=[_[L]];break;case 32:k.getLogger().debug("Rule: dirList: ",_[L-1],_[L]),this.$=[_[L-1]].concat(_[L]);break;case 33:k.getLogger().debug("Rule: nodeShapeNLabel: ",_[L-2],_[L-1],_[L]),this.$={typeStr:_[L-2]+_[L],label:_[L-1]};break;case 34:k.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",_[L-3],_[L-2]," #3:",_[L-1],_[L]),this.$={typeStr:_[L-3]+_[L],label:_[L-2],directions:_[L-1]};break;case 35:case 36:this.$={type:"classDef",id:_[L-1].trim(),css:_[L].trim()};break;case 37:this.$={type:"applyClass",id:_[L-1].trim(),styleClass:_[L].trim()};break;case 38:this.$={type:"applyStyles",id:_[L-1].trim(),stylesStr:_[L].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:a,39:s,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:a},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:x(function(w,C){if(C.recoverable)this.trace(w);else{var S=new Error(w);throw S.hash=C,S}},"parseError"),parse:x(function(w){var C=this,S=[0],k=[],E=[null],_=[],M=this.table,L="",P=0,D=0,R=2,I=1,$=_.slice.call(arguments,1),O=Object.create(this.lexer),N={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(N.yy[F]=this.yy[F]);O.setInput(w,N.yy),N.yy.lexer=O,N.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var z=O.yylloc;_.push(z);var V=O.options&&O.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function B(ee){S.length=S.length-2*ee,E.length=E.length-ee,_.length=_.length-ee}x(B,"popStack");function G(){var ee;return ee=k.pop()||O.lex()||I,typeof ee!="number"&&(ee instanceof Array&&(k=ee,ee=k.pop()),ee=C.symbols_[ee]||ee),ee}x(G,"lex");for(var H,q,Z,Y,ie={},K,Q,te,J;;){if(q=S[S.length-1],this.defaultActions[q]?Z=this.defaultActions[q]:((H===null||typeof H>"u")&&(H=G()),Z=M[q]&&M[q][H]),typeof Z>"u"||!Z.length||!Z[0]){var ge="";J=[];for(K in M[q])this.terminals_[K]&&K>R&&J.push("'"+this.terminals_[K]+"'");O.showPosition?ge="Parse error on line "+(P+1)+`: `+O.showPosition()+` Expecting `+J.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ge="Parse error on line "+(P+1)+": Unexpected "+(H==I?"end of input":"'"+(this.terminals_[H]||H)+"'"),this.parseError(ge,{text:O.match,token:this.terminals_[H]||H,line:O.yylineno,loc:z,expected:J})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+H);switch(Z[0]){case 1:S.push(H),E.push(O.yytext),_.push(O.yylloc),S.push(Z[1]),H=null,D=O.yyleng,L=O.yytext,P=O.yylineno,z=O.yylloc;break;case 2:if(Q=this.productions_[Z[1]][1],ie.$=E[E.length-Q],ie._$={first_line:_[_.length-(Q||1)].first_line,last_line:_[_.length-1].last_line,first_column:_[_.length-(Q||1)].first_column,last_column:_[_.length-1].last_column},V&&(ie._$.range=[_[_.length-(Q||1)].range[0],_[_.length-1].range[1]]),Y=this.performAction.apply(ie,[L,D,P,N.yy,Z[1],E,_].concat($)),typeof Y<"u")return Y;Q&&(S=S.slice(0,-1*Q*2),E=E.slice(0,-1*Q),_=_.slice(0,-1*Q)),S.push(this.productions_[Z[1]][0]),E.push(ie.$),_.push(ie._$),te=M[S[S.length-2]][S[S.length-1]],S.push(te);break;case 3:return!0}}return!0},"parse")},v=(function(){var b={EOF:1,parseError:x(function(C,S){if(this.yy.parser)this.yy.parser.parseError(C,S);else throw new Error(C)},"parseError"),setInput:x(function(w,C){return this.yy=C||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var C=w.match(/(?:\r\n?|\n).*/g);return C?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:x(function(w){var C=w.length,S=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-C),this.offset-=C;var k=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),S.length-1&&(this.yylineno-=S.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===k.length?this.yylloc.first_column:0)+k[k.length-S.length].length-S[0].length:this.yylloc.first_column-C},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-C]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(w){this.unput(this.match.slice(w))},"less"),pastInput:x(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var w=this.pastInput(),C=new Array(w.length+1).join("-");return w+this.upcomingInput()+` `+C+"^"},"showPosition"),test_match:x(function(w,C){var S,k,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),k=w[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(w[0].length),this.matched+=w[0],S=this.performAction.call(this,this.yy,this,C,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),S)return S;if(this._backtrack){for(var _ in E)this[_]=E[_];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,C,S,k;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),_=0;_C[0].length)){if(C=S,k=_,this.options.backtrack_lexer){if(w=this.test_match(S,E[_]),w!==!1)return w;if(this._backtrack){C=!1;continue}else return!1}else if(!this.options.flex)break}return C?(w=this.test_match(C,E[k]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var C=this.next();return C||this.lex()},"lex"),begin:x(function(C){this.conditionStack.push(C)},"begin"),popState:x(function(){var C=this.conditionStack.length-1;return C>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(C){return C=this.conditionStack.length-1-Math.abs(C||0),C>=0?this.conditionStack[C]:"INITIAL"},"topState"),pushState:x(function(C){this.begin(C)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(C,S,k,E){switch(k){case 0:return C.getLogger().debug("Found block-beta"),10;case 1:return C.getLogger().debug("Found id-block"),29;case 2:return C.getLogger().debug("Found block"),10;case 3:C.getLogger().debug(".",S.yytext);break;case 4:C.getLogger().debug("_",S.yytext);break;case 5:return 5;case 6:return S.yytext=-1,28;case 7:return S.yytext=S.yytext.replace(/columns\s+/,""),C.getLogger().debug("COLUMNS (LEX)",S.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:C.getLogger().debug("LEX: POPPING STR:",S.yytext),this.popState();break;case 13:return C.getLogger().debug("LEX: STR end:",S.yytext),"STR";case 14:return S.yytext=S.yytext.replace(/space\:/,""),C.getLogger().debug("SPACE NUM (LEX)",S.yytext),21;case 15:return S.yytext="1",C.getLogger().debug("COLUMNS (LEX)",S.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),C.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),C.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),C.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),C.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),C.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),C.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),C.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),C.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),C.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),C.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return C.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return C.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return C.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return C.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return C.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return C.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return C.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),C.getLogger().debug("LEX ARR START"),37;case 74:return C.getLogger().debug("Lex: NODE_ID",S.yytext),31;case 75:return C.getLogger().debug("Lex: EOF",S.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:C.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:C.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return C.getLogger().debug("LEX: NODE_DESCR:",S.yytext),"NODE_DESCR";case 83:C.getLogger().debug("LEX POPPING"),this.popState();break;case 84:C.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (right): dir:",S.yytext),"DIR";case 86:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (left):",S.yytext),"DIR";case 87:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (x):",S.yytext),"DIR";case 88:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (y):",S.yytext),"DIR";case 89:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (up):",S.yytext),"DIR";case 90:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (down):",S.yytext),"DIR";case 91:return S.yytext="]>",C.getLogger().debug("Lex (ARROW_DIR end):",S.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return C.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 93:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 94:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 95:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 96:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 97:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 98:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return C.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),C.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 102:return this.popState(),C.getLogger().debug("Lex: LINK",S.yytext),15;case 103:return this.popState(),C.getLogger().debug("Lex: LINK",S.yytext),15;case 104:return C.getLogger().debug("Lex: COLON",S.yytext),S.yytext=S.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return b})();y.lexer=v;function T(){this.yy={}}return x(T,"Parser"),T.prototype=y,y.Parser=T,new T})();eF.parser=eF;var LIt=eF,ac=new Map,GU=[],tF=new Map,Uie="color",Yie="fill",MIt="bgFill",F6e=",",A6=new Map,WU="",IIt=x(t=>At.sanitizeText(t,Fe()),"sanitizeText"),NIt=x(function(t,e=""){let r=A6.get(t);r||(r={id:t,styles:[],textStyles:[]},A6.set(t,r)),e!=null&&e.split(F6e).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(Uie).exec(n)){const s=i.replace(Yie,MIt).replace(Uie,Yie);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),DIt=x(function(t,e=""){const r=ac.get(t);e!=null&&(r.styles=e.split(F6e))},"addStyle2Node"),OIt=x(function(t,e){t.split(",").forEach(function(r){let n=ac.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},ac.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),z6e=x((t,e)=>{const r=t.flat(),n=[],i=r.find(s=>(s==null?void 0:s.type)==="column-setting"),a=(i==null?void 0:i.columns)??-1;for(const s of r){if(typeof a=="number"&&a>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>a&&le.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=IIt(s.label)),s.type==="classDef"){NIt(s.id,s.css);continue}if(s.type==="applyClass"){OIt(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&DIt(s.id,s==null?void 0:s.stylesStr);continue}if(s.type==="column-setting")e.columns=s.columns??-1;else if(s.type==="edge"){const o=(tF.get(s.id)??0)+1;tF.set(s.id,o),s.id=o+"-"+s.id,GU.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=ac.get(s.id);if(o===void 0?ac.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&z6e(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u{le.debug("Clear called"),On(),uC={id:"root",type:"composite",children:[],columns:-1},ac=new Map([["root",uC]]),HU=[],A6=new Map,GU=[],tF=new Map,WU=""},"clear");function V6e(t){switch(le.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return le.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}x(V6e,"typeStr2Type");function G6e(t){switch(le.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}x(G6e,"edgeTypeStr2Type");function W6e(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}x(W6e,"edgeStrToEdgeData");function H6e(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}x(H6e,"edgeStrToEdgeStartData");function q6e(t){return t.includes("==")?"thick":"normal"}x(q6e,"edgeStrToThickness");function U6e(t){return t.includes(".-")?"dotted":"solid"}x(U6e,"edgeStrToPattern");var Xie=0,PIt=x(()=>(Xie++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Xie),"generateId"),BIt=x(t=>{uC.children=t,z6e(t,uC),HU=uC.children},"setHierarchy"),FIt=x(t=>{const e=ac.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),zIt=x(()=>[...ac.values()],"getBlocksFlat"),VIt=x(()=>HU||[],"getBlocks"),GIt=x(()=>GU,"getEdges"),WIt=x(t=>ac.get(t),"getBlock"),HIt=x(t=>{ac.set(t.id,t)},"setBlock"),qIt=x(t=>{WU=t},"setDiagramId"),UIt=x(()=>WU,"getDiagramId"),YIt=x(()=>le,"getLogger"),XIt=x(function(){return A6},"getClasses"),jIt={getConfig:x(()=>Xt().block,"getConfig"),typeStr2Type:V6e,edgeTypeStr2Type:G6e,edgeStrToEdgeData:W6e,edgeStrToEdgeStartData:H6e,edgeStrToThickness:q6e,edgeStrToPattern:U6e,getLogger:YIt,getBlocksFlat:zIt,getBlocks:VIt,getEdges:GIt,setHierarchy:BIt,getBlock:WIt,setBlock:HIt,getColumns:FIt,getClasses:XIt,clear:$It,generateId:PIt,setDiagramId:qIt,getDiagramId:UIt},KIt=jIt,YN=x((t,e)=>{const r=wz,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return jl(n,i,a,e)},"fade"),ZIt=x(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var C=this.next();return C||this.lex()},"lex"),begin:x(function(C){this.conditionStack.push(C)},"begin"),popState:x(function(){var C=this.conditionStack.length-1;return C>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(C){return C=this.conditionStack.length-1-Math.abs(C||0),C>=0?this.conditionStack[C]:"INITIAL"},"topState"),pushState:x(function(C){this.begin(C)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(C,S,k,E){switch(k){case 0:return C.getLogger().debug("Found block-beta"),10;case 1:return C.getLogger().debug("Found id-block"),29;case 2:return C.getLogger().debug("Found block"),10;case 3:C.getLogger().debug(".",S.yytext);break;case 4:C.getLogger().debug("_",S.yytext);break;case 5:return 5;case 6:return S.yytext=-1,28;case 7:return S.yytext=S.yytext.replace(/columns\s+/,""),C.getLogger().debug("COLUMNS (LEX)",S.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:C.getLogger().debug("LEX: POPPING STR:",S.yytext),this.popState();break;case 13:return C.getLogger().debug("LEX: STR end:",S.yytext),"STR";case 14:return S.yytext=S.yytext.replace(/space\:/,""),C.getLogger().debug("SPACE NUM (LEX)",S.yytext),21;case 15:return S.yytext="1",C.getLogger().debug("COLUMNS (LEX)",S.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),C.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),C.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),C.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),C.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),C.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),C.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),C.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),C.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),C.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),C.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return C.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return C.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return C.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return C.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return C.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return C.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return C.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),C.getLogger().debug("LEX ARR START"),37;case 74:return C.getLogger().debug("Lex: NODE_ID",S.yytext),31;case 75:return C.getLogger().debug("Lex: EOF",S.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:C.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:C.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return C.getLogger().debug("LEX: NODE_DESCR:",S.yytext),"NODE_DESCR";case 83:C.getLogger().debug("LEX POPPING"),this.popState();break;case 84:C.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (right): dir:",S.yytext),"DIR";case 86:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (left):",S.yytext),"DIR";case 87:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (x):",S.yytext),"DIR";case 88:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (y):",S.yytext),"DIR";case 89:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (up):",S.yytext),"DIR";case 90:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (down):",S.yytext),"DIR";case 91:return S.yytext="]>",C.getLogger().debug("Lex (ARROW_DIR end):",S.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return C.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 93:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 94:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 95:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 96:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 97:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 98:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return C.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),C.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 102:return this.popState(),C.getLogger().debug("Lex: LINK",S.yytext),15;case 103:return this.popState(),C.getLogger().debug("Lex: LINK",S.yytext),15;case 104:return C.getLogger().debug("Lex: COLON",S.yytext),S.yytext=S.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return b})();y.lexer=v;function T(){this.yy={}}return x(T,"Parser"),T.prototype=y,y.Parser=T,new T})();eF.parser=eF;var NIt=eF,ac=new Map,GU=[],tF=new Map,Yie="color",Xie="fill",DIt="bgFill",z6e=",",A6=new Map,WU="",OIt=x(t=>At.sanitizeText(t,Fe()),"sanitizeText"),$It=x(function(t,e=""){let r=A6.get(t);r||(r={id:t,styles:[],textStyles:[]},A6.set(t,r)),e!=null&&e.split(z6e).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(Yie).exec(n)){const s=i.replace(Xie,DIt).replace(Yie,Xie);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),PIt=x(function(t,e=""){const r=ac.get(t);e!=null&&(r.styles=e.split(z6e))},"addStyle2Node"),BIt=x(function(t,e){t.split(",").forEach(function(r){let n=ac.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},ac.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),V6e=x((t,e)=>{const r=t.flat(),n=[],i=r.find(s=>(s==null?void 0:s.type)==="column-setting"),a=(i==null?void 0:i.columns)??-1;for(const s of r){if(typeof a=="number"&&a>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>a&&le.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=OIt(s.label)),s.type==="classDef"){$It(s.id,s.css);continue}if(s.type==="applyClass"){BIt(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&PIt(s.id,s==null?void 0:s.stylesStr);continue}if(s.type==="column-setting")e.columns=s.columns??-1;else if(s.type==="edge"){const o=(tF.get(s.id)??0)+1;tF.set(s.id,o),s.id=o+"-"+s.id,GU.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=ac.get(s.id);if(o===void 0?ac.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&V6e(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u{le.debug("Clear called"),$n(),uC={id:"root",type:"composite",children:[],columns:-1},ac=new Map([["root",uC]]),HU=[],A6=new Map,GU=[],tF=new Map,WU=""},"clear");function G6e(t){switch(le.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return le.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}x(G6e,"typeStr2Type");function W6e(t){switch(le.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}x(W6e,"edgeTypeStr2Type");function H6e(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}x(H6e,"edgeStrToEdgeData");function q6e(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}x(q6e,"edgeStrToEdgeStartData");function U6e(t){return t.includes("==")?"thick":"normal"}x(U6e,"edgeStrToThickness");function Y6e(t){return t.includes(".-")?"dotted":"solid"}x(Y6e,"edgeStrToPattern");var jie=0,zIt=x(()=>(jie++,"id-"+Math.random().toString(36).substr(2,12)+"-"+jie),"generateId"),VIt=x(t=>{uC.children=t,V6e(t,uC),HU=uC.children},"setHierarchy"),GIt=x(t=>{const e=ac.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),WIt=x(()=>[...ac.values()],"getBlocksFlat"),HIt=x(()=>HU||[],"getBlocks"),qIt=x(()=>GU,"getEdges"),UIt=x(t=>ac.get(t),"getBlock"),YIt=x(t=>{ac.set(t.id,t)},"setBlock"),XIt=x(t=>{WU=t},"setDiagramId"),jIt=x(()=>WU,"getDiagramId"),KIt=x(()=>le,"getLogger"),ZIt=x(function(){return A6},"getClasses"),QIt={getConfig:x(()=>Xt().block,"getConfig"),typeStr2Type:G6e,edgeTypeStr2Type:W6e,edgeStrToEdgeData:H6e,edgeStrToEdgeStartData:q6e,edgeStrToThickness:U6e,edgeStrToPattern:Y6e,getLogger:KIt,getBlocksFlat:WIt,getBlocks:HIt,getEdges:qIt,setHierarchy:VIt,getBlock:UIt,setBlock:YIt,getColumns:GIt,getClasses:ZIt,clear:FIt,generateId:zIt,setDiagramId:XIt,getDiagramId:jIt},JIt=QIt,YN=x((t,e)=>{const r=wz,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return jl(n,i,a,e)},"fade"),e8t=x(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -3366,13 +3368,13 @@ Expecting `+J.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ge="Parse error o fill: ${t.textColor}; } ${CS()} -`,"getStyles"),QIt=ZIt,JIt=x((t,e,r,n)=>{e.forEach(i=>{c8t[i](t,r,n)})},"insertMarkers"),e8t=x((t,e,r)=>{le.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),t8t=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),r8t=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),n8t=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),i8t=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),a8t=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),s8t=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),o8t=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),l8t=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),c8t={extension:e8t,composition:t8t,aggregation:r8t,dependency:n8t,lollipop:i8t,point:a8t,circle:s8t,cross:o8t,barb:l8t},u8t=JIt;function rF(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}x(rF,"calculateBlockPosition");var h8t=x(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};if(le.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),n.type==="space")continue;const l=i/(n.widthInColumns??1);l>e&&(e=l),a>r&&(r=a)}return{width:e,height:r}},"getMaxChildSize");function _6(t,e,r=0,n=0,i=8){var o,l,u,h,d,f,p,g,m,y,v;le.debug("setBlockSizes abc95 (start)",t.id,(o=t==null?void 0:t.size)==null?void 0:o.x,"block width =",t==null?void 0:t.size,"siblingWidth",r),(l=t==null?void 0:t.size)!=null&&l.width||(t.size={width:r,height:n,x:0,y:0});let a=0,s=0;if(((u=t.children)==null?void 0:u.length)>0){for(const _ of t.children)_6(_,e,0,0,i);const T=h8t(t);a=T.width,s=T.height,le.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",a,s);for(const _ of t.children)_.size&&(le.debug(`abc95 Setting size of children of ${t.id} id=${_.id} ${a} ${s} ${JSON.stringify(_.size)}`),_.size.width=a*(_.widthInColumns??1)+i*((_.widthInColumns??1)-1),_.size.height=s,_.size.x=0,_.size.y=0,le.debug(`abc95 updating size of ${t.id} children child:${_.id} maxWidth:${a} maxHeight:${s}`));for(const _ of t.children)_6(_,e,a,s,i);const b=t.columns??-1;let w=0;for(const _ of t.children)w+=_.widthInColumns??1;let C=t.children.length;b>0&&b0?Math.min(t.children.length,b):t.children.length;if(_>0){const M=(k-_*i-i)/_;le.debug("abc95 (growing to fit) width",t.id,k,(p=t.size)==null?void 0:p.width,M);for(const L of t.children)L.size&&(L.size.width=M)}}t.size={width:k,height:E,x:0,y:0}}le.debug("setBlockSizes abc94 (done)",t.id,(g=t==null?void 0:t.size)==null?void 0:g.x,(m=t==null?void 0:t.size)==null?void 0:m.width,(y=t==null?void 0:t.size)==null?void 0:y.y,(v=t==null?void 0:t.size)==null?void 0:v.height)}x(_6,"setBlockSizes");function qU(t,e,r=8){var i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w;le.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(i=t==null?void 0:t.size)==null?void 0:i.x} y: ${(a=t==null?void 0:t.size)==null?void 0:a.y} width: ${(s=t==null?void 0:t.size)==null?void 0:s.width}`);const n=t.columns??-1;if(le.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const C=((l=(o=t==null?void 0:t.children[0])==null?void 0:o.size)==null?void 0:l.width)??0,S=t.children.length*C+(t.children.length-1)*r;le.debug("widthOfChildren 88",S,"posX");const k=new Map;{let P=0;for(const D of t.children){if(!D.size)continue;const{py:R}=rF(n,P),I=k.get(R)??0;D.size.height>I&&k.set(R,D.size.height);let $=(D==null?void 0:D.widthInColumns)??1;n>0&&($=Math.min($,n-P%n)),P+=$}}const E=new Map;{let P=0;const D=[...k.keys()].sort((R,I)=>R-I);for(const R of D)E.set(R,P),P+=(k.get(R)??0)+r}let _=0;le.debug("abc91 block?.size?.x",t.id,(u=t==null?void 0:t.size)==null?void 0:u.x);let M=(h=t==null?void 0:t.size)!=null&&h.x?((d=t==null?void 0:t.size)==null?void 0:d.x)+(-((f=t==null?void 0:t.size)==null?void 0:f.width)/2||0):-r,L=0;for(const P of t.children){const D=t;if(!P.size)continue;const{width:R,height:I}=P.size,{px:$,py:O}=rF(n,_);if(O!=L&&(L=O,M=(p=t==null?void 0:t.size)!=null&&p.x?((g=t==null?void 0:t.size)==null?void 0:g.x)+(-((m=t==null?void 0:t.size)==null?void 0:m.width)/2||0):-r,le.debug("New row in layout for block",t.id," and child ",P.id,L)),le.debug(`abc89 layout blocks (child) id: ${P.id} Pos: ${_} (px, py) ${$},${O} (${(y=D==null?void 0:D.size)==null?void 0:y.x},${(v=D==null?void 0:D.size)==null?void 0:v.y}) parent: ${D.id} width: ${R}${r}`),D.size){const F=R/2;P.size.x=M+r+F,le.debug(`abc91 layout blocks (calc) px, pyid:${P.id} startingPos=X${M} new startingPosX${P.size.x} ${F} padding=${r} width=${R} halfWidth=${F} => x:${P.size.x} y:${P.size.y} ${P.widthInColumns} (width * (child?.w || 1)) / 2 ${R*((P==null?void 0:P.widthInColumns)??1)/2}`),M=P.size.x+F;const z=E.get(O)??0,V=k.get(O)??I;P.size.y=D.size.y-D.size.height/2+z+V/2+r,le.debug(`abc88 layout blocks (calc) px, pyid:${P.id}startingPosX${M}${r}${F}=>x:${P.size.x}y:${P.size.y}${P.widthInColumns}(width * (child?.w || 1)) / 2${R*((P==null?void 0:P.widthInColumns)??1)/2}`)}P.children&&qU(P,e,r);let N=(P==null?void 0:P.widthInColumns)??1;n>0&&(N=Math.min(N,n-_%n)),_+=N,le.debug("abc88 columnsPos",P,_)}}le.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(T=t==null?void 0:t.size)==null?void 0:T.x} y: ${(b=t==null?void 0:t.size)==null?void 0:b.y} width: ${(w=t==null?void 0:t.size)==null?void 0:w.width}`)}x(qU,"layoutBlocks");function UU(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:a,y:s,width:o,height:l}=t.size;a-o/2n&&(n=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=UU(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}x(UU,"findBounds");function Y6e(t){var u,h;const e=t.getBlock("root");if(!e)return;const r=((h=(u=Fe())==null?void 0:u.block)==null?void 0:h.padding)??8;_6(e,t,0,0,r),qU(e,t,r),le.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:a,maxY:s}=UU(e),o=s-i,l=a-n;return{x:n,y:i,width:l,height:o}}x(Y6e,"layout");var d8t=x(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Fe(),o=xn(s);return await ws(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Yl=d8t,f8t=x((t,e,r,n,i)=>{e.arrowTypeStart&&jie(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&jie(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),p8t={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},jie=x((t,e,r,n,i,a)=>{const s=p8t[r];if(!s){le.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),nF={},cs={},g8t=x(async(t,e)=>{const r=Fe(),n=xn(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),s=e.labelType==="markdown",o=await ws(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:s,isNode:!1,markdown:s,width:s?void 0:Number.POSITIVE_INFINITY},r);a.node().appendChild(o);let l=o.getBBox(),u=l;if(n){const d=o.children[0],f=ut(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=ut(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",Pc(u,n)),nF[e.id]=i,e.width=l.width,e.height=l.height;let h;if(e.startLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Yl(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=ut(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Pc(g,n)),cs[e.id]||(cs[e.id]={}),cs[e.id].startLeft=d,xw(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Yl(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=ut(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Pc(g,n)),cs[e.id]||(cs[e.id]={}),cs[e.id].startRight=d,xw(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Yl(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=ut(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Pc(g,n)),cs[e.id]||(cs[e.id]={}),cs[e.id].endLeft=d,xw(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Yl(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=ut(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Pc(g,n)),cs[e.id]||(cs[e.id]={}),cs[e.id].endRight=d,xw(h,e.endLabelRight)}return o},"insertEdgeLabel");function xw(t,e){xn(Fe())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(xw,"setTerminalWidth");var m8t=x((t,e)=>{le.debug("Moving label abc88 ",t.id,t.label,nF[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Fe(),{subGraphTitleTotalMargin:i}=vx(n);if(t.label){const a=nF[t.id];let s=t.x,o=t.y;if(r){const l=yr.calcLabelPosition(r);le.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=cs[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=cs[t.id].startRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=cs[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=cs[t.id].endRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),y8t=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),v8t=x((t,e,r)=>{le.debug(`intersection calc abc89: +`,"getStyles"),t8t=e8t,r8t=x((t,e,r,n)=>{e.forEach(i=>{d8t[i](t,r,n)})},"insertMarkers"),n8t=x((t,e,r)=>{le.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),i8t=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),a8t=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),s8t=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),o8t=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),l8t=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),c8t=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),u8t=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),h8t=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),d8t={extension:n8t,composition:i8t,aggregation:a8t,dependency:s8t,lollipop:o8t,point:l8t,circle:c8t,cross:u8t,barb:h8t},f8t=r8t;function rF(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}x(rF,"calculateBlockPosition");var p8t=x(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};if(le.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),n.type==="space")continue;const l=i/(n.widthInColumns??1);l>e&&(e=l),a>r&&(r=a)}return{width:e,height:r}},"getMaxChildSize");function _6(t,e,r=0,n=0,i=8){var o,l,u,h,d,f,p,g,m,y,v;le.debug("setBlockSizes abc95 (start)",t.id,(o=t==null?void 0:t.size)==null?void 0:o.x,"block width =",t==null?void 0:t.size,"siblingWidth",r),(l=t==null?void 0:t.size)!=null&&l.width||(t.size={width:r,height:n,x:0,y:0});let a=0,s=0;if(((u=t.children)==null?void 0:u.length)>0){for(const _ of t.children)_6(_,e,0,0,i);const T=p8t(t);a=T.width,s=T.height,le.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",a,s);for(const _ of t.children)_.size&&(le.debug(`abc95 Setting size of children of ${t.id} id=${_.id} ${a} ${s} ${JSON.stringify(_.size)}`),_.size.width=a*(_.widthInColumns??1)+i*((_.widthInColumns??1)-1),_.size.height=s,_.size.x=0,_.size.y=0,le.debug(`abc95 updating size of ${t.id} children child:${_.id} maxWidth:${a} maxHeight:${s}`));for(const _ of t.children)_6(_,e,a,s,i);const b=t.columns??-1;let w=0;for(const _ of t.children)w+=_.widthInColumns??1;let C=t.children.length;b>0&&b0?Math.min(t.children.length,b):t.children.length;if(_>0){const M=(k-_*i-i)/_;le.debug("abc95 (growing to fit) width",t.id,k,(p=t.size)==null?void 0:p.width,M);for(const L of t.children)L.size&&(L.size.width=M)}}t.size={width:k,height:E,x:0,y:0}}le.debug("setBlockSizes abc94 (done)",t.id,(g=t==null?void 0:t.size)==null?void 0:g.x,(m=t==null?void 0:t.size)==null?void 0:m.width,(y=t==null?void 0:t.size)==null?void 0:y.y,(v=t==null?void 0:t.size)==null?void 0:v.height)}x(_6,"setBlockSizes");function qU(t,e,r=8){var i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w;le.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(i=t==null?void 0:t.size)==null?void 0:i.x} y: ${(a=t==null?void 0:t.size)==null?void 0:a.y} width: ${(s=t==null?void 0:t.size)==null?void 0:s.width}`);const n=t.columns??-1;if(le.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const C=((l=(o=t==null?void 0:t.children[0])==null?void 0:o.size)==null?void 0:l.width)??0,S=t.children.length*C+(t.children.length-1)*r;le.debug("widthOfChildren 88",S,"posX");const k=new Map;{let P=0;for(const D of t.children){if(!D.size)continue;const{py:R}=rF(n,P),I=k.get(R)??0;D.size.height>I&&k.set(R,D.size.height);let $=(D==null?void 0:D.widthInColumns)??1;n>0&&($=Math.min($,n-P%n)),P+=$}}const E=new Map;{let P=0;const D=[...k.keys()].sort((R,I)=>R-I);for(const R of D)E.set(R,P),P+=(k.get(R)??0)+r}let _=0;le.debug("abc91 block?.size?.x",t.id,(u=t==null?void 0:t.size)==null?void 0:u.x);let M=(h=t==null?void 0:t.size)!=null&&h.x?((d=t==null?void 0:t.size)==null?void 0:d.x)+(-((f=t==null?void 0:t.size)==null?void 0:f.width)/2||0):-r,L=0;for(const P of t.children){const D=t;if(!P.size)continue;const{width:R,height:I}=P.size,{px:$,py:O}=rF(n,_);if(O!=L&&(L=O,M=(p=t==null?void 0:t.size)!=null&&p.x?((g=t==null?void 0:t.size)==null?void 0:g.x)+(-((m=t==null?void 0:t.size)==null?void 0:m.width)/2||0):-r,le.debug("New row in layout for block",t.id," and child ",P.id,L)),le.debug(`abc89 layout blocks (child) id: ${P.id} Pos: ${_} (px, py) ${$},${O} (${(y=D==null?void 0:D.size)==null?void 0:y.x},${(v=D==null?void 0:D.size)==null?void 0:v.y}) parent: ${D.id} width: ${R}${r}`),D.size){const F=R/2;P.size.x=M+r+F,le.debug(`abc91 layout blocks (calc) px, pyid:${P.id} startingPos=X${M} new startingPosX${P.size.x} ${F} padding=${r} width=${R} halfWidth=${F} => x:${P.size.x} y:${P.size.y} ${P.widthInColumns} (width * (child?.w || 1)) / 2 ${R*((P==null?void 0:P.widthInColumns)??1)/2}`),M=P.size.x+F;const z=E.get(O)??0,V=k.get(O)??I;P.size.y=D.size.y-D.size.height/2+z+V/2+r,le.debug(`abc88 layout blocks (calc) px, pyid:${P.id}startingPosX${M}${r}${F}=>x:${P.size.x}y:${P.size.y}${P.widthInColumns}(width * (child?.w || 1)) / 2${R*((P==null?void 0:P.widthInColumns)??1)/2}`)}P.children&&qU(P,e,r);let N=(P==null?void 0:P.widthInColumns)??1;n>0&&(N=Math.min(N,n-_%n)),_+=N,le.debug("abc88 columnsPos",P,_)}}le.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(T=t==null?void 0:t.size)==null?void 0:T.x} y: ${(b=t==null?void 0:t.size)==null?void 0:b.y} width: ${(w=t==null?void 0:t.size)==null?void 0:w.width}`)}x(qU,"layoutBlocks");function UU(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:a,y:s,width:o,height:l}=t.size;a-o/2n&&(n=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=UU(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}x(UU,"findBounds");function X6e(t){var u,h;const e=t.getBlock("root");if(!e)return;const r=((h=(u=Fe())==null?void 0:u.block)==null?void 0:h.padding)??8;_6(e,t,0,0,r),qU(e,t,r),le.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:a,maxY:s}=UU(e),o=s-i,l=a-n;return{x:n,y:i,width:l,height:o}}x(X6e,"layout");var g8t=x(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Fe(),o=xn(s);return await ws(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Yl=g8t,m8t=x((t,e,r,n,i)=>{e.arrowTypeStart&&Kie(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&Kie(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),y8t={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Kie=x((t,e,r,n,i,a)=>{const s=y8t[r];if(!s){le.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),nF={},cs={},v8t=x(async(t,e)=>{const r=Fe(),n=xn(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),s=e.labelType==="markdown",o=await ws(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:s,isNode:!1,markdown:s,width:s?void 0:Number.POSITIVE_INFINITY},r);a.node().appendChild(o);let l=o.getBBox(),u=l;if(n){const d=o.children[0],f=ut(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=ut(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",Pc(u,n)),nF[e.id]=i,e.width=l.width,e.height=l.height;let h;if(e.startLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Yl(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=ut(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Pc(g,n)),cs[e.id]||(cs[e.id]={}),cs[e.id].startLeft=d,xw(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Yl(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=ut(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Pc(g,n)),cs[e.id]||(cs[e.id]={}),cs[e.id].startRight=d,xw(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Yl(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=ut(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Pc(g,n)),cs[e.id]||(cs[e.id]={}),cs[e.id].endLeft=d,xw(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Yl(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=ut(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Pc(g,n)),cs[e.id]||(cs[e.id]={}),cs[e.id].endRight=d,xw(h,e.endLabelRight)}return o},"insertEdgeLabel");function xw(t,e){xn(Fe())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(xw,"setTerminalWidth");var b8t=x((t,e)=>{le.debug("Moving label abc88 ",t.id,t.label,nF[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Fe(),{subGraphTitleTotalMargin:i}=vx(n);if(t.label){const a=nF[t.id];let s=t.x,o=t.y;if(r){const l=yr.calcLabelPosition(r);le.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=cs[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=cs[t.id].startRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=cs[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=cs[t.id].endRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),x8t=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),T8t=x((t,e,r)=>{le.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(e)} insidePoint : ${JSON.stringify(r)} - node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{le.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!y8t(e,a)&&!i){const s=v8t(e,n,a);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)||r.push(s),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),b8t=x(function(t,e,r,n,i,a,s){let o=r.points;le.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=a.node(e.v);var h=a.node(e.w);h!=null&&h.intersect&&(u!=null&&u.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(le.debug("to cluster abc88",n[r.toCluster]),o=Kie(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(le.debug("from cluster abc88",n[r.fromCluster]),o=Kie(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(w=>!Number.isNaN(w.y));let f=DC;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=Fpe(r),m=NC().x(p).y(g).curve(f);let y;switch(r.thickness){case"normal":y="edge-thickness-normal";break;case"thick":y="edge-thickness-thick";break;case"invisible":y="edge-thickness-thick";break;default:y=""}switch(r.pattern){case"solid":y+=" edge-pattern-solid";break;case"dotted":y+=" edge-pattern-dotted";break;case"dashed":y+=" edge-pattern-dashed";break}const v=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+y+(r.classes?" "+r.classes:"")).attr("style",r.style);let T="";(Fe().flowchart.arrowMarkerAbsolute||Fe().state.arrowMarkerAbsolute)&&(T=J6(!0)),f8t(v,r,T,s,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b},"insertEdge"),x8t=x(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),T8t=x((t,e,r,n)=>{const i=x8t(t),a=2,s=e.height+2*r.padding,o=s/a,l=n??e.width+2*o+r.padding,u=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:l/2,y:2*u},{x:l-o,y:0},{x:l,y:0},{x:l,y:-s/3},{x:l+2*u,y:-s/2},{x:l,y:-2*s/3},{x:l,y:-s},{x:l-o,y:-s},{x:l/2,y:-s-2*u},{x:o,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*u,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:o,y:0},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:o,y:-s},{x:0,y:-s/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:o,y:-s},{x:l-o,y:-s},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-o},{x:l,y:-s+o},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-o},{x:0,y:-s+o},{x:l,y:-s}]:i.has("right")&&i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-o},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-o},{x:l,y:-s}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-s}]:i.has("right")?[{x:o,y:-u},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s+u}]:i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function X6e(t,e){return t.intersect(e)}x(X6e,"intersectNode");var w8t=X6e;function j6e(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}x(iF,"sameSign");var k8t=Q6e,S8t=J6e;function J6e(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){s=Math.min(s,g.x),o=Math.min(o,g.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-s,u=i-t.height/2-o,h=0;h1&&a.sort(function(g,m){var y=g.x-r.x,v=g.y-r.y,T=Math.sqrt(y*y+v*v),b=m.x-r.x,w=m.y-r.y,C=Math.sqrt(b*b+w*w);return T{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),A8t=E8t,hi={node:w8t,circle:C8t,ellipse:K6e,polygon:S8t,rect:A8t},Na=x(async(t,e,r,n)=>{const i=Fe();let a;const s=e.useHtmlLabels||xn(i);r?a=r:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];let h;e.labelType==="markdown"?h=ws(l,Wr(vh(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await Yl(l,Wr(vh(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(xn(i)){const p=h.children[0],g=ut(h);await fV(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return s?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:l}},"labelHelper"),Ri=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function pc(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x(pc,"insertPolygonShape");var _8t=x(async(t,e)=>{e.useHtmlLabels||xn(Fe())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await Na(t,e,"node "+e.classes,!0);le.info("Classes = ",e.classes);const s=n.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),Ri(e,s),e.intersect=function(o){return hi.rect(e,o)},n},"note"),R8t=_8t,Zie=x(t=>t?" "+t:"","formatClass"),Ko=x((t,e)=>`${e||"node default"}${Zie(t.classes)} ${Zie(t.class)}`,"getClassesFromNode"),Qie=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=i+a,o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];le.info("Question main (Circle)");const l=pc(r,s,s,o);return l.attr("style",e.style),Ri(e,l),e.intersect=function(u){return le.warn("Intersect called"),hi.polygon(e,o,u)},r},"question"),L8t=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return hi.circle(e,14,s)},r},"choice"),M8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=4,a=e.positioned?e.height:n.height+e.padding,s=a/i,o=e.positioned?e.width:n.width+2*s+e.padding,l=[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],u=pc(r,o,a,l);return u.attr("style",e.style),Ri(e,u),e.intersect=function(h){return hi.polygon(e,l,h)},r},"hexagon"),I8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,void 0,!0),i=2,a=n.height+2*e.padding,s=a/i,o=n.width+2*s+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>o?e.width:o,h=T8t(e.directions,n,e,u),d=pc(r,u,a,h);return d.attr("style",e.style),Ri(e,d),e.intersect=function(f){return hi.polygon(e,h,f)},r},"block_arrow"),N8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return pc(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return hi.polygon(e,s,l)},r},"rect_left_inv_arrow"),D8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"lean_right"),O8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"lean_left"),$8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"trapezoid"),P8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"inv_trapezoid"),B8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"rect_right_inv_arrow"),F8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=i/2,s=a/(2.5+i/50),o=n.height+s+e.padding,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+i+" 0 a "+a+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,u=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return Ri(e,u),e.intersect=function(h){const d=hi.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)e.height/2-s)){let p=s*s*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),z8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Na(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(G7(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{le.warn(`Unknown node property ${d}`)})}return Ri(e,a),e.intersect=function(h){return hi.rect(e,h)},r},"rect"),V8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Na(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(G7(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{le.warn(`Unknown node property ${d}`)})}return Ri(e,a),e.intersect=function(h){return hi.rect(e,h)},r},"composite"),G8t=x(async(t,e)=>{const{shapeSvg:r}=await Na(t,e,"label",!0);le.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,a=0;if(n.attr("width",i).attr("height",a),r.attr("class","label edgeLabel"),e.props){const s=new Set(Object.keys(e.props));e.props.borders&&(G7(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{le.warn(`Unknown node property ${o}`)})}return Ri(e,n),e.intersect=function(s){return hi.rect(e,s)},r},"labelRect");function G7(t,e,r,n){const i=[],a=x(o=>{i.push(o,0)},"addBorder"),s=x(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(le.debug("add top border"),a(r)):s(r),e.includes("r")?(le.debug("add right border"),a(n)):s(n),e.includes("b")?(le.debug("add bottom border"),a(r)):s(r),e.includes("l")?(le.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}x(G7,"applyNodePropertyBorders");var W8t=x(async(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof o=="object"?l=o[0]:l=o,le.info("Label text abc79",l,o,typeof o=="object");const u=await Yl(s,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(xn(Fe())){const m=u.children[0],y=ut(u);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}le.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await Yl(s,d.join?d.join("
"):d,e.labelStyle,!0,!0);if(xn(Fe())){const m=p.children[0],y=ut(p);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}const g=e.padding/2;return ut(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),ut(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return Ri(e,s),e.intersect=function(o){return hi.rect(e,o)},r},"stadium"),q8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Na(t,e,Ko(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),le.info("Circle main"),Ri(e,a),e.intersect=function(s){return le.info("Circle intersect",e,n.width/2+i,s),hi.circle(e,n.width/2+i,s)},r},"circle"),U8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Na(t,e,Ko(e,void 0),!0),a=5,s=r.insert("g",":first-child"),o=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+a).attr("width",n.width+e.padding+a*2).attr("height",n.height+e.padding+a*2),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),le.info("DoubleCircle main"),Ri(e,o),e.intersect=function(u){return le.info("DoubleCircle intersect",e,n.width/2+i+a,u),hi.circle(e,n.width/2+i+a,u)},r},"doublecircle"),Y8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"subroutine"),X8t=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),Ri(e,n),e.intersect=function(i){return hi.circle(e,7,i)},r},"start"),Jie=x((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;r==="LR"&&(i=10,a=70);const s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return Ri(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return hi.rect(e,o)},n},"forkJoin"),j8t=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),Ri(e,i),e.intersect=function(a){return hi.circle(e,7,a)},r},"end"),K8t=x(async(t,e)=>{var E;const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),o=s.insert("rect",":first-child"),l=s.insert("line"),u=s.insert("line");let h=0,d=n;const f=s.insert("g").attr("class","label");let p=0;const g=(E=e.classData.annotations)==null?void 0:E[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",y=await Yl(f,m,e.labelStyle,!0,!0);let v=y.getBBox();if(xn(Fe())){const _=y.children[0],M=ut(y);v=_.getBoundingClientRect(),M.attr("width",v.width),M.attr("height",v.height)}e.classData.annotations[0]&&(d+=v.height+n,h+=v.width);let T=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(xn(Fe())?T+="<"+e.classData.type+">":T+="<"+e.classData.type+">");const b=await Yl(f,T,e.labelStyle,!0,!0);ut(b).attr("class","classTitle");let w=b.getBBox();if(xn(Fe())){const _=b.children[0],M=ut(b);w=_.getBoundingClientRect(),M.attr("width",w.width),M.attr("height",w.height)}d+=w.height+n,w.width>h&&(h=w.width);const C=[];e.classData.members.forEach(async _=>{const M=_.getDisplayDetails();let L=M.displayText;xn(Fe())&&(L=L.replace(//g,">"));const P=await Yl(f,L,M.cssStyle?M.cssStyle:e.labelStyle,!0,!0);let D=P.getBBox();if(xn(Fe())){const R=P.children[0],I=ut(P);D=R.getBoundingClientRect(),I.attr("width",D.width),I.attr("height",D.height)}D.width>h&&(h=D.width),d+=D.height+n,C.push(P)}),d+=i;const S=[];if(e.classData.methods.forEach(async _=>{const M=_.getDisplayDetails();let L=M.displayText;xn(Fe())&&(L=L.replace(//g,">"));const P=await Yl(f,L,M.cssStyle?M.cssStyle:e.labelStyle,!0,!0);let D=P.getBBox();if(xn(Fe())){const R=P.children[0],I=ut(P);D=R.getBoundingClientRect(),I.attr("width",D.width),I.attr("height",D.height)}D.width>h&&(h=D.width),d+=D.height+n,S.push(P)}),d+=i,g){let _=(h-v.width)/2;ut(y).attr("transform","translate( "+(-1*h/2+_)+", "+-1*d/2+")"),p=v.height+n}let k=(h-w.width)/2;return ut(b).attr("transform","translate( "+(-1*h/2+k)+", "+(-1*d/2+p)+")"),p+=w.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,C.forEach(_=>{ut(_).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const M=_==null?void 0:_.getBBox();p+=((M==null?void 0:M.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,S.forEach(_=>{ut(_).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const M=_==null?void 0:_.getBBox();p+=((M==null?void 0:M.height)??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),Ri(e,o),e.intersect=function(_){return hi.rect(e,_)},s},"class_box"),eae={rhombus:Qie,composite:V8t,question:Qie,rect:z8t,labelRect:G8t,rectWithTitle:W8t,choice:L8t,circle:q8t,doublecircle:U8t,stadium:H8t,hexagon:M8t,block_arrow:I8t,rect_left_inv_arrow:N8t,lean_right:D8t,lean_left:O8t,trapezoid:$8t,inv_trapezoid:P8t,rect_right_inv_arrow:B8t,cylinder:F8t,start:X8t,end:j8t,note:R8t,subroutine:Y8t,fork:Jie,join:Jie,class_box:K8t},e5={},eRe=x(async(t,e,r)=>{let n,i;if(e.link){let a;Fe().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await eae[e.shape](n,e,r)}else i=await eae[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),e5[e.id]=n,e.haveCallback&&e5[e.id].attr("class",e5[e.id].attr("class")+" clickable"),n},"insertNode"),Z8t=x(t=>{const e=e5[t.id];le.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function YU(t,e,r=!1){var p,g,m;const n=t;let i="default";(((p=n==null?void 0:n.classes)==null?void 0:p.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",o;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",o=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}const l=hV((n==null?void 0:n.styles)??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0},d=e.getDiagramId();return{labelStyle:l.labelStyle,shape:s,labelText:u,rx:a,ry:a,class:i,style:l.style,id:n.id,domId:d?`${d}-${n.id}`:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:o??((m=(g=Xt())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}x(YU,"getNodeFromBlock");async function tRe(t,e,r){const n=YU(e,r,!1);if(n.type==="group")return;const i=Xt(),a=await eRe(t,n,{config:i}),s=a.node().getBBox(),o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}x(tRe,"calculateBlockSize");async function rRe(t,e,r){const n=YU(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=Xt();await eRe(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,Z8t(n)}}x(rRe,"insertBlockPositioned");async function W7(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await W7(t,i.children,r,n)}x(W7,"performOperations");async function nRe(t,e,r){await W7(t,e,r,tRe)}x(nRe,"calculateBlockSizes");async function iRe(t,e,r){await W7(t,e,r,rRe)}x(iRe,"insertBlocks");async function aRe(t,e,r,n,i){const a=new ms({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const o=n.getBlock(s.start),l=n.getBlock(s.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],f=i?`${i}-${s.id}`:s.id,p=s.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=s.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;b8t(t,{v:s.start,w:s.end,name:f},{...s,id:f,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m},void 0,"block",a,i),s.label&&(await g8t(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m}),m8t({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}x(aRe,"insertEdges");var Q8t=x(function(t,e){return e.db.getClasses()},"getClasses"),J8t=x(async function(t,e,r,n){const{securityLevel:i,block:a}=Xt(),s=n.db;s.setDiagramId(e);let o;i==="sandbox"&&(o=ut("#i"+e));const l=ut(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):ut(`[id="${e}"]`);u8t(u,["point","circle","cross"],n.type,e);const d=s.getBlocks(),f=s.getBlocksFlat(),p=s.getEdges(),g=u.insert("g").attr("class","block");await nRe(g,d,s);const m=Y6e(s);if(await iRe(g,d,s),await aRe(g,p,f,s,e),m){const y=m,v=Math.max(1,Math.round(.125*(y.width/y.height))),T=y.height+v+10,b=y.width+10,{useMaxWidth:w}=a;Ai(u,T,b,!!w),le.debug("Here Bounds",m,y),u.attr("viewBox",`${y.x-5} ${y.y-5} ${y.width+10} ${y.height+10}`)}},"draw"),eNt={draw:J8t,getClasses:Q8t},tNt={parser:LIt,db:KIt,renderer:eNt,styles:QIt};const rNt=Object.freeze(Object.defineProperty({__proto__:null,diagram:tNt},Symbol.toStringTag,{value:"Module"}));var sRe=/[─━│┃└┗├┣]/,oRe=/[└┗├┣]/,nNt=/[─━]/,tae=/^[\s│┃]+$/,rae=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,nae=/^\s*%%/,iNt=" ";function lRe(t){return t.some(e=>sRe.test(e))}x(lRe,"isBoxDrawingFormat");function cRe(t){for(const e of t){const r=oRe.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}x(cRe,"inferSegmentWidth");function uRe(t,e){return t.replace(/\bline\s+(\d+)\b/gi,(r,n)=>{const i=parseInt(n,10),a=e.get(i);return a?`line ${a}`:r})}x(uRe,"remapErrorLines");function hRe(t){const e=t.split(` -`),r=new Map;let n=-1;for(const[l,u]of e.entries())if(u.trim()==="treeView-beta"){n=l;break}if(n===-1)return{text:t,lineMap:r};const i=[];for(let l=n+1;l({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),aNt=x(()=>{Dc.reset(),On()},"clear"),sNt=x(()=>Dc.records.stack[0],"getRoot"),oNt=x(()=>Dc.records.cnt,"getCount"),lNt=Vr.treeView,cNt=x(()=>ri(lNt,Xt().treeView),"getConfig"),uNt=x((t,e,r,n,i,a)=>{for(;t<=Dc.records.stack[Dc.records.stack.length-1].level;)Dc.records.stack.pop();const s={id:Dc.records.cnt++,level:t,name:e,nodeType:r,icon:i,cssClass:n,description:a,children:[]};Dc.records.stack[Dc.records.stack.length-1].children.push(s),Dc.records.stack.push(s)},"addNode"),hNt={clear:aNt,addNode:uNt,getRoot:sNt,getCount:oNt,getConfig:cNt,getAccTitle:ni,getAccDescription:ai,getDiagramTitle:Yn,setAccDescription:ii,setAccTitle:Hn,setDiagramTitle:ti},aF=hNt,dNt=x(t=>{eo(t,aF);for(const e of t.nodes){const r=typeof e.indent=="number"?e.indent:0;let n=e.name;const i=n.endsWith("/");i&&(n=n.slice(0,-1));const a=i?"directory":"file",s=e.classAnnotation||void 0,o=e.iconAnnotation,l=o!==void 0?o||"none":void 0,u=e.descAnnotation||void 0,h=u?Wr(u,Xt()):void 0;aF.addNode(r,n,a,s,l,h)}},"populate"),fNt={parse:x(async t=>{const{text:e,lineMap:r}=hRe(t);try{const n=await Al("treeView",e);le.debug(n),dNt(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=uRe(n.message,r)),n}},"parse")},Dk={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function dRe(t,e){var i;const r=(i=e==null?void 0:e.filenameIcons)==null?void 0:i[t];if(r)return r;const n=t.lastIndexOf(".");if(n>0){const a=t.substring(n).toLowerCase(),s=e==null?void 0:e.extensionIcons;return(s==null?void 0:s[a])??(s==null?void 0:s[a.slice(1)])}}x(dRe,"detectIcon");function sF(t,e){return t.includes(":")?t:t in Dk.icons||!e?`${Dk.prefix}:${t}`:`${e}:${t}`}x(sF,"qualifyIcon");function XU(t,e){if(t.icon!=="none"){if(t.icon)return sF(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=dRe(t.name,e);if(r==="none")return;if(r)return sF(r,e.defaultIconPack)}return`${Dk.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}x(XU,"getNodeIcon");pV([{name:Dk.prefix,icons:Dk}]);var oF=14,pNt=4,gNt=16,fRe=x((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),mNt=x(async(t,e,r,n)=>{const i=new Set,a=x(l=>{const u=XU(l,r);u&&i.add(u),l.children.forEach(a)},"collect");if(a(e),i.size===0)return;const s=await Promise.all([...i].map(async l=>({icon:l,svg:await bh(l,{height:oF,width:oF})}))),o=t.append("defs");for(const{icon:l,svg:u}of s)o.append("g").attr("id",fRe(n,l)).html(u)},"injectIconDefs"),yNt=x((t,e,r,n,i,a)=>{var T;const s=n.append("g");let o="treeView-node-label";r.nodeType==="directory"&&(o+=" treeView-node-dir"),r.cssClass&&(o+=` ${r.cssClass}`);const l=oF+pNt,u=XU(r,i),h=u!==void 0;u&&s.append("use").attr("xlink:href",`#${fRe(a,u)}`).attr("x",t+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const d=s.append("text").text(r.name).attr("dominant-baseline","middle").attr("class",o),{height:f,width:p}=d.node().getBBox(),g=f+i.paddingY*2,m=t+i.paddingX+(h?l:0);d.attr("x",m),d.attr("y",e+g/2);const y=m+p,v=p+i.paddingX*2+(h?l:0);return r.BBox={x:t,y:e,width:v,height:g},(T=r.cssClass)!=null&&T.split(/\s+/).includes("highlight")&&s.insert("rect",":first-child").attr("x",t).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:r,nodeGroup:s,labelRightEdge:y,centerY:e+g/2}},"positionLabel"),iae=x((t,e,r,n,i,a)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),vNt=x((t,e,r,n)=>{var h;let i=0,a=0;const s=[],o=x((d,f,p,g)=>{const m=g*(p.rowIndent+p.paddingX),y=yNt(m,i,f,d,p,n);s.push(y);const{height:v,width:T}=f.BBox;iae(d,m-p.rowIndent,i+v/2,m,i+v/2,p.lineThickness),a=Math.max(a,m+T),i+=v},"drawNode"),l=x((d,f=0)=>{o(t,d,r,f),d.children.forEach(y=>{l(y,f+1)});const{x:p,y:g,height:m}=d.BBox;if(d.children.length){const{y,height:v}=d.children[d.children.length-1].BBox;iae(t,p+r.paddingX,g+m,p+r.paddingX,y+v/2+r.lineThickness/2,r.lineThickness)}},"processNode");l(e);const u=s.filter(d=>d.node.description);if(u.length>0){const f=Math.max(...s.map(p=>p.labelRightEdge))+gNt;for(const p of u){const m=p.nodeGroup.append("text").text(p.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",p.centerY).node().getBBox();a=Math.max(a,f+m.width+r.paddingX)}}for(const d of s)if((h=d.node.cssClass)!=null&&h.split(/\s+/).includes("highlight")){const f=d.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){const p=a-d.node.BBox.x+8;f.attr("width",p),a=Math.max(a,d.node.BBox.x+p+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),bNt=x(async(t,e,r,n)=>{le.debug(`Rendering treeView diagram -`+t);const i=n.db,a=i.getRoot(),s=i.getConfig(),o=xs(e);await mNt(o,a,s,e);const l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=vNt(l,a,s,e);o.attr("viewBox",`-${s.lineThickness/2} 0 ${h} ${u}`),Ai(o,u,h,s.useMaxWidth)},"draw"),xNt={draw:bNt},TNt=xNt,wNt={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},CNt=x(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:a,highlightBg:s,highlightStroke:o}=ri(wNt,t);return` + node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{le.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!x8t(e,a)&&!i){const s=T8t(e,n,a);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)||r.push(s),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),w8t=x(function(t,e,r,n,i,a,s){let o=r.points;le.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=a.node(e.v);var h=a.node(e.w);h!=null&&h.intersect&&(u!=null&&u.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(le.debug("to cluster abc88",n[r.toCluster]),o=Zie(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(le.debug("from cluster abc88",n[r.fromCluster]),o=Zie(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(w=>!Number.isNaN(w.y));let f=DC;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=zpe(r),m=NC().x(p).y(g).curve(f);let y;switch(r.thickness){case"normal":y="edge-thickness-normal";break;case"thick":y="edge-thickness-thick";break;case"invisible":y="edge-thickness-thick";break;default:y=""}switch(r.pattern){case"solid":y+=" edge-pattern-solid";break;case"dotted":y+=" edge-pattern-dotted";break;case"dashed":y+=" edge-pattern-dashed";break}const v=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+y+(r.classes?" "+r.classes:"")).attr("style",r.style);let T="";(Fe().flowchart.arrowMarkerAbsolute||Fe().state.arrowMarkerAbsolute)&&(T=J6(!0)),m8t(v,r,T,s,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b},"insertEdge"),C8t=x(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),k8t=x((t,e,r,n)=>{const i=C8t(t),a=2,s=e.height+2*r.padding,o=s/a,l=n??e.width+2*o+r.padding,u=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:l/2,y:2*u},{x:l-o,y:0},{x:l,y:0},{x:l,y:-s/3},{x:l+2*u,y:-s/2},{x:l,y:-2*s/3},{x:l,y:-s},{x:l-o,y:-s},{x:l/2,y:-s-2*u},{x:o,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*u,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:o,y:0},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:o,y:-s},{x:0,y:-s/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:o,y:-s},{x:l-o,y:-s},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-o},{x:l,y:-s+o},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-o},{x:0,y:-s+o},{x:l,y:-s}]:i.has("right")&&i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-o},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-o},{x:l,y:-s}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-s}]:i.has("right")?[{x:o,y:-u},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s+u}]:i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function j6e(t,e){return t.intersect(e)}x(j6e,"intersectNode");var S8t=j6e;function K6e(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}x(iF,"sameSign");var A8t=J6e,_8t=eRe;function eRe(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){s=Math.min(s,g.x),o=Math.min(o,g.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-s,u=i-t.height/2-o,h=0;h1&&a.sort(function(g,m){var y=g.x-r.x,v=g.y-r.y,T=Math.sqrt(y*y+v*v),b=m.x-r.x,w=m.y-r.y,C=Math.sqrt(b*b+w*w);return T{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),L8t=R8t,hi={node:S8t,circle:E8t,ellipse:Z6e,polygon:_8t,rect:L8t},Na=x(async(t,e,r,n)=>{const i=Fe();let a;const s=e.useHtmlLabels||xn(i);r?a=r:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];let h;e.labelType==="markdown"?h=ws(l,Wr(vh(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await Yl(l,Wr(vh(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(xn(i)){const p=h.children[0],g=ut(h);await fV(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return s?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:l}},"labelHelper"),Ri=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function pc(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x(pc,"insertPolygonShape");var M8t=x(async(t,e)=>{e.useHtmlLabels||xn(Fe())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await Na(t,e,"node "+e.classes,!0);le.info("Classes = ",e.classes);const s=n.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),Ri(e,s),e.intersect=function(o){return hi.rect(e,o)},n},"note"),I8t=M8t,Qie=x(t=>t?" "+t:"","formatClass"),Ko=x((t,e)=>`${e||"node default"}${Qie(t.classes)} ${Qie(t.class)}`,"getClassesFromNode"),Jie=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=i+a,o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];le.info("Question main (Circle)");const l=pc(r,s,s,o);return l.attr("style",e.style),Ri(e,l),e.intersect=function(u){return le.warn("Intersect called"),hi.polygon(e,o,u)},r},"question"),N8t=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return hi.circle(e,14,s)},r},"choice"),D8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=4,a=e.positioned?e.height:n.height+e.padding,s=a/i,o=e.positioned?e.width:n.width+2*s+e.padding,l=[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],u=pc(r,o,a,l);return u.attr("style",e.style),Ri(e,u),e.intersect=function(h){return hi.polygon(e,l,h)},r},"hexagon"),O8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,void 0,!0),i=2,a=n.height+2*e.padding,s=a/i,o=n.width+2*s+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>o?e.width:o,h=k8t(e.directions,n,e,u),d=pc(r,u,a,h);return d.attr("style",e.style),Ri(e,d),e.intersect=function(f){return hi.polygon(e,h,f)},r},"block_arrow"),$8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return pc(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return hi.polygon(e,s,l)},r},"rect_left_inv_arrow"),P8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"lean_right"),B8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"lean_left"),F8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"trapezoid"),z8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"inv_trapezoid"),V8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"rect_right_inv_arrow"),G8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=i/2,s=a/(2.5+i/50),o=n.height+s+e.padding,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+i+" 0 a "+a+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,u=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return Ri(e,u),e.intersect=function(h){const d=hi.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)e.height/2-s)){let p=s*s*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),W8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Na(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(G7(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{le.warn(`Unknown node property ${d}`)})}return Ri(e,a),e.intersect=function(h){return hi.rect(e,h)},r},"rect"),H8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Na(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(G7(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{le.warn(`Unknown node property ${d}`)})}return Ri(e,a),e.intersect=function(h){return hi.rect(e,h)},r},"composite"),q8t=x(async(t,e)=>{const{shapeSvg:r}=await Na(t,e,"label",!0);le.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,a=0;if(n.attr("width",i).attr("height",a),r.attr("class","label edgeLabel"),e.props){const s=new Set(Object.keys(e.props));e.props.borders&&(G7(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{le.warn(`Unknown node property ${o}`)})}return Ri(e,n),e.intersect=function(s){return hi.rect(e,s)},r},"labelRect");function G7(t,e,r,n){const i=[],a=x(o=>{i.push(o,0)},"addBorder"),s=x(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(le.debug("add top border"),a(r)):s(r),e.includes("r")?(le.debug("add right border"),a(n)):s(n),e.includes("b")?(le.debug("add bottom border"),a(r)):s(r),e.includes("l")?(le.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}x(G7,"applyNodePropertyBorders");var U8t=x(async(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof o=="object"?l=o[0]:l=o,le.info("Label text abc79",l,o,typeof o=="object");const u=await Yl(s,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(xn(Fe())){const m=u.children[0],y=ut(u);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}le.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await Yl(s,d.join?d.join("
"):d,e.labelStyle,!0,!0);if(xn(Fe())){const m=p.children[0],y=ut(p);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}const g=e.padding/2;return ut(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),ut(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return Ri(e,s),e.intersect=function(o){return hi.rect(e,o)},r},"stadium"),X8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Na(t,e,Ko(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),le.info("Circle main"),Ri(e,a),e.intersect=function(s){return le.info("Circle intersect",e,n.width/2+i,s),hi.circle(e,n.width/2+i,s)},r},"circle"),j8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Na(t,e,Ko(e,void 0),!0),a=5,s=r.insert("g",":first-child"),o=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+a).attr("width",n.width+e.padding+a*2).attr("height",n.height+e.padding+a*2),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),le.info("DoubleCircle main"),Ri(e,o),e.intersect=function(u){return le.info("DoubleCircle intersect",e,n.width/2+i+a,u),hi.circle(e,n.width/2+i+a,u)},r},"doublecircle"),K8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"subroutine"),Z8t=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),Ri(e,n),e.intersect=function(i){return hi.circle(e,7,i)},r},"start"),eae=x((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;r==="LR"&&(i=10,a=70);const s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return Ri(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return hi.rect(e,o)},n},"forkJoin"),Q8t=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),Ri(e,i),e.intersect=function(a){return hi.circle(e,7,a)},r},"end"),J8t=x(async(t,e)=>{var E;const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),o=s.insert("rect",":first-child"),l=s.insert("line"),u=s.insert("line");let h=0,d=n;const f=s.insert("g").attr("class","label");let p=0;const g=(E=e.classData.annotations)==null?void 0:E[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",y=await Yl(f,m,e.labelStyle,!0,!0);let v=y.getBBox();if(xn(Fe())){const _=y.children[0],M=ut(y);v=_.getBoundingClientRect(),M.attr("width",v.width),M.attr("height",v.height)}e.classData.annotations[0]&&(d+=v.height+n,h+=v.width);let T=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(xn(Fe())?T+="<"+e.classData.type+">":T+="<"+e.classData.type+">");const b=await Yl(f,T,e.labelStyle,!0,!0);ut(b).attr("class","classTitle");let w=b.getBBox();if(xn(Fe())){const _=b.children[0],M=ut(b);w=_.getBoundingClientRect(),M.attr("width",w.width),M.attr("height",w.height)}d+=w.height+n,w.width>h&&(h=w.width);const C=[];e.classData.members.forEach(async _=>{const M=_.getDisplayDetails();let L=M.displayText;xn(Fe())&&(L=L.replace(//g,">"));const P=await Yl(f,L,M.cssStyle?M.cssStyle:e.labelStyle,!0,!0);let D=P.getBBox();if(xn(Fe())){const R=P.children[0],I=ut(P);D=R.getBoundingClientRect(),I.attr("width",D.width),I.attr("height",D.height)}D.width>h&&(h=D.width),d+=D.height+n,C.push(P)}),d+=i;const S=[];if(e.classData.methods.forEach(async _=>{const M=_.getDisplayDetails();let L=M.displayText;xn(Fe())&&(L=L.replace(//g,">"));const P=await Yl(f,L,M.cssStyle?M.cssStyle:e.labelStyle,!0,!0);let D=P.getBBox();if(xn(Fe())){const R=P.children[0],I=ut(P);D=R.getBoundingClientRect(),I.attr("width",D.width),I.attr("height",D.height)}D.width>h&&(h=D.width),d+=D.height+n,S.push(P)}),d+=i,g){let _=(h-v.width)/2;ut(y).attr("transform","translate( "+(-1*h/2+_)+", "+-1*d/2+")"),p=v.height+n}let k=(h-w.width)/2;return ut(b).attr("transform","translate( "+(-1*h/2+k)+", "+(-1*d/2+p)+")"),p+=w.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,C.forEach(_=>{ut(_).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const M=_==null?void 0:_.getBBox();p+=((M==null?void 0:M.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,S.forEach(_=>{ut(_).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const M=_==null?void 0:_.getBBox();p+=((M==null?void 0:M.height)??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),Ri(e,o),e.intersect=function(_){return hi.rect(e,_)},s},"class_box"),tae={rhombus:Jie,composite:H8t,question:Jie,rect:W8t,labelRect:q8t,rectWithTitle:U8t,choice:N8t,circle:X8t,doublecircle:j8t,stadium:Y8t,hexagon:D8t,block_arrow:O8t,rect_left_inv_arrow:$8t,lean_right:P8t,lean_left:B8t,trapezoid:F8t,inv_trapezoid:z8t,rect_right_inv_arrow:V8t,cylinder:G8t,start:Z8t,end:Q8t,note:I8t,subroutine:K8t,fork:eae,join:eae,class_box:J8t},e5={},tRe=x(async(t,e,r)=>{let n,i;if(e.link){let a;Fe().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await tae[e.shape](n,e,r)}else i=await tae[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),e5[e.id]=n,e.haveCallback&&e5[e.id].attr("class",e5[e.id].attr("class")+" clickable"),n},"insertNode"),eNt=x(t=>{const e=e5[t.id];le.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function YU(t,e,r=!1){var p,g,m;const n=t;let i="default";(((p=n==null?void 0:n.classes)==null?void 0:p.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",o;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",o=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}const l=hV((n==null?void 0:n.styles)??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0},d=e.getDiagramId();return{labelStyle:l.labelStyle,shape:s,labelText:u,rx:a,ry:a,class:i,style:l.style,id:n.id,domId:d?`${d}-${n.id}`:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:o??((m=(g=Xt())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}x(YU,"getNodeFromBlock");async function rRe(t,e,r){const n=YU(e,r,!1);if(n.type==="group")return;const i=Xt(),a=await tRe(t,n,{config:i}),s=a.node().getBBox(),o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}x(rRe,"calculateBlockSize");async function nRe(t,e,r){const n=YU(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=Xt();await tRe(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,eNt(n)}}x(nRe,"insertBlockPositioned");async function W7(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await W7(t,i.children,r,n)}x(W7,"performOperations");async function iRe(t,e,r){await W7(t,e,r,rRe)}x(iRe,"calculateBlockSizes");async function aRe(t,e,r){await W7(t,e,r,nRe)}x(aRe,"insertBlocks");async function sRe(t,e,r,n,i){const a=new ms({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const o=n.getBlock(s.start),l=n.getBlock(s.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],f=i?`${i}-${s.id}`:s.id,p=s.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=s.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;w8t(t,{v:s.start,w:s.end,name:f},{...s,id:f,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m},void 0,"block",a,i),s.label&&(await v8t(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m}),b8t({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}x(sRe,"insertEdges");var tNt=x(function(t,e){return e.db.getClasses()},"getClasses"),rNt=x(async function(t,e,r,n){const{securityLevel:i,block:a}=Xt(),s=n.db;s.setDiagramId(e);let o;i==="sandbox"&&(o=ut("#i"+e));const l=ut(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):ut(`[id="${e}"]`);f8t(u,["point","circle","cross"],n.type,e);const d=s.getBlocks(),f=s.getBlocksFlat(),p=s.getEdges(),g=u.insert("g").attr("class","block");await iRe(g,d,s);const m=X6e(s);if(await aRe(g,d,s),await sRe(g,p,f,s,e),m){const y=m,v=Math.max(1,Math.round(.125*(y.width/y.height))),T=y.height+v+10,b=y.width+10,{useMaxWidth:w}=a;Ai(u,T,b,!!w),le.debug("Here Bounds",m,y),u.attr("viewBox",`${y.x-5} ${y.y-5} ${y.width+10} ${y.height+10}`)}},"draw"),nNt={draw:rNt,getClasses:tNt},iNt={parser:NIt,db:JIt,renderer:nNt,styles:t8t};const aNt=Object.freeze(Object.defineProperty({__proto__:null,diagram:iNt},Symbol.toStringTag,{value:"Module"}));var oRe=/[─━│┃└┗├┣]/,lRe=/[└┗├┣]/,sNt=/[─━]/,rae=/^[\s│┃]+$/,nae=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,iae=/^\s*%%/,oNt=" ";function cRe(t){return t.some(e=>oRe.test(e))}x(cRe,"isBoxDrawingFormat");function uRe(t){for(const e of t){const r=lRe.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}x(uRe,"inferSegmentWidth");function hRe(t,e){return t.replace(/\bline\s+(\d+)\b/gi,(r,n)=>{const i=parseInt(n,10),a=e.get(i);return a?`line ${a}`:r})}x(hRe,"remapErrorLines");function dRe(t){const e=t.split(` +`),r=new Map;let n=-1;for(const[l,u]of e.entries())if(u.trim()==="treeView-beta"){n=l;break}if(n===-1)return{text:t,lineMap:r};const i=[];for(let l=n+1;l({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),lNt=x(()=>{Dc.reset(),$n()},"clear"),cNt=x(()=>Dc.records.stack[0],"getRoot"),uNt=x(()=>Dc.records.cnt,"getCount"),hNt=Vr.treeView,dNt=x(()=>ri(hNt,Xt().treeView),"getConfig"),fNt=x((t,e,r,n,i,a)=>{for(;t<=Dc.records.stack[Dc.records.stack.length-1].level;)Dc.records.stack.pop();const s={id:Dc.records.cnt++,level:t,name:e,nodeType:r,icon:i,cssClass:n,description:a,children:[]};Dc.records.stack[Dc.records.stack.length-1].children.push(s),Dc.records.stack.push(s)},"addNode"),pNt={clear:lNt,addNode:fNt,getRoot:cNt,getCount:uNt,getConfig:dNt,getAccTitle:ni,getAccDescription:ai,getDiagramTitle:Yn,setAccDescription:ii,setAccTitle:Hn,setDiagramTitle:ti},aF=pNt,gNt=x(t=>{eo(t,aF);for(const e of t.nodes){const r=typeof e.indent=="number"?e.indent:0;let n=e.name;const i=n.endsWith("/");i&&(n=n.slice(0,-1));const a=i?"directory":"file",s=e.classAnnotation||void 0,o=e.iconAnnotation,l=o!==void 0?o||"none":void 0,u=e.descAnnotation||void 0,h=u?Wr(u,Xt()):void 0;aF.addNode(r,n,a,s,l,h)}},"populate"),mNt={parse:x(async t=>{const{text:e,lineMap:r}=dRe(t);try{const n=await Al("treeView",e);le.debug(n),gNt(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=hRe(n.message,r)),n}},"parse")},Dk={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function fRe(t,e){var i;const r=(i=e==null?void 0:e.filenameIcons)==null?void 0:i[t];if(r)return r;const n=t.lastIndexOf(".");if(n>0){const a=t.substring(n).toLowerCase(),s=e==null?void 0:e.extensionIcons;return(s==null?void 0:s[a])??(s==null?void 0:s[a.slice(1)])}}x(fRe,"detectIcon");function sF(t,e){return t.includes(":")?t:t in Dk.icons||!e?`${Dk.prefix}:${t}`:`${e}:${t}`}x(sF,"qualifyIcon");function XU(t,e){if(t.icon!=="none"){if(t.icon)return sF(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=fRe(t.name,e);if(r==="none")return;if(r)return sF(r,e.defaultIconPack)}return`${Dk.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}x(XU,"getNodeIcon");pV([{name:Dk.prefix,icons:Dk}]);var oF=14,yNt=4,vNt=16,pRe=x((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),bNt=x(async(t,e,r,n)=>{const i=new Set,a=x(l=>{const u=XU(l,r);u&&i.add(u),l.children.forEach(a)},"collect");if(a(e),i.size===0)return;const s=await Promise.all([...i].map(async l=>({icon:l,svg:await bh(l,{height:oF,width:oF})}))),o=t.append("defs");for(const{icon:l,svg:u}of s)o.append("g").attr("id",pRe(n,l)).html(u)},"injectIconDefs"),xNt=x((t,e,r,n,i,a)=>{var T;const s=n.append("g");let o="treeView-node-label";r.nodeType==="directory"&&(o+=" treeView-node-dir"),r.cssClass&&(o+=` ${r.cssClass}`);const l=oF+yNt,u=XU(r,i),h=u!==void 0;u&&s.append("use").attr("xlink:href",`#${pRe(a,u)}`).attr("x",t+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const d=s.append("text").text(r.name).attr("dominant-baseline","middle").attr("class",o),{height:f,width:p}=d.node().getBBox(),g=f+i.paddingY*2,m=t+i.paddingX+(h?l:0);d.attr("x",m),d.attr("y",e+g/2);const y=m+p,v=p+i.paddingX*2+(h?l:0);return r.BBox={x:t,y:e,width:v,height:g},(T=r.cssClass)!=null&&T.split(/\s+/).includes("highlight")&&s.insert("rect",":first-child").attr("x",t).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:r,nodeGroup:s,labelRightEdge:y,centerY:e+g/2}},"positionLabel"),aae=x((t,e,r,n,i,a)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),TNt=x((t,e,r,n)=>{var h;let i=0,a=0;const s=[],o=x((d,f,p,g)=>{const m=g*(p.rowIndent+p.paddingX),y=xNt(m,i,f,d,p,n);s.push(y);const{height:v,width:T}=f.BBox;aae(d,m-p.rowIndent,i+v/2,m,i+v/2,p.lineThickness),a=Math.max(a,m+T),i+=v},"drawNode"),l=x((d,f=0)=>{o(t,d,r,f),d.children.forEach(y=>{l(y,f+1)});const{x:p,y:g,height:m}=d.BBox;if(d.children.length){const{y,height:v}=d.children[d.children.length-1].BBox;aae(t,p+r.paddingX,g+m,p+r.paddingX,y+v/2+r.lineThickness/2,r.lineThickness)}},"processNode");l(e);const u=s.filter(d=>d.node.description);if(u.length>0){const f=Math.max(...s.map(p=>p.labelRightEdge))+vNt;for(const p of u){const m=p.nodeGroup.append("text").text(p.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",p.centerY).node().getBBox();a=Math.max(a,f+m.width+r.paddingX)}}for(const d of s)if((h=d.node.cssClass)!=null&&h.split(/\s+/).includes("highlight")){const f=d.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){const p=a-d.node.BBox.x+8;f.attr("width",p),a=Math.max(a,d.node.BBox.x+p+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),wNt=x(async(t,e,r,n)=>{le.debug(`Rendering treeView diagram +`+t);const i=n.db,a=i.getRoot(),s=i.getConfig(),o=xs(e);await bNt(o,a,s,e);const l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=TNt(l,a,s,e);o.attr("viewBox",`-${s.lineThickness/2} 0 ${h} ${u}`),Ai(o,u,h,s.useMaxWidth)},"draw"),CNt={draw:wNt},kNt=CNt,SNt={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},ENt=x(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:a,highlightBg:s,highlightStroke:o}=ri(SNt,t);return` .treeView-node-label { font-size: ${e}; fill: ${r}; @@ -3398,7 +3400,7 @@ Expecting `+J.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ge="Parse error o stroke: ${o}; stroke-width: 1; } - `},"styles"),kNt=CNt,SNt={db:aF,renderer:TNt,parser:fNt,styles:kNt};const ENt=Object.freeze(Object.defineProperty({__proto__:null,diagram:SNt},Symbol.toStringTag,{value:"Module"}));var t5={exports:{}},r5={exports:{}},n5={exports:{}},ANt=n5.exports,aae;function _Nt(){return aae||(aae=1,(function(t,e){(function(n,i){t.exports=i()})(ANt,function(){return(function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=28)})([(function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a}),(function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l}),(function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,y){m==null&&y==null&&(y=g),a.call(this,y),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(y.target==p){if(y.source!=m)throw"Incorrect edge source!";g.push(y)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(!(y.source==m||y.target==m))throw"Incorrect edge source and/or target";(y.target==p||y.source==p)&&g.push(y)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var y=this.child.getNodes(),v=0;vg?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,T){a.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,T){if(v==null&&T==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(v.owner==T.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=T.owner?null:(w.source=v,w.target=T,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),T!=v&&T.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=v.edges.slice(),b,w=T.length,C=0;C-1&&E>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(k,1),b.target!=b.source&&b.target.edges.splice(E,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,T,b,w,C=this.getNodes(),S=C.length,k=0;kT&&(y=T),v>b&&(v=b)}return y==s.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?w=C[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,C,S,k,E,_,M=this.nodes,L=M.length,P=0;PC&&(v=C),Tk&&(b=k),wC&&(v=C),Tk&&(b=k),w=this.nodes.length){var L=0;T.forEach(function(P){P.owner==y&&L++}),L==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=M,!1;if(df)return u[0]=g,u[1]=d,u[2]=E,u[3]=p,!1;if(hf?(u[0]=v,u[1]=T,R=!0):(u[0]=y,u[1]=m,R=!0):$===N&&(h>f?(u[0]=g,u[1]=m,R=!0):(u[0]=b,u[1]=T,R=!0)),-O===N?f>h?(u[2]=_,u[3]=M,I=!0):(u[2]=E,u[3]=k,I=!0):O===N&&(f>h?(u[2]=S,u[3]=k,I=!0):(u[2]=L,u[3]=M,I=!0)),R&&I)return!1;if(h>f?d>p?(F=this.getCardinalDirection($,N,4),z=this.getCardinalDirection(O,N,2)):(F=this.getCardinalDirection(-$,N,3),z=this.getCardinalDirection(-O,N,1)):d>p?(F=this.getCardinalDirection(-$,N,1),z=this.getCardinalDirection(-O,N,3)):(F=this.getCardinalDirection($,N,2),z=this.getCardinalDirection(O,N,4)),!R)switch(F){case 1:B=m,V=h+-C/N,u[0]=V,u[1]=B;break;case 2:V=b,B=d+w*N,u[0]=V,u[1]=B;break;case 3:B=T,V=h+C/N,u[0]=V,u[1]=B;break;case 4:V=v,B=d+-w*N,u[0]=V,u[1]=B;break}if(!I)switch(z){case 1:H=k,G=f+-D/N,u[2]=G,u[3]=H;break;case 2:G=L,H=p+P*N,u[2]=G,u[3]=H;break;case 3:H=M,G=f+D/N,u[2]=G,u[3]=H;break;case 4:G=_,H=p+-P*N,u[2]=G,u[3]=H;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,b=void 0,w=void 0,C=void 0,S=void 0,k=void 0,E=void 0,_=void 0,M=void 0,L=void 0;return C=g-f,k=d-p,_=p*f-d*g,S=T-y,E=m-v,M=v*y-m*T,L=C*E-S*k,L===0?null:(b=(k*M-E*_)/L,w=(S*_-C*M)/L,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var T=(-m+Math.sqrt(m*m-4*g*y))/(2*g),b=(-m-Math.sqrt(m*m-4*g*y))/(2*g),w=null;return T>=0&&T<=1?[T]:b>=0&&b<=1?[b]:w}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s}),(function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(C.push(k[0]);C.length>0&&y;){var E=C[0];C.splice(0,1),w.add(E);for(var _=E.getEdges(),b=0;b<_.length;b++){var M=_[b].getOtherEnd(E);if(S.get(E)!=M)if(!w.has(M))C.push(M),S.set(M,E);else{y=!1;break}}}if(!y)m=[];else{var L=[].concat(a(w));m.push(L);for(var b=0;b-1&&k.splice(D,1)}w=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,T=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var T=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(M,1);var L=S.getNeighborsList();L.forEach(function(R){if(v.indexOf(R)<0){var I=T.get(R),$=I-1;$==1&&E.push(R),T.set(R,$)}})}v=v.concat(E),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,T,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mC||w>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*T)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>C||w>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||C>=b[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){function a(){}a.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=(function(vt){for(var ot=[];vt-- >0;)ot.push(0);return ot})(Math.min(this.m+1,this.n)),this.U=(function(vt){var ot=function pe(Ct){if(Ct.length==0)return 0;for(var lt=[],st=0;st0;)ot.push(0);return ot})(this.n),u=(function(vt){for(var ot=[];vt-- >0;)ot.push(0);return ot})(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;O--)if(this.s[O]!==0){for(var N=O+1;N=0;q--){if((function(vt,ot){return vt&&ot})(q0;){var ee=void 0,Re=void 0;for(ee=R-2;ee>=-1&&ee!==-1;ee--)if(Math.abs(l[ee])<=ge+J*(Math.abs(this.s[ee])+Math.abs(this.s[ee+1]))){l[ee]=0;break}if(ee===R-2)Re=4;else{var Ie=void 0;for(Ie=R-1;Ie>=ee&&Ie!==ee;Ie--){var Be=(Ie!==R?Math.abs(l[Ie]):0)+(Ie!==ee+1?Math.abs(l[Ie-1]):0);if(Math.abs(this.s[Ie])<=ge+J*Be){this.s[Ie]=0;break}}Ie===ee?Re=3:Ie===R-1?Re=1:(Re=2,ee=Ie)}switch(ee++,Re){case 1:{var ce=l[R-2];l[R-2]=0;for(var oe=R-2;oe>=ee;oe--){var be=a.hypot(this.s[oe],ce),fe=this.s[oe]/be,Pe=ce/be;this.s[oe]=be,oe!==ee&&(ce=-Pe*l[oe-1],l[oe-1]=fe*l[oe-1]);for(var ve=0;ve=this.s[ee+1]);){var pt=this.s[ee];if(this.s[ee]=this.s[ee+1],this.s[ee+1]=pt,eeMath.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=a}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u{var n={45:((o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h}),806:((o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d}),767:((o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),880:((o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),578:((o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),765:((o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),y=u(902),v=u(551).FDLayoutConstants,T=u(551).LayoutConstants,b=u(551).Point,w=u(551).PointD,C=u(551).DimensionD,S=u(551).Layout,k=u(551).Integer,E=u(551).IGeometry,_=u(551).LGraph,M=u(551).Transform,L=u(551).LinkedList;function P(){h.call(this),this.toBeTiled={},this.constraints={}}P.prototype=Object.create(h.prototype);for(var D in h)P[D]=h[D];P.prototype.newGraphManager=function(){var R=new d(this);return this.graphManager=R,R},P.prototype.newGraph=function(R){return new f(null,this.graphManager,R)},P.prototype.newNode=function(R){return new p(this.graphManager,R)},P.prototype.newEdge=function(R){return new g(null,null,R)},P.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=v.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=v.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},P.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/v.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},P.prototype.layout=function(){var R=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return R&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},P.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),$=this.nodesWithGravity.filter(function(F){return I.has(F)});this.graphManager.setAllNodesToApplyGravitation($)}}else{var R=this.getFlatForest();if(R.length>0)this.positionNodesRadially(R);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),$=this.nodesWithGravity.filter(function(O){return I.has(O)});this.graphManager.setAllNodesToApplyGravitation($),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(y.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},P.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%v.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),I=this.nodesWithGravity.filter(function(N){return R.has(N)});this.graphManager.setAllNodesToApplyGravitation(I),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var $=!this.isTreeGrowing&&!this.isGrowthFinished,O=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces($,O),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},P.prototype.getPositionsData=function(){for(var R=this.graphManager.getAllNodes(),I={},$=0;$0&&this.updateDisplacements();for(var $=0;$0&&(O.fixedNodeWeight=F)}}if(this.constraints.relativePlacementConstraint){var z=new Map,V=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(K){R.fixedNodesOnHorizontal.add(K),R.fixedNodesOnVertical.add(K)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var B=this.constraints.alignmentConstraint.vertical,$=0;$=2*K.length/3;J--)Q=Math.floor(Math.random()*(J+1)),te=K[J],K[J]=K[Q],K[Q]=te;return K},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(K){if(K.left){var Q=z.has(K.left)?z.get(K.left):K.left,te=z.has(K.right)?z.get(K.right):K.right;R.nodesInRelativeHorizontal.includes(Q)||(R.nodesInRelativeHorizontal.push(Q),R.nodeToRelativeConstraintMapHorizontal.set(Q,[]),R.dummyToNodeForVerticalAlignment.has(Q)?R.nodeToTempPositionMapHorizontal.set(Q,R.idToNodeMap.get(R.dummyToNodeForVerticalAlignment.get(Q)[0]).getCenterX()):R.nodeToTempPositionMapHorizontal.set(Q,R.idToNodeMap.get(Q).getCenterX())),R.nodesInRelativeHorizontal.includes(te)||(R.nodesInRelativeHorizontal.push(te),R.nodeToRelativeConstraintMapHorizontal.set(te,[]),R.dummyToNodeForVerticalAlignment.has(te)?R.nodeToTempPositionMapHorizontal.set(te,R.idToNodeMap.get(R.dummyToNodeForVerticalAlignment.get(te)[0]).getCenterX()):R.nodeToTempPositionMapHorizontal.set(te,R.idToNodeMap.get(te).getCenterX())),R.nodeToRelativeConstraintMapHorizontal.get(Q).push({right:te,gap:K.gap}),R.nodeToRelativeConstraintMapHorizontal.get(te).push({left:Q,gap:K.gap})}else{var J=V.has(K.top)?V.get(K.top):K.top,ge=V.has(K.bottom)?V.get(K.bottom):K.bottom;R.nodesInRelativeVertical.includes(J)||(R.nodesInRelativeVertical.push(J),R.nodeToRelativeConstraintMapVertical.set(J,[]),R.dummyToNodeForHorizontalAlignment.has(J)?R.nodeToTempPositionMapVertical.set(J,R.idToNodeMap.get(R.dummyToNodeForHorizontalAlignment.get(J)[0]).getCenterY()):R.nodeToTempPositionMapVertical.set(J,R.idToNodeMap.get(J).getCenterY())),R.nodesInRelativeVertical.includes(ge)||(R.nodesInRelativeVertical.push(ge),R.nodeToRelativeConstraintMapVertical.set(ge,[]),R.dummyToNodeForHorizontalAlignment.has(ge)?R.nodeToTempPositionMapVertical.set(ge,R.idToNodeMap.get(R.dummyToNodeForHorizontalAlignment.get(ge)[0]).getCenterY()):R.nodeToTempPositionMapVertical.set(ge,R.idToNodeMap.get(ge).getCenterY())),R.nodeToRelativeConstraintMapVertical.get(J).push({bottom:ge,gap:K.gap}),R.nodeToRelativeConstraintMapVertical.get(ge).push({top:J,gap:K.gap})}});else{var H=new Map,q=new Map;this.constraints.relativePlacementConstraint.forEach(function(K){if(K.left){var Q=z.has(K.left)?z.get(K.left):K.left,te=z.has(K.right)?z.get(K.right):K.right;H.has(Q)?H.get(Q).push(te):H.set(Q,[te]),H.has(te)?H.get(te).push(Q):H.set(te,[Q])}else{var J=V.has(K.top)?V.get(K.top):K.top,ge=V.has(K.bottom)?V.get(K.bottom):K.bottom;q.has(J)?q.get(J).push(ge):q.set(J,[ge]),q.has(ge)?q.get(ge).push(J):q.set(ge,[J])}});var Z=function(Q,te){var J=[],ge=[],ee=new L,Re=new Set,Ie=0;return Q.forEach(function(Be,ce){if(!Re.has(ce)){J[Ie]=[],ge[Ie]=!1;var oe=ce;for(ee.push(oe),Re.add(oe),J[Ie].push(oe);ee.length!=0;){oe=ee.shift(),te.has(oe)&&(ge[Ie]=!0);var be=Q.get(oe);be.forEach(function(fe){Re.has(fe)||(ee.push(fe),Re.add(fe),J[Ie].push(fe))})}Ie++}}),{components:J,isFixed:ge}},Y=Z(H,R.fixedNodesOnHorizontal);this.componentsOnHorizontal=Y.components,this.fixedComponentsOnHorizontal=Y.isFixed;var ie=Z(q,R.fixedNodesOnVertical);this.componentsOnVertical=ie.components,this.fixedComponentsOnVertical=ie.isFixed}}},P.prototype.updateDisplacements=function(){var R=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(ie){var K=R.idToNodeMap.get(ie.nodeId);K.displacementX=0,K.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var I=this.constraints.alignmentConstraint.vertical,$=0;$1){var V;for(V=0;VO&&(O=Math.floor(z.y)),F=Math.floor(z.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(T.WORLD_CENTER_X-z.x/2,T.WORLD_CENTER_Y-z.y/2))},P.radialLayout=function(R,I,$){var O=Math.max(this.maxDiagonalInTree(R),m.DEFAULT_RADIAL_SEPARATION);P.branchRadialLayout(I,null,0,359,0,O);var N=_.calculateBounds(R),F=new M;F.setDeviceOrgX(N.getMinX()),F.setDeviceOrgY(N.getMinY()),F.setWorldOrgX($.x),F.setWorldOrgY($.y);for(var z=0;z1;){var te=Q[0];Q.splice(0,1);var J=q.indexOf(te);J>=0&&q.splice(J,1),ie--,Z--}I!=null?K=(q.indexOf(Q[0])+1)%ie:K=0;for(var ge=Math.abs(O-$)/Z,ee=K;Y!=Z;ee=++ee%ie){var Re=q[ee].getOtherEnd(R);if(Re!=I){var Ie=($+Y*ge)%360,Be=(Ie+ge)%360;P.branchRadialLayout(Re,R,Ie,Be,N+F,F),Y++}}},P.maxDiagonalInTree=function(R){for(var I=k.MIN_VALUE,$=0;$I&&(I=N)}return I},P.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},P.prototype.groupZeroDegreeMembers=function(){var R=this,I={};this.memberGroups={},this.idToDummyNode={};for(var $=[],O=this.graphManager.getAllNodes(),N=0;N"u"&&(I[V]=[]),I[V]=I[V].concat(F)}Object.keys(I).forEach(function(B){if(I[B].length>1){var G="DummyCompound_"+B;R.memberGroups[G]=I[B];var H=I[B][0].getParent(),q=new p(R.graphManager);q.id=G,q.paddingLeft=H.paddingLeft||0,q.paddingRight=H.paddingRight||0,q.paddingBottom=H.paddingBottom||0,q.paddingTop=H.paddingTop||0,R.idToDummyNode[G]=q;var Z=R.getGraphManager().add(R.newGraph(),q),Y=H.getChild();Y.add(q);for(var ie=0;ieN?(O.rect.x-=(O.labelWidth-N)/2,O.setWidth(O.labelWidth),O.labelMarginLeft=(O.labelWidth-N)/2):O.labelPosHorizontal=="right"&&O.setWidth(N+O.labelWidth)),O.labelHeight&&(O.labelPosVertical=="top"?(O.rect.y-=O.labelHeight,O.setHeight(F+O.labelHeight),O.labelMarginTop=O.labelHeight):O.labelPosVertical=="center"&&O.labelHeight>F?(O.rect.y-=(O.labelHeight-F)/2,O.setHeight(O.labelHeight),O.labelMarginTop=(O.labelHeight-F)/2):O.labelPosVertical=="bottom"&&O.setHeight(F+O.labelHeight))}})},P.prototype.repopulateCompounds=function(){for(var R=this.compoundOrder.length-1;R>=0;R--){var I=this.compoundOrder[R],$=I.id,O=I.paddingLeft,N=I.paddingTop,F=I.labelMarginLeft,z=I.labelMarginTop;this.adjustLocations(this.tiledMemberPack[$],I.rect.x,I.rect.y,O,N,F,z)}},P.prototype.repopulateZeroDegreeMembers=function(){var R=this,I=this.tiledZeroDegreePack;Object.keys(I).forEach(function($){var O=R.idToDummyNode[$],N=O.paddingLeft,F=O.paddingTop,z=O.labelMarginLeft,V=O.labelMarginTop;R.adjustLocations(I[$],O.rect.x,O.rect.y,N,F,z,V)})},P.prototype.getToBeTiled=function(R){var I=R.id;if(this.toBeTiled[I]!=null)return this.toBeTiled[I];var $=R.getChild();if($==null)return this.toBeTiled[I]=!1,!1;for(var O=$.getNodes(),N=0;N0)return this.toBeTiled[I]=!1,!1;if(F.getChild()==null){this.toBeTiled[F.id]=!1;continue}if(!this.getToBeTiled(F))return this.toBeTiled[I]=!1,!1}return this.toBeTiled[I]=!0,!0},P.prototype.getNodeDegree=function(R){R.id;for(var I=R.getEdges(),$=0,O=0;OH&&(H=Z.rect.height)}$+=H+R.verticalPadding}},P.prototype.tileCompoundMembers=function(R,I){var $=this;this.tiledMemberPack=[],Object.keys(R).forEach(function(O){var N=I[O];if($.tiledMemberPack[O]=$.tileNodes(R[O],N.paddingLeft+N.paddingRight),N.rect.width=$.tiledMemberPack[O].width,N.rect.height=$.tiledMemberPack[O].height,N.setCenter($.tiledMemberPack[O].centerX,$.tiledMemberPack[O].centerY),N.labelMarginLeft=0,N.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var F=N.rect.width,z=N.rect.height;N.labelWidth&&(N.labelPosHorizontal=="left"?(N.rect.x-=N.labelWidth,N.setWidth(F+N.labelWidth),N.labelMarginLeft=N.labelWidth):N.labelPosHorizontal=="center"&&N.labelWidth>F?(N.rect.x-=(N.labelWidth-F)/2,N.setWidth(N.labelWidth),N.labelMarginLeft=(N.labelWidth-F)/2):N.labelPosHorizontal=="right"&&N.setWidth(F+N.labelWidth)),N.labelHeight&&(N.labelPosVertical=="top"?(N.rect.y-=N.labelHeight,N.setHeight(z+N.labelHeight),N.labelMarginTop=N.labelHeight):N.labelPosVertical=="center"&&N.labelHeight>z?(N.rect.y-=(N.labelHeight-z)/2,N.setHeight(N.labelHeight),N.labelMarginTop=(N.labelHeight-z)/2):N.labelPosVertical=="bottom"&&N.setHeight(z+N.labelHeight))}})},P.prototype.tileNodes=function(R,I){var $=this.tileNodesByFavoringDim(R,I,!0),O=this.tileNodesByFavoringDim(R,I,!1),N=this.getOrgRatio($),F=this.getOrgRatio(O),z;return FV&&(V=ie.getWidth())});var B=F/N,G=z/N,H=Math.pow($-O,2)+4*(B+O)*(G+$)*N,q=(O-$+Math.sqrt(H))/(2*(B+O)),Z;I?(Z=Math.ceil(q),Z==q&&Z++):Z=Math.floor(q);var Y=Z*(B+O)-O;return V>Y&&(Y=V),Y+=O*2,Y},P.prototype.tileNodesByFavoringDim=function(R,I,$){var O=m.TILING_PADDING_VERTICAL,N=m.TILING_PADDING_HORIZONTAL,F=m.TILING_COMPARE_BY,z={rows:[],rowWidth:[],rowHeight:[],width:0,height:I,verticalPadding:O,horizontalPadding:N,centerX:0,centerY:0};F&&(z.idealRowWidth=this.calcIdealRowWidth(R,$));var V=function(K){return K.rect.width*K.rect.height},B=function(K,Q){return V(Q)-V(K)};R.sort(function(ie,K){var Q=B;return z.idealRowWidth?(Q=F,Q(ie.id,K.id)):Q(ie,K)});for(var G=0,H=0,q=0;q0&&(z+=R.horizontalPadding),R.rowWidth[$]=z,R.width0&&(V+=R.verticalPadding);var B=0;V>R.rowHeight[$]&&(B=R.rowHeight[$],R.rowHeight[$]=V,B=R.rowHeight[$]-B),R.height+=B,R.rows[$].push(I)},P.prototype.getShortestRowIndex=function(R){for(var I=-1,$=Number.MAX_VALUE,O=0;O$&&(I=O,$=R.rowWidth[O]);return I},P.prototype.canAddHorizontal=function(R,I,$){if(R.idealRowWidth){var O=R.rows.length-1,N=R.rowWidth[O];return N+I+R.horizontalPadding<=R.idealRowWidth}var F=this.getShortestRowIndex(R);if(F<0)return!0;var z=R.rowWidth[F];if(z+R.horizontalPadding+I<=R.width)return!0;var V=0;R.rowHeight[F]<$&&F>0&&(V=$+R.verticalPadding-R.rowHeight[F]);var B;R.width-z>=I+R.horizontalPadding?B=(R.height+V)/(z+I+R.horizontalPadding):B=(R.height+V)/R.width,V=$+R.verticalPadding;var G;return R.widthF&&I!=$){O.splice(-1,1),R.rows[$].push(N),R.rowWidth[I]=R.rowWidth[I]-F,R.rowWidth[$]=R.rowWidth[$]+F,R.width=R.rowWidth[instance.getLongestRowIndex(R)];for(var z=Number.MIN_VALUE,V=0;Vz&&(z=O[V].height);I>0&&(z+=R.verticalPadding);var B=R.rowHeight[I]+R.rowHeight[$];R.rowHeight[I]=z,R.rowHeight[$]0)for(var Y=N;Y<=F;Y++)Z[0]+=this.grid[Y][z-1].length+this.grid[Y][z].length-1;if(F0)for(var Y=z;Y<=V;Y++)Z[3]+=this.grid[N-1][Y].length+this.grid[N][Y].length-1;for(var ie=k.MAX_VALUE,K,Q,te=0;te{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,y,v){h.call(this,g,m,y,v)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var y=this.getChild().getNodes(),v,T=0;T{function h(y){if(Array.isArray(y)){for(var v=0,T=Array(y.length);v0){var pt=0;Ee.forEach(function(rt){ue=="horizontal"?($e.set(rt,b.has(rt)?w[b.get(rt)]:Oe.get(rt)),pt+=$e.get(rt)):($e.set(rt,b.has(rt)?C[b.get(rt)]:Oe.get(rt)),pt+=$e.get(rt))}),pt=pt/Ee.length,at.forEach(function(rt){X.has(rt)||$e.set(rt,pt)})}else{var ht=0;at.forEach(function(rt){ue=="horizontal"?ht+=b.has(rt)?w[b.get(rt)]:Oe.get(rt):ht+=b.has(rt)?C[b.get(rt)]:Oe.get(rt)}),ht=ht/at.length,at.forEach(function(rt){$e.set(rt,ht)})}});for(var De=function(){var Ee=He.shift(),pt=j.get(Ee);pt.forEach(function(ht){if($e.get(ht.id)<$e.get(Ee)+ht.gap)if(X&&X.has(ht.id)){var rt=void 0;if(ue=="horizontal"?rt=b.has(ht.id)?w[b.get(ht.id)]:Oe.get(ht.id):rt=b.has(ht.id)?C[b.get(ht.id)]:Oe.get(ht.id),$e.set(ht.id,rt),rt<$e.get(Ee)+ht.gap){var Et=$e.get(Ee)+ht.gap-rt;Me.get(Ee).forEach(function(vt){$e.set(vt,$e.get(vt)-Et)})}}else $e.set(ht.id,$e.get(Ee)+ht.gap);_e.set(ht.id,_e.get(ht.id)-1),_e.get(ht.id)==0&&He.push(ht.id),X&&Me.set(ht.id,Ge(Me.get(Ee),Me.get(ht.id)))})};He.length!=0;)De();if(X){var Ke=new Set;j.forEach(function(at,Ee){at.length==0&&Ke.add(Ee)});var Ae=[];Me.forEach(function(at,Ee){if(Ke.has(Ee)){var pt=!1,ht=!0,rt=!1,Et=void 0;try{for(var vt=at[Symbol.iterator](),ot;!(ht=(ot=vt.next()).done);ht=!0){var pe=ot.value;X.has(pe)&&(pt=!0)}}catch(st){rt=!0,Et=st}finally{try{!ht&&vt.return&&vt.return()}finally{if(rt)throw Et}}if(!pt){var Ct=!1,lt=void 0;Ae.forEach(function(st,mt){st.has([].concat(h(at))[0])&&(Ct=!0,lt=mt)}),Ct?at.forEach(function(st){Ae[lt].add(st)}):Ae.push(new Set(at))}}}),Ae.forEach(function(at,Ee){var pt=Number.POSITIVE_INFINITY,ht=Number.POSITIVE_INFINITY,rt=Number.NEGATIVE_INFINITY,Et=Number.NEGATIVE_INFINITY,vt=!0,ot=!1,pe=void 0;try{for(var Ct=at[Symbol.iterator](),lt;!(vt=(lt=Ct.next()).done);vt=!0){var st=lt.value,mt=void 0;ue=="horizontal"?mt=b.has(st)?w[b.get(st)]:Oe.get(st):mt=b.has(st)?C[b.get(st)]:Oe.get(st);var _r=$e.get(st);mtrt&&(rt=mt),_rEt&&(Et=_r)}}catch(vr){ot=!0,pe=vr}finally{try{!vt&&Ct.return&&Ct.return()}finally{if(ot)throw pe}}var Se=(pt+rt)/2-(ht+Et)/2,Ue=!0,tt=!1,kt=void 0;try{for(var Nt=at[Symbol.iterator](),sr;!(Ue=(sr=Nt.next()).done);Ue=!0){var Qt=sr.value;$e.set(Qt,$e.get(Qt)+Se)}}catch(vr){tt=!0,kt=vr}finally{try{!Ue&&Nt.return&&Nt.return()}finally{if(tt)throw kt}}})}return $e},D=function(j){var ue=0,X=0,Oe=0,xe=0;if(j.forEach(function(Me){Me.left?w[b.get(Me.left)]-w[b.get(Me.right)]>=0?ue++:X++:C[b.get(Me.top)]-C[b.get(Me.bottom)]>=0?Oe++:xe++}),ue>X&&Oe>xe)for(var Ge=0;GeX)for(var _e=0;_exe)for(var $e=0;$e1)v.fixedNodeConstraint.forEach(function(ne,j){O[j]=[ne.position.x,ne.position.y],N[j]=[w[b.get(ne.nodeId)],C[b.get(ne.nodeId)]]}),F=!0;else if(v.alignmentConstraint)(function(){var ne=0;if(v.alignmentConstraint.vertical){for(var j=v.alignmentConstraint.vertical,ue=function($e){var Me=new Set;j[$e].forEach(function(Ke){Me.add(Ke)});var He=new Set([].concat(h(Me)).filter(function(Ke){return V.has(Ke)})),De=void 0;He.size>0?De=w[b.get(He.values().next().value)]:De=L(Me).x,j[$e].forEach(function(Ke){O[ne]=[De,C[b.get(Ke)]],N[ne]=[w[b.get(Ke)],C[b.get(Ke)]],ne++})},X=0;X0?De=w[b.get(He.values().next().value)]:De=L(Me).y,Oe[$e].forEach(function(Ke){O[ne]=[w[b.get(Ke)],De],N[ne]=[w[b.get(Ke)],C[b.get(Ke)]],ne++})},Ge=0;Geq&&(q=H[Y].length,Z=Y);if(q0){var ve={x:0,y:0};v.fixedNodeConstraint.forEach(function(ne,j){var ue={x:w[b.get(ne.nodeId)],y:C[b.get(ne.nodeId)]},X=ne.position,Oe=M(X,ue);ve.x+=Oe.x,ve.y+=Oe.y}),ve.x/=v.fixedNodeConstraint.length,ve.y/=v.fixedNodeConstraint.length,w.forEach(function(ne,j){w[j]+=ve.x}),C.forEach(function(ne,j){C[j]+=ve.y}),v.fixedNodeConstraint.forEach(function(ne){w[b.get(ne.nodeId)]=ne.position.x,C[b.get(ne.nodeId)]=ne.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Ce=v.alignmentConstraint.vertical,Ve=function(j){var ue=new Set;Ce[j].forEach(function(xe){ue.add(xe)});var X=new Set([].concat(h(ue)).filter(function(xe){return V.has(xe)})),Oe=void 0;X.size>0?Oe=w[b.get(X.values().next().value)]:Oe=L(ue).x,ue.forEach(function(xe){V.has(xe)||(w[b.get(xe)]=Oe)})},se=0;se0?Oe=C[b.get(X.values().next().value)]:Oe=L(ue).y,ue.forEach(function(xe){V.has(xe)||(C[b.get(xe)]=Oe)})},ae=0;ae{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(45);return s})()})})(r5)),r5.exports}var MNt=t5.exports,oae;function INt(){return oae||(oae=1,(function(t,e){(function(n,i){t.exports=i(LNt())})(MNt,function(r){return(()=>{var n={658:(o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d{var h=(function(){function p(g,m){var y=[],v=!0,T=!1,b=void 0;try{for(var w=g[Symbol.iterator](),C;!(v=(C=w.next()).done)&&(y.push(C.value),!(m&&y.length===m));v=!0);}catch(S){T=!0,b=S}finally{try{!v&&w.return&&w.return()}finally{if(T)throw b}}return y}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m0&&F.merge(G)});for(var z=0;z1){C=b[0],S=C.connectedEdges().length,b.forEach(function(N){N.connectedEdges().length0&&y.set("dummy"+(y.size+1),_),M},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var w=!0,C=!1,S=void 0;try{for(var k=g.nodeIndexes[Symbol.iterator](),E;!(w=(E=k.next()).done);w=!0){var _=E.value,M=h(_,2),L=M[0],P=M[1],D=m.cy.getElementById(L);if(D){var R=D.boundingBox(),I=g.xCoords[P]-R.w/2,$=g.xCoords[P]+R.w/2,O=g.yCoords[P]-R.h/2,N=g.yCoords[P]+R.h/2;Iv&&(v=$),Ob&&(b=N)}}}catch(G){C=!0,S=G}finally{try{!w&&k.return&&k.return()}finally{if(C)throw S}}var F=p.x-(v+y)/2,z=p.y-(b+T)/2;g.xCoords=g.xCoords.map(function(G){return G+F}),g.yCoords=g.yCoords.map(function(G){return G+z})}else{Object.keys(g).forEach(function(G){var H=g[G],q=H.getRect().x,Z=H.getRect().x+H.getRect().width,Y=H.getRect().y,ie=H.getRect().y+H.getRect().height;qv&&(v=Z),Yb&&(b=ie)});var V=p.x-(v+y)/2,B=p.y-(b+T)/2;Object.keys(g).forEach(function(G){var H=g[G];H.setCenter(H.getCenterX()+V,H.getCenterY()+B)})}}},f.calcBoundingBox=function(p,g,m,y){for(var v=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,b=Number.MAX_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,k=void 0,E=void 0,_=p.descendants().not(":parent"),M=_.length,L=0;LC&&(v=C),Tk&&(b=k),w{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,y=u(140).layoutBase.FDLayoutConstants,v=u(140).CoSEConstants,T=function(w,C){var S=w.cy,k=w.eles,E=k.nodes(),_=k.edges(),M=void 0,L=void 0,P=void 0,D={};w.randomize&&(M=C.nodeIndexes,L=C.xCoords,P=C.yCoords);var R=function(G){return typeof G=="function"},I=function(G,H){return R(G)?G(H):G},$=h.calcParentsWithoutChildren(S,k),O=function B(G,H,q,Z){for(var Y=H.length,ie=0;ie0){var ee=void 0;ee=q.getGraphManager().add(q.newGraph(),te),B(ee,Q,q,Z)}}},N=function(G,H,q){for(var Z=0,Y=0,ie=0;ie0?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=Z/Y:R(w.idealEdgeLength)?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=w.idealEdgeLength,v.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,v.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},F=function(G,H){H.fixedNodeConstraint&&(G.constraints.fixedNodeConstraint=H.fixedNodeConstraint),H.alignmentConstraint&&(G.constraints.alignmentConstraint=H.alignmentConstraint),H.relativePlacementConstraint&&(G.constraints.relativePlacementConstraint=H.relativePlacementConstraint)};w.nestingFactor!=null&&(v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(v.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(v.MAX_ITERATIONS=y.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(v.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(v.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.tilingCompareBy!=null&&(v.TILING_COMPARE_BY=w.tilingCompareBy),w.quality=="proof"?m.QUALITY=2:m.QUALITY=0,v.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!w.randomize,v.ANIMATE=y.ANIMATE=m.ANIMATE=w.animate,v.TILE=w.tile,v.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,v.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,v.PURE_INCREMENTAL=!w.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!1),w.step=="enforced"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!1),w.step=="cose"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!0),w.step=="all"&&(w.randomize?v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!0),w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint?v.TREE_REDUCTION_ON_INCREMENTAL=!1:v.TREE_REDUCTION_ON_INCREMENTAL=!0;var z=new d,V=z.newGraphManager();return O(V.addRoot(),h.getTopMostNodes(E),z,w),N(z,V,_),F(z,w),z.runLayout(),D};o.exports={coseLayout:T}}),212:((o,l,u)=>{var h=(function(){function w(C,S){for(var k=0;k0)if($){var F=p.getTopMostNodes(k.eles.nodes());if(P=p.connectComponents(E,k.eles,F),P.forEach(function(Be){var ce=Be.boundingBox();D.push({x:ce.x1+ce.w/2,y:ce.y1+ce.h/2})}),k.randomize&&P.forEach(function(Be){k.eles=Be,M.push(m(k))}),k.quality=="default"||k.quality=="proof"){var z=E.collection();if(k.tile){var V=new Map,B=[],G=[],H=0,q={nodeIndexes:V,xCoords:B,yCoords:G},Z=[];if(P.forEach(function(Be,ce){Be.edges().length==0&&(Be.nodes().forEach(function(oe,be){z.merge(Be.nodes()[be]),oe.isParent()||(q.nodeIndexes.set(Be.nodes()[be].id(),H++),q.xCoords.push(Be.nodes()[0].position().x),q.yCoords.push(Be.nodes()[0].position().y))}),Z.push(ce))}),z.length>1){var Y=z.boundingBox();D.push({x:Y.x1+Y.w/2,y:Y.y1+Y.h/2}),P.push(z),M.push(q);for(var ie=Z.length-1;ie>=0;ie--)P.splice(Z[ie],1),M.splice(Z[ie],1),D.splice(Z[ie],1)}}P.forEach(function(Be,ce){k.eles=Be,L.push(v(k,M[ce])),p.relocateComponent(D[ce],L[ce],k)})}else P.forEach(function(Be,ce){p.relocateComponent(D[ce],M[ce],k)});var K=new Set;if(P.length>1){var Q=[],te=_.filter(function(Be){return Be.css("display")=="none"});P.forEach(function(Be,ce){var oe=void 0;if(k.quality=="draft"&&(oe=M[ce].nodeIndexes),Be.nodes().not(te).length>0){var be={};be.edges=[],be.nodes=[];var fe=void 0;Be.nodes().not(te).forEach(function(Pe){if(k.quality=="draft")if(!Pe.isParent())fe=oe.get(Pe.id()),be.nodes.push({x:M[ce].xCoords[fe]-Pe.boundingbox().w/2,y:M[ce].yCoords[fe]-Pe.boundingbox().h/2,width:Pe.boundingbox().w,height:Pe.boundingbox().h});else{var ve=p.calcBoundingBox(Pe,M[ce].xCoords,M[ce].yCoords,oe);be.nodes.push({x:ve.topLeftX,y:ve.topLeftY,width:ve.width,height:ve.height})}else L[ce][Pe.id()]&&be.nodes.push({x:L[ce][Pe.id()].getLeft(),y:L[ce][Pe.id()].getTop(),width:L[ce][Pe.id()].getWidth(),height:L[ce][Pe.id()].getHeight()})}),Be.edges().forEach(function(Pe){var ve=Pe.source(),Ce=Pe.target();if(ve.css("display")!="none"&&Ce.css("display")!="none")if(k.quality=="draft"){var Ve=oe.get(ve.id()),se=oe.get(Ce.id()),de=[],Te=[];if(ve.isParent()){var ae=p.calcBoundingBox(ve,M[ce].xCoords,M[ce].yCoords,oe);de.push(ae.topLeftX+ae.width/2),de.push(ae.topLeftY+ae.height/2)}else de.push(M[ce].xCoords[Ve]),de.push(M[ce].yCoords[Ve]);if(Ce.isParent()){var he=p.calcBoundingBox(Ce,M[ce].xCoords,M[ce].yCoords,oe);Te.push(he.topLeftX+he.width/2),Te.push(he.topLeftY+he.height/2)}else Te.push(M[ce].xCoords[se]),Te.push(M[ce].yCoords[se]);be.edges.push({startX:de[0],startY:de[1],endX:Te[0],endY:Te[1]})}else L[ce][ve.id()]&&L[ce][Ce.id()]&&be.edges.push({startX:L[ce][ve.id()].getCenterX(),startY:L[ce][ve.id()].getCenterY(),endX:L[ce][Ce.id()].getCenterX(),endY:L[ce][Ce.id()].getCenterY()})}),be.nodes.length>0&&(Q.push(be),K.add(ce))}});var J=I.packComponents(Q,k.randomize).shifts;if(k.quality=="draft")M.forEach(function(Be,ce){var oe=Be.xCoords.map(function(fe){return fe+J[ce].dx}),be=Be.yCoords.map(function(fe){return fe+J[ce].dy});Be.xCoords=oe,Be.yCoords=be});else{var ge=0;K.forEach(function(Be){Object.keys(L[Be]).forEach(function(ce){var oe=L[Be][ce];oe.setCenter(oe.getCenterX()+J[ge].dx,oe.getCenterY()+J[ge].dy)}),ge++})}}}else{var O=k.eles.boundingBox();if(D.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),k.randomize){var N=m(k);M.push(N)}k.quality=="default"||k.quality=="proof"?(L.push(v(k,M[0])),p.relocateComponent(D[0],L[0],k)):p.relocateComponent(D[0],M[0],k)}var ee=function(ce,oe){if(k.quality=="default"||k.quality=="proof"){typeof ce=="number"&&(ce=oe);var be=void 0,fe=void 0,Pe=ce.data("id");return L.forEach(function(Ce){Pe in Ce&&(be={x:Ce[Pe].getRect().getCenterX(),y:Ce[Pe].getRect().getCenterY()},fe=Ce[Pe])}),k.nodeDimensionsIncludeLabels&&(fe.labelWidth&&(fe.labelPosHorizontal=="left"?be.x+=fe.labelWidth/2:fe.labelPosHorizontal=="right"&&(be.x-=fe.labelWidth/2)),fe.labelHeight&&(fe.labelPosVertical=="top"?be.y+=fe.labelHeight/2:fe.labelPosVertical=="bottom"&&(be.y-=fe.labelHeight/2))),be==null&&(be={x:ce.position("x"),y:ce.position("y")}),{x:be.x,y:be.y}}else{var ve=void 0;return M.forEach(function(Ce){var Ve=Ce.nodeIndexes.get(ce.id());Ve!=null&&(ve={x:Ce.xCoords[Ve],y:Ce.yCoords[Ve]})}),ve==null&&(ve={x:ce.position("x"),y:ce.position("y")}),{x:ve.x,y:ve.y}}};if(k.quality=="default"||k.quality=="proof"||k.randomize){var Re=p.calcParentsWithoutChildren(E,_),Ie=_.filter(function(Be){return Be.css("display")=="none"});k.eles=_.not(Ie),_.nodes().not(":parent").not(Ie).layoutPositions(S,k,ee),Re.length>0&&Re.forEach(function(Be){Be.position(ee(Be))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w})();o.exports=b}),657:((o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var y=m.cy,v=m.eles,T=v.nodes(),b=v.nodes(":parent"),w=new Map,C=new Map,S=new Map,k=[],E=[],_=[],M=[],L=[],P=[],D=[],R=[],I=void 0,$=1e8,O=1e-9,N=m.piTol,F=m.samplingType,z=m.nodeSeparation,V=void 0,B=function(){for(var j=0,ue=0,X=!1;ue=xe;){_e=Oe[xe++];for(var Ae=k[_e],at=0;atHe&&(He=L[pt],De=pt)}return De},H=function(j){var ue=void 0;if(j){ue=Math.floor(Math.random()*I);for(var Oe=0;Oe=1)break;Me=$e}for(var Ke=0;Ke=1)break;Me=$e}for(var at=0;at0&&(ue.isParent()?k[j].push(S.get(ue.id())):k[j].push(ue.id()))})});var Ie=function(j){var ue=C.get(j),X=void 0;w.get(j).forEach(function(Oe){y.getElementById(Oe).isParent()?X=S.get(Oe):X=Oe,k[ue].push(X),k[C.get(X)].push(j)})},Be=!0,ce=!1,oe=void 0;try{for(var be=w.keys()[Symbol.iterator](),fe;!(Be=(fe=be.next()).done);Be=!0){var Pe=fe.value;Ie(Pe)}}catch(ne){ce=!0,oe=ne}finally{try{!Be&&be.return&&be.return()}finally{if(ce)throw oe}}I=C.size;var ve=void 0;if(I>2){V=I{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d}),140:(o=>{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(579);return s})()})})(t5)),t5.exports}var NNt=INt();const DNt=eg(NNt);var lae={L:"left",R:"right",T:"top",B:"bottom"},cae={L:x(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:x(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:x(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:x(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},R4={L:x((t,e)=>t-e+2,"L"),R:x((t,e)=>t-2,"R"),T:x((t,e)=>t-e+2,"T"),B:x((t,e)=>t-2,"B")},ONt=x(function(t){return Ns(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),uae=x(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),Ns=x(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),bf=x(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),jU=x(function(t,e){const r=Ns(t)&&bf(e),n=bf(t)&&Ns(e);return r||n},"isArchitectureDirectionXY"),$Nt=x(function(t){const e=t[0],r=t[1],n=Ns(e)&&bf(r),i=bf(e)&&Ns(r);return n||i},"isArchitecturePairXY"),PNt=x(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),lF=x(function(t,e){const r=`${t}${e}`;return PNt(r)?r:void 0},"getArchitectureDirectionPair"),BNt=x(function([t,e],r){const n=r[0],i=r[1];return Ns(n)?bf(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:Ns(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),FNt=x(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),zNt=x(function(t,e){return jU(t,e)?"bend":Ns(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),VNt=x(function(t){return t.type==="service"},"isArchitectureService"),GNt=x(function(t){return t.type==="junction"},"isArchitectureJunction"),pRe=x((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),gRe=x(t=>t.data(),"edgeData"),sy=x(t=>t.data(),"nodeData"),WNt=Vr.architecture,lb,mRe=(lb=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Hn,this.getAccTitle=ni,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getAccDescription=ai,this.setAccDescription=ii,this.clear()}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",On()}addService({id:e,icon:r,in:n,title:i,iconText:a}){if(this.registeredIds.has(e))throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(n)==="node")throw new Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"service",icon:r,iconText:a,title:i,edges:[],in:n})}getServices(){return[...this.nodes.values()].filter(VNt)}addJunction({id:e,in:r}){if(this.registeredIds.has(e))throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(r!==void 0){if(e===r)throw new Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(r))throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(r)==="node")throw new Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"junction",edges:[],in:r})}getJunctions(){return[...this.nodes.values()].filter(GNt)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:r,in:n,title:i}){if(this.registeredIds.has(e))throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(n)==="node")throw new Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,"group"),this.groups.set(e,{id:e,icon:r,title:i,in:n})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:r,lhsDir:n,rhsDir:i,lhsInto:a,rhsInto:s,lhsGroup:o,rhsGroup:l,title:u}){if(!uae(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!uae(i))throw new Error(`Invalid direction given for right hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(i)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(r)&&!this.groups.has(r))throw new Error(`The right-hand id [${r}] does not yet exist. Please create the service/group before declaring an edge to it.`);const h=this.nodes.get(e).in,d=this.nodes.get(r).in;if(o&&h&&d&&h==d)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&d&&h==d)throw new Error(`The right-hand id [${r}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:e,lhsDir:n,lhsInto:a,lhsGroup:o,rhsId:r,rhsDir:i,rhsInto:s,rhsGroup:l,title:u};this.edges.push(f);const p=this.nodes.get(e),g=this.nodes.get(r);p&&g&&(p.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw new Error(`An align directive requires at least two members; got ${e.members.length}`);const r=new Set;e.members.forEach(n=>{if(this.registeredIds.get(n)!=="node")throw new Error(`align ${e.direction} references [${n}], which is not a service or junction`);if(r.has(n))throw new Error(`align ${e.direction} lists [${n}] more than once`);r.add(n)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){var e,r;if(this.dataStructures===void 0){const n=new Map,i=new Map;for(const[u,h]of this.nodes.entries()){const d=new Map;for(const f of h.edges){const p=(e=this.getNode(f.lhsId))==null?void 0:e.in,g=(r=this.getNode(f.rhsId))==null?void 0:r.in;if(p&&g&&p!==g){const m=zNt(f.lhsDir,f.rhsDir);m!=="bend"&&n.set(pRe(p,g),m)}if(f.lhsId===u){const m=lF(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=lF(f.rhsDir,f.lhsDir);m&&d.set(m,f.lhsId)}}i.set(u,d)}const a=new Set,s=new Set(i.keys()),o=x(u=>{const h=new Map([[u,[0,0]]]),d=[u];for(;d.length>0;){const f=d.shift();if(f){a.add(f),s.delete(f);const p=i.get(f);if(!p)throw new Error(`BFS error: adjacency list for id ${f} not found. Please report this as a bug.`);const g=h.get(f);if(!g)throw new Error(`BFS error: position for id ${f} not found in spatial map. Please report this as a bug.`);const[m,y]=g;p.forEach((v,T)=>{a.has(v)||(h.set(v,BNt([m,y],T)),d.push(v))})}}return h},"BFS"),l=[];for(;s.size>0;){const u=s.values().next().value;l.push(o(u))}this.dataStructures={adjList:i,spatialMaps:l,groupAlignments:n}}return this.dataStructures}setElementForId(e,r){this.elements.set(e,r)}getElementById(e){return this.elements.get(e)}getConfig(){return ri({...WNt,...Xt().architecture})}getConfigField(e){return this.getConfig()[e]}},x(lb,"ArchitectureDB"),lb),HNt=x((t,e)=>{var r;eo(t,e),t.groups.map(n=>e.addGroup(n)),t.services.map(n=>e.addService({...n,type:"service"})),t.junctions.map(n=>e.addJunction({...n,type:"junction"})),t.edges.map(n=>e.addEdge(n)),(r=t.alignments)==null||r.map(n=>e.addLayoutHint({direction:n.direction,members:[...n.members]}))},"populateDb"),yRe={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Al("architecture",t);le.debug(e);const r=(n=yRe.parser)==null?void 0:n.yy;if(!(r instanceof mRe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");HNt(e,r)},"parse")},qNt=x(t=>` + `},"styles"),ANt=ENt,_Nt={db:aF,renderer:kNt,parser:mNt,styles:ANt};const RNt=Object.freeze(Object.defineProperty({__proto__:null,diagram:_Nt},Symbol.toStringTag,{value:"Module"}));var t5={exports:{}},r5={exports:{}},n5={exports:{}},LNt=n5.exports,sae;function MNt(){return sae||(sae=1,(function(t,e){(function(n,i){t.exports=i()})(LNt,function(){return(function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=28)})([(function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a}),(function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l}),(function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,y){m==null&&y==null&&(y=g),a.call(this,y),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(y.target==p){if(y.source!=m)throw"Incorrect edge source!";g.push(y)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(!(y.source==m||y.target==m))throw"Incorrect edge source and/or target";(y.target==p||y.source==p)&&g.push(y)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var y=this.child.getNodes(),v=0;vg?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,T){a.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,T){if(v==null&&T==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(v.owner==T.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=T.owner?null:(w.source=v,w.target=T,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),T!=v&&T.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=v.edges.slice(),b,w=T.length,C=0;C-1&&E>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(k,1),b.target!=b.source&&b.target.edges.splice(E,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,T,b,w,C=this.getNodes(),S=C.length,k=0;kT&&(y=T),v>b&&(v=b)}return y==s.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?w=C[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,C,S,k,E,_,M=this.nodes,L=M.length,P=0;PC&&(v=C),Tk&&(b=k),wC&&(v=C),Tk&&(b=k),w=this.nodes.length){var L=0;T.forEach(function(P){P.owner==y&&L++}),L==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=M,!1;if(df)return u[0]=g,u[1]=d,u[2]=E,u[3]=p,!1;if(hf?(u[0]=v,u[1]=T,R=!0):(u[0]=y,u[1]=m,R=!0):$===N&&(h>f?(u[0]=g,u[1]=m,R=!0):(u[0]=b,u[1]=T,R=!0)),-O===N?f>h?(u[2]=_,u[3]=M,I=!0):(u[2]=E,u[3]=k,I=!0):O===N&&(f>h?(u[2]=S,u[3]=k,I=!0):(u[2]=L,u[3]=M,I=!0)),R&&I)return!1;if(h>f?d>p?(F=this.getCardinalDirection($,N,4),z=this.getCardinalDirection(O,N,2)):(F=this.getCardinalDirection(-$,N,3),z=this.getCardinalDirection(-O,N,1)):d>p?(F=this.getCardinalDirection(-$,N,1),z=this.getCardinalDirection(-O,N,3)):(F=this.getCardinalDirection($,N,2),z=this.getCardinalDirection(O,N,4)),!R)switch(F){case 1:B=m,V=h+-C/N,u[0]=V,u[1]=B;break;case 2:V=b,B=d+w*N,u[0]=V,u[1]=B;break;case 3:B=T,V=h+C/N,u[0]=V,u[1]=B;break;case 4:V=v,B=d+-w*N,u[0]=V,u[1]=B;break}if(!I)switch(z){case 1:H=k,G=f+-D/N,u[2]=G,u[3]=H;break;case 2:G=L,H=p+P*N,u[2]=G,u[3]=H;break;case 3:H=M,G=f+D/N,u[2]=G,u[3]=H;break;case 4:G=_,H=p+-P*N,u[2]=G,u[3]=H;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,b=void 0,w=void 0,C=void 0,S=void 0,k=void 0,E=void 0,_=void 0,M=void 0,L=void 0;return C=g-f,k=d-p,_=p*f-d*g,S=T-y,E=m-v,M=v*y-m*T,L=C*E-S*k,L===0?null:(b=(k*M-E*_)/L,w=(S*_-C*M)/L,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var T=(-m+Math.sqrt(m*m-4*g*y))/(2*g),b=(-m-Math.sqrt(m*m-4*g*y))/(2*g),w=null;return T>=0&&T<=1?[T]:b>=0&&b<=1?[b]:w}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s}),(function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(C.push(k[0]);C.length>0&&y;){var E=C[0];C.splice(0,1),w.add(E);for(var _=E.getEdges(),b=0;b<_.length;b++){var M=_[b].getOtherEnd(E);if(S.get(E)!=M)if(!w.has(M))C.push(M),S.set(M,E);else{y=!1;break}}}if(!y)m=[];else{var L=[].concat(a(w));m.push(L);for(var b=0;b-1&&k.splice(D,1)}w=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,T=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var T=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(M,1);var L=S.getNeighborsList();L.forEach(function(R){if(v.indexOf(R)<0){var I=T.get(R),$=I-1;$==1&&E.push(R),T.set(R,$)}})}v=v.concat(E),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,T,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mC||w>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*T)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>C||w>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||C>=b[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){function a(){}a.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=(function(vt){for(var ot=[];vt-- >0;)ot.push(0);return ot})(Math.min(this.m+1,this.n)),this.U=(function(vt){var ot=function pe(Ct){if(Ct.length==0)return 0;for(var lt=[],st=0;st0;)ot.push(0);return ot})(this.n),u=(function(vt){for(var ot=[];vt-- >0;)ot.push(0);return ot})(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;O--)if(this.s[O]!==0){for(var N=O+1;N=0;q--){if((function(vt,ot){return vt&&ot})(q0;){var ee=void 0,Re=void 0;for(ee=R-2;ee>=-1&&ee!==-1;ee--)if(Math.abs(l[ee])<=ge+J*(Math.abs(this.s[ee])+Math.abs(this.s[ee+1]))){l[ee]=0;break}if(ee===R-2)Re=4;else{var Ie=void 0;for(Ie=R-1;Ie>=ee&&Ie!==ee;Ie--){var Be=(Ie!==R?Math.abs(l[Ie]):0)+(Ie!==ee+1?Math.abs(l[Ie-1]):0);if(Math.abs(this.s[Ie])<=ge+J*Be){this.s[Ie]=0;break}}Ie===ee?Re=3:Ie===R-1?Re=1:(Re=2,ee=Ie)}switch(ee++,Re){case 1:{var ce=l[R-2];l[R-2]=0;for(var oe=R-2;oe>=ee;oe--){var be=a.hypot(this.s[oe],ce),fe=this.s[oe]/be,Pe=ce/be;this.s[oe]=be,oe!==ee&&(ce=-Pe*l[oe-1],l[oe-1]=fe*l[oe-1]);for(var ve=0;ve=this.s[ee+1]);){var pt=this.s[ee];if(this.s[ee]=this.s[ee+1],this.s[ee+1]=pt,eeMath.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=a}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u{var n={45:((o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h}),806:((o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d}),767:((o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),880:((o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),578:((o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),765:((o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),y=u(902),v=u(551).FDLayoutConstants,T=u(551).LayoutConstants,b=u(551).Point,w=u(551).PointD,C=u(551).DimensionD,S=u(551).Layout,k=u(551).Integer,E=u(551).IGeometry,_=u(551).LGraph,M=u(551).Transform,L=u(551).LinkedList;function P(){h.call(this),this.toBeTiled={},this.constraints={}}P.prototype=Object.create(h.prototype);for(var D in h)P[D]=h[D];P.prototype.newGraphManager=function(){var R=new d(this);return this.graphManager=R,R},P.prototype.newGraph=function(R){return new f(null,this.graphManager,R)},P.prototype.newNode=function(R){return new p(this.graphManager,R)},P.prototype.newEdge=function(R){return new g(null,null,R)},P.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=v.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=v.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},P.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/v.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},P.prototype.layout=function(){var R=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return R&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},P.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),$=this.nodesWithGravity.filter(function(F){return I.has(F)});this.graphManager.setAllNodesToApplyGravitation($)}}else{var R=this.getFlatForest();if(R.length>0)this.positionNodesRadially(R);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),$=this.nodesWithGravity.filter(function(O){return I.has(O)});this.graphManager.setAllNodesToApplyGravitation($),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(y.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},P.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%v.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),I=this.nodesWithGravity.filter(function(N){return R.has(N)});this.graphManager.setAllNodesToApplyGravitation(I),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var $=!this.isTreeGrowing&&!this.isGrowthFinished,O=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces($,O),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},P.prototype.getPositionsData=function(){for(var R=this.graphManager.getAllNodes(),I={},$=0;$0&&this.updateDisplacements();for(var $=0;$0&&(O.fixedNodeWeight=F)}}if(this.constraints.relativePlacementConstraint){var z=new Map,V=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(K){R.fixedNodesOnHorizontal.add(K),R.fixedNodesOnVertical.add(K)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var B=this.constraints.alignmentConstraint.vertical,$=0;$=2*K.length/3;J--)Q=Math.floor(Math.random()*(J+1)),te=K[J],K[J]=K[Q],K[Q]=te;return K},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(K){if(K.left){var Q=z.has(K.left)?z.get(K.left):K.left,te=z.has(K.right)?z.get(K.right):K.right;R.nodesInRelativeHorizontal.includes(Q)||(R.nodesInRelativeHorizontal.push(Q),R.nodeToRelativeConstraintMapHorizontal.set(Q,[]),R.dummyToNodeForVerticalAlignment.has(Q)?R.nodeToTempPositionMapHorizontal.set(Q,R.idToNodeMap.get(R.dummyToNodeForVerticalAlignment.get(Q)[0]).getCenterX()):R.nodeToTempPositionMapHorizontal.set(Q,R.idToNodeMap.get(Q).getCenterX())),R.nodesInRelativeHorizontal.includes(te)||(R.nodesInRelativeHorizontal.push(te),R.nodeToRelativeConstraintMapHorizontal.set(te,[]),R.dummyToNodeForVerticalAlignment.has(te)?R.nodeToTempPositionMapHorizontal.set(te,R.idToNodeMap.get(R.dummyToNodeForVerticalAlignment.get(te)[0]).getCenterX()):R.nodeToTempPositionMapHorizontal.set(te,R.idToNodeMap.get(te).getCenterX())),R.nodeToRelativeConstraintMapHorizontal.get(Q).push({right:te,gap:K.gap}),R.nodeToRelativeConstraintMapHorizontal.get(te).push({left:Q,gap:K.gap})}else{var J=V.has(K.top)?V.get(K.top):K.top,ge=V.has(K.bottom)?V.get(K.bottom):K.bottom;R.nodesInRelativeVertical.includes(J)||(R.nodesInRelativeVertical.push(J),R.nodeToRelativeConstraintMapVertical.set(J,[]),R.dummyToNodeForHorizontalAlignment.has(J)?R.nodeToTempPositionMapVertical.set(J,R.idToNodeMap.get(R.dummyToNodeForHorizontalAlignment.get(J)[0]).getCenterY()):R.nodeToTempPositionMapVertical.set(J,R.idToNodeMap.get(J).getCenterY())),R.nodesInRelativeVertical.includes(ge)||(R.nodesInRelativeVertical.push(ge),R.nodeToRelativeConstraintMapVertical.set(ge,[]),R.dummyToNodeForHorizontalAlignment.has(ge)?R.nodeToTempPositionMapVertical.set(ge,R.idToNodeMap.get(R.dummyToNodeForHorizontalAlignment.get(ge)[0]).getCenterY()):R.nodeToTempPositionMapVertical.set(ge,R.idToNodeMap.get(ge).getCenterY())),R.nodeToRelativeConstraintMapVertical.get(J).push({bottom:ge,gap:K.gap}),R.nodeToRelativeConstraintMapVertical.get(ge).push({top:J,gap:K.gap})}});else{var H=new Map,q=new Map;this.constraints.relativePlacementConstraint.forEach(function(K){if(K.left){var Q=z.has(K.left)?z.get(K.left):K.left,te=z.has(K.right)?z.get(K.right):K.right;H.has(Q)?H.get(Q).push(te):H.set(Q,[te]),H.has(te)?H.get(te).push(Q):H.set(te,[Q])}else{var J=V.has(K.top)?V.get(K.top):K.top,ge=V.has(K.bottom)?V.get(K.bottom):K.bottom;q.has(J)?q.get(J).push(ge):q.set(J,[ge]),q.has(ge)?q.get(ge).push(J):q.set(ge,[J])}});var Z=function(Q,te){var J=[],ge=[],ee=new L,Re=new Set,Ie=0;return Q.forEach(function(Be,ce){if(!Re.has(ce)){J[Ie]=[],ge[Ie]=!1;var oe=ce;for(ee.push(oe),Re.add(oe),J[Ie].push(oe);ee.length!=0;){oe=ee.shift(),te.has(oe)&&(ge[Ie]=!0);var be=Q.get(oe);be.forEach(function(fe){Re.has(fe)||(ee.push(fe),Re.add(fe),J[Ie].push(fe))})}Ie++}}),{components:J,isFixed:ge}},Y=Z(H,R.fixedNodesOnHorizontal);this.componentsOnHorizontal=Y.components,this.fixedComponentsOnHorizontal=Y.isFixed;var ie=Z(q,R.fixedNodesOnVertical);this.componentsOnVertical=ie.components,this.fixedComponentsOnVertical=ie.isFixed}}},P.prototype.updateDisplacements=function(){var R=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(ie){var K=R.idToNodeMap.get(ie.nodeId);K.displacementX=0,K.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var I=this.constraints.alignmentConstraint.vertical,$=0;$1){var V;for(V=0;VO&&(O=Math.floor(z.y)),F=Math.floor(z.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(T.WORLD_CENTER_X-z.x/2,T.WORLD_CENTER_Y-z.y/2))},P.radialLayout=function(R,I,$){var O=Math.max(this.maxDiagonalInTree(R),m.DEFAULT_RADIAL_SEPARATION);P.branchRadialLayout(I,null,0,359,0,O);var N=_.calculateBounds(R),F=new M;F.setDeviceOrgX(N.getMinX()),F.setDeviceOrgY(N.getMinY()),F.setWorldOrgX($.x),F.setWorldOrgY($.y);for(var z=0;z1;){var te=Q[0];Q.splice(0,1);var J=q.indexOf(te);J>=0&&q.splice(J,1),ie--,Z--}I!=null?K=(q.indexOf(Q[0])+1)%ie:K=0;for(var ge=Math.abs(O-$)/Z,ee=K;Y!=Z;ee=++ee%ie){var Re=q[ee].getOtherEnd(R);if(Re!=I){var Ie=($+Y*ge)%360,Be=(Ie+ge)%360;P.branchRadialLayout(Re,R,Ie,Be,N+F,F),Y++}}},P.maxDiagonalInTree=function(R){for(var I=k.MIN_VALUE,$=0;$I&&(I=N)}return I},P.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},P.prototype.groupZeroDegreeMembers=function(){var R=this,I={};this.memberGroups={},this.idToDummyNode={};for(var $=[],O=this.graphManager.getAllNodes(),N=0;N"u"&&(I[V]=[]),I[V]=I[V].concat(F)}Object.keys(I).forEach(function(B){if(I[B].length>1){var G="DummyCompound_"+B;R.memberGroups[G]=I[B];var H=I[B][0].getParent(),q=new p(R.graphManager);q.id=G,q.paddingLeft=H.paddingLeft||0,q.paddingRight=H.paddingRight||0,q.paddingBottom=H.paddingBottom||0,q.paddingTop=H.paddingTop||0,R.idToDummyNode[G]=q;var Z=R.getGraphManager().add(R.newGraph(),q),Y=H.getChild();Y.add(q);for(var ie=0;ieN?(O.rect.x-=(O.labelWidth-N)/2,O.setWidth(O.labelWidth),O.labelMarginLeft=(O.labelWidth-N)/2):O.labelPosHorizontal=="right"&&O.setWidth(N+O.labelWidth)),O.labelHeight&&(O.labelPosVertical=="top"?(O.rect.y-=O.labelHeight,O.setHeight(F+O.labelHeight),O.labelMarginTop=O.labelHeight):O.labelPosVertical=="center"&&O.labelHeight>F?(O.rect.y-=(O.labelHeight-F)/2,O.setHeight(O.labelHeight),O.labelMarginTop=(O.labelHeight-F)/2):O.labelPosVertical=="bottom"&&O.setHeight(F+O.labelHeight))}})},P.prototype.repopulateCompounds=function(){for(var R=this.compoundOrder.length-1;R>=0;R--){var I=this.compoundOrder[R],$=I.id,O=I.paddingLeft,N=I.paddingTop,F=I.labelMarginLeft,z=I.labelMarginTop;this.adjustLocations(this.tiledMemberPack[$],I.rect.x,I.rect.y,O,N,F,z)}},P.prototype.repopulateZeroDegreeMembers=function(){var R=this,I=this.tiledZeroDegreePack;Object.keys(I).forEach(function($){var O=R.idToDummyNode[$],N=O.paddingLeft,F=O.paddingTop,z=O.labelMarginLeft,V=O.labelMarginTop;R.adjustLocations(I[$],O.rect.x,O.rect.y,N,F,z,V)})},P.prototype.getToBeTiled=function(R){var I=R.id;if(this.toBeTiled[I]!=null)return this.toBeTiled[I];var $=R.getChild();if($==null)return this.toBeTiled[I]=!1,!1;for(var O=$.getNodes(),N=0;N0)return this.toBeTiled[I]=!1,!1;if(F.getChild()==null){this.toBeTiled[F.id]=!1;continue}if(!this.getToBeTiled(F))return this.toBeTiled[I]=!1,!1}return this.toBeTiled[I]=!0,!0},P.prototype.getNodeDegree=function(R){R.id;for(var I=R.getEdges(),$=0,O=0;OH&&(H=Z.rect.height)}$+=H+R.verticalPadding}},P.prototype.tileCompoundMembers=function(R,I){var $=this;this.tiledMemberPack=[],Object.keys(R).forEach(function(O){var N=I[O];if($.tiledMemberPack[O]=$.tileNodes(R[O],N.paddingLeft+N.paddingRight),N.rect.width=$.tiledMemberPack[O].width,N.rect.height=$.tiledMemberPack[O].height,N.setCenter($.tiledMemberPack[O].centerX,$.tiledMemberPack[O].centerY),N.labelMarginLeft=0,N.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var F=N.rect.width,z=N.rect.height;N.labelWidth&&(N.labelPosHorizontal=="left"?(N.rect.x-=N.labelWidth,N.setWidth(F+N.labelWidth),N.labelMarginLeft=N.labelWidth):N.labelPosHorizontal=="center"&&N.labelWidth>F?(N.rect.x-=(N.labelWidth-F)/2,N.setWidth(N.labelWidth),N.labelMarginLeft=(N.labelWidth-F)/2):N.labelPosHorizontal=="right"&&N.setWidth(F+N.labelWidth)),N.labelHeight&&(N.labelPosVertical=="top"?(N.rect.y-=N.labelHeight,N.setHeight(z+N.labelHeight),N.labelMarginTop=N.labelHeight):N.labelPosVertical=="center"&&N.labelHeight>z?(N.rect.y-=(N.labelHeight-z)/2,N.setHeight(N.labelHeight),N.labelMarginTop=(N.labelHeight-z)/2):N.labelPosVertical=="bottom"&&N.setHeight(z+N.labelHeight))}})},P.prototype.tileNodes=function(R,I){var $=this.tileNodesByFavoringDim(R,I,!0),O=this.tileNodesByFavoringDim(R,I,!1),N=this.getOrgRatio($),F=this.getOrgRatio(O),z;return FV&&(V=ie.getWidth())});var B=F/N,G=z/N,H=Math.pow($-O,2)+4*(B+O)*(G+$)*N,q=(O-$+Math.sqrt(H))/(2*(B+O)),Z;I?(Z=Math.ceil(q),Z==q&&Z++):Z=Math.floor(q);var Y=Z*(B+O)-O;return V>Y&&(Y=V),Y+=O*2,Y},P.prototype.tileNodesByFavoringDim=function(R,I,$){var O=m.TILING_PADDING_VERTICAL,N=m.TILING_PADDING_HORIZONTAL,F=m.TILING_COMPARE_BY,z={rows:[],rowWidth:[],rowHeight:[],width:0,height:I,verticalPadding:O,horizontalPadding:N,centerX:0,centerY:0};F&&(z.idealRowWidth=this.calcIdealRowWidth(R,$));var V=function(K){return K.rect.width*K.rect.height},B=function(K,Q){return V(Q)-V(K)};R.sort(function(ie,K){var Q=B;return z.idealRowWidth?(Q=F,Q(ie.id,K.id)):Q(ie,K)});for(var G=0,H=0,q=0;q0&&(z+=R.horizontalPadding),R.rowWidth[$]=z,R.width0&&(V+=R.verticalPadding);var B=0;V>R.rowHeight[$]&&(B=R.rowHeight[$],R.rowHeight[$]=V,B=R.rowHeight[$]-B),R.height+=B,R.rows[$].push(I)},P.prototype.getShortestRowIndex=function(R){for(var I=-1,$=Number.MAX_VALUE,O=0;O$&&(I=O,$=R.rowWidth[O]);return I},P.prototype.canAddHorizontal=function(R,I,$){if(R.idealRowWidth){var O=R.rows.length-1,N=R.rowWidth[O];return N+I+R.horizontalPadding<=R.idealRowWidth}var F=this.getShortestRowIndex(R);if(F<0)return!0;var z=R.rowWidth[F];if(z+R.horizontalPadding+I<=R.width)return!0;var V=0;R.rowHeight[F]<$&&F>0&&(V=$+R.verticalPadding-R.rowHeight[F]);var B;R.width-z>=I+R.horizontalPadding?B=(R.height+V)/(z+I+R.horizontalPadding):B=(R.height+V)/R.width,V=$+R.verticalPadding;var G;return R.widthF&&I!=$){O.splice(-1,1),R.rows[$].push(N),R.rowWidth[I]=R.rowWidth[I]-F,R.rowWidth[$]=R.rowWidth[$]+F,R.width=R.rowWidth[instance.getLongestRowIndex(R)];for(var z=Number.MIN_VALUE,V=0;Vz&&(z=O[V].height);I>0&&(z+=R.verticalPadding);var B=R.rowHeight[I]+R.rowHeight[$];R.rowHeight[I]=z,R.rowHeight[$]0)for(var Y=N;Y<=F;Y++)Z[0]+=this.grid[Y][z-1].length+this.grid[Y][z].length-1;if(F0)for(var Y=z;Y<=V;Y++)Z[3]+=this.grid[N-1][Y].length+this.grid[N][Y].length-1;for(var ie=k.MAX_VALUE,K,Q,te=0;te{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,y,v){h.call(this,g,m,y,v)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var y=this.getChild().getNodes(),v,T=0;T{function h(y){if(Array.isArray(y)){for(var v=0,T=Array(y.length);v0){var pt=0;Ee.forEach(function(rt){ue=="horizontal"?($e.set(rt,b.has(rt)?w[b.get(rt)]:Oe.get(rt)),pt+=$e.get(rt)):($e.set(rt,b.has(rt)?C[b.get(rt)]:Oe.get(rt)),pt+=$e.get(rt))}),pt=pt/Ee.length,at.forEach(function(rt){X.has(rt)||$e.set(rt,pt)})}else{var ht=0;at.forEach(function(rt){ue=="horizontal"?ht+=b.has(rt)?w[b.get(rt)]:Oe.get(rt):ht+=b.has(rt)?C[b.get(rt)]:Oe.get(rt)}),ht=ht/at.length,at.forEach(function(rt){$e.set(rt,ht)})}});for(var De=function(){var Ee=He.shift(),pt=j.get(Ee);pt.forEach(function(ht){if($e.get(ht.id)<$e.get(Ee)+ht.gap)if(X&&X.has(ht.id)){var rt=void 0;if(ue=="horizontal"?rt=b.has(ht.id)?w[b.get(ht.id)]:Oe.get(ht.id):rt=b.has(ht.id)?C[b.get(ht.id)]:Oe.get(ht.id),$e.set(ht.id,rt),rt<$e.get(Ee)+ht.gap){var Et=$e.get(Ee)+ht.gap-rt;Me.get(Ee).forEach(function(vt){$e.set(vt,$e.get(vt)-Et)})}}else $e.set(ht.id,$e.get(Ee)+ht.gap);_e.set(ht.id,_e.get(ht.id)-1),_e.get(ht.id)==0&&He.push(ht.id),X&&Me.set(ht.id,Ge(Me.get(Ee),Me.get(ht.id)))})};He.length!=0;)De();if(X){var Ke=new Set;j.forEach(function(at,Ee){at.length==0&&Ke.add(Ee)});var Ae=[];Me.forEach(function(at,Ee){if(Ke.has(Ee)){var pt=!1,ht=!0,rt=!1,Et=void 0;try{for(var vt=at[Symbol.iterator](),ot;!(ht=(ot=vt.next()).done);ht=!0){var pe=ot.value;X.has(pe)&&(pt=!0)}}catch(st){rt=!0,Et=st}finally{try{!ht&&vt.return&&vt.return()}finally{if(rt)throw Et}}if(!pt){var Ct=!1,lt=void 0;Ae.forEach(function(st,mt){st.has([].concat(h(at))[0])&&(Ct=!0,lt=mt)}),Ct?at.forEach(function(st){Ae[lt].add(st)}):Ae.push(new Set(at))}}}),Ae.forEach(function(at,Ee){var pt=Number.POSITIVE_INFINITY,ht=Number.POSITIVE_INFINITY,rt=Number.NEGATIVE_INFINITY,Et=Number.NEGATIVE_INFINITY,vt=!0,ot=!1,pe=void 0;try{for(var Ct=at[Symbol.iterator](),lt;!(vt=(lt=Ct.next()).done);vt=!0){var st=lt.value,mt=void 0;ue=="horizontal"?mt=b.has(st)?w[b.get(st)]:Oe.get(st):mt=b.has(st)?C[b.get(st)]:Oe.get(st);var _r=$e.get(st);mtrt&&(rt=mt),_rEt&&(Et=_r)}}catch(vr){ot=!0,pe=vr}finally{try{!vt&&Ct.return&&Ct.return()}finally{if(ot)throw pe}}var Se=(pt+rt)/2-(ht+Et)/2,Ue=!0,tt=!1,kt=void 0;try{for(var Nt=at[Symbol.iterator](),sr;!(Ue=(sr=Nt.next()).done);Ue=!0){var Qt=sr.value;$e.set(Qt,$e.get(Qt)+Se)}}catch(vr){tt=!0,kt=vr}finally{try{!Ue&&Nt.return&&Nt.return()}finally{if(tt)throw kt}}})}return $e},D=function(j){var ue=0,X=0,Oe=0,xe=0;if(j.forEach(function(Me){Me.left?w[b.get(Me.left)]-w[b.get(Me.right)]>=0?ue++:X++:C[b.get(Me.top)]-C[b.get(Me.bottom)]>=0?Oe++:xe++}),ue>X&&Oe>xe)for(var Ge=0;GeX)for(var _e=0;_exe)for(var $e=0;$e1)v.fixedNodeConstraint.forEach(function(ne,j){O[j]=[ne.position.x,ne.position.y],N[j]=[w[b.get(ne.nodeId)],C[b.get(ne.nodeId)]]}),F=!0;else if(v.alignmentConstraint)(function(){var ne=0;if(v.alignmentConstraint.vertical){for(var j=v.alignmentConstraint.vertical,ue=function($e){var Me=new Set;j[$e].forEach(function(Ke){Me.add(Ke)});var He=new Set([].concat(h(Me)).filter(function(Ke){return V.has(Ke)})),De=void 0;He.size>0?De=w[b.get(He.values().next().value)]:De=L(Me).x,j[$e].forEach(function(Ke){O[ne]=[De,C[b.get(Ke)]],N[ne]=[w[b.get(Ke)],C[b.get(Ke)]],ne++})},X=0;X0?De=w[b.get(He.values().next().value)]:De=L(Me).y,Oe[$e].forEach(function(Ke){O[ne]=[w[b.get(Ke)],De],N[ne]=[w[b.get(Ke)],C[b.get(Ke)]],ne++})},Ge=0;Geq&&(q=H[Y].length,Z=Y);if(q0){var ve={x:0,y:0};v.fixedNodeConstraint.forEach(function(ne,j){var ue={x:w[b.get(ne.nodeId)],y:C[b.get(ne.nodeId)]},X=ne.position,Oe=M(X,ue);ve.x+=Oe.x,ve.y+=Oe.y}),ve.x/=v.fixedNodeConstraint.length,ve.y/=v.fixedNodeConstraint.length,w.forEach(function(ne,j){w[j]+=ve.x}),C.forEach(function(ne,j){C[j]+=ve.y}),v.fixedNodeConstraint.forEach(function(ne){w[b.get(ne.nodeId)]=ne.position.x,C[b.get(ne.nodeId)]=ne.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Ce=v.alignmentConstraint.vertical,Ve=function(j){var ue=new Set;Ce[j].forEach(function(xe){ue.add(xe)});var X=new Set([].concat(h(ue)).filter(function(xe){return V.has(xe)})),Oe=void 0;X.size>0?Oe=w[b.get(X.values().next().value)]:Oe=L(ue).x,ue.forEach(function(xe){V.has(xe)||(w[b.get(xe)]=Oe)})},se=0;se0?Oe=C[b.get(X.values().next().value)]:Oe=L(ue).y,ue.forEach(function(xe){V.has(xe)||(C[b.get(xe)]=Oe)})},ae=0;ae{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(45);return s})()})})(r5)),r5.exports}var DNt=t5.exports,lae;function ONt(){return lae||(lae=1,(function(t,e){(function(n,i){t.exports=i(NNt())})(DNt,function(r){return(()=>{var n={658:(o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d{var h=(function(){function p(g,m){var y=[],v=!0,T=!1,b=void 0;try{for(var w=g[Symbol.iterator](),C;!(v=(C=w.next()).done)&&(y.push(C.value),!(m&&y.length===m));v=!0);}catch(S){T=!0,b=S}finally{try{!v&&w.return&&w.return()}finally{if(T)throw b}}return y}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m0&&F.merge(G)});for(var z=0;z1){C=b[0],S=C.connectedEdges().length,b.forEach(function(N){N.connectedEdges().length0&&y.set("dummy"+(y.size+1),_),M},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var w=!0,C=!1,S=void 0;try{for(var k=g.nodeIndexes[Symbol.iterator](),E;!(w=(E=k.next()).done);w=!0){var _=E.value,M=h(_,2),L=M[0],P=M[1],D=m.cy.getElementById(L);if(D){var R=D.boundingBox(),I=g.xCoords[P]-R.w/2,$=g.xCoords[P]+R.w/2,O=g.yCoords[P]-R.h/2,N=g.yCoords[P]+R.h/2;Iv&&(v=$),Ob&&(b=N)}}}catch(G){C=!0,S=G}finally{try{!w&&k.return&&k.return()}finally{if(C)throw S}}var F=p.x-(v+y)/2,z=p.y-(b+T)/2;g.xCoords=g.xCoords.map(function(G){return G+F}),g.yCoords=g.yCoords.map(function(G){return G+z})}else{Object.keys(g).forEach(function(G){var H=g[G],q=H.getRect().x,Z=H.getRect().x+H.getRect().width,Y=H.getRect().y,ie=H.getRect().y+H.getRect().height;qv&&(v=Z),Yb&&(b=ie)});var V=p.x-(v+y)/2,B=p.y-(b+T)/2;Object.keys(g).forEach(function(G){var H=g[G];H.setCenter(H.getCenterX()+V,H.getCenterY()+B)})}}},f.calcBoundingBox=function(p,g,m,y){for(var v=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,b=Number.MAX_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,k=void 0,E=void 0,_=p.descendants().not(":parent"),M=_.length,L=0;LC&&(v=C),Tk&&(b=k),w{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,y=u(140).layoutBase.FDLayoutConstants,v=u(140).CoSEConstants,T=function(w,C){var S=w.cy,k=w.eles,E=k.nodes(),_=k.edges(),M=void 0,L=void 0,P=void 0,D={};w.randomize&&(M=C.nodeIndexes,L=C.xCoords,P=C.yCoords);var R=function(G){return typeof G=="function"},I=function(G,H){return R(G)?G(H):G},$=h.calcParentsWithoutChildren(S,k),O=function B(G,H,q,Z){for(var Y=H.length,ie=0;ie0){var ee=void 0;ee=q.getGraphManager().add(q.newGraph(),te),B(ee,Q,q,Z)}}},N=function(G,H,q){for(var Z=0,Y=0,ie=0;ie0?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=Z/Y:R(w.idealEdgeLength)?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=w.idealEdgeLength,v.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,v.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},F=function(G,H){H.fixedNodeConstraint&&(G.constraints.fixedNodeConstraint=H.fixedNodeConstraint),H.alignmentConstraint&&(G.constraints.alignmentConstraint=H.alignmentConstraint),H.relativePlacementConstraint&&(G.constraints.relativePlacementConstraint=H.relativePlacementConstraint)};w.nestingFactor!=null&&(v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(v.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(v.MAX_ITERATIONS=y.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(v.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(v.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.tilingCompareBy!=null&&(v.TILING_COMPARE_BY=w.tilingCompareBy),w.quality=="proof"?m.QUALITY=2:m.QUALITY=0,v.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!w.randomize,v.ANIMATE=y.ANIMATE=m.ANIMATE=w.animate,v.TILE=w.tile,v.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,v.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,v.PURE_INCREMENTAL=!w.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!1),w.step=="enforced"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!1),w.step=="cose"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!0),w.step=="all"&&(w.randomize?v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!0),w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint?v.TREE_REDUCTION_ON_INCREMENTAL=!1:v.TREE_REDUCTION_ON_INCREMENTAL=!0;var z=new d,V=z.newGraphManager();return O(V.addRoot(),h.getTopMostNodes(E),z,w),N(z,V,_),F(z,w),z.runLayout(),D};o.exports={coseLayout:T}}),212:((o,l,u)=>{var h=(function(){function w(C,S){for(var k=0;k0)if($){var F=p.getTopMostNodes(k.eles.nodes());if(P=p.connectComponents(E,k.eles,F),P.forEach(function(Be){var ce=Be.boundingBox();D.push({x:ce.x1+ce.w/2,y:ce.y1+ce.h/2})}),k.randomize&&P.forEach(function(Be){k.eles=Be,M.push(m(k))}),k.quality=="default"||k.quality=="proof"){var z=E.collection();if(k.tile){var V=new Map,B=[],G=[],H=0,q={nodeIndexes:V,xCoords:B,yCoords:G},Z=[];if(P.forEach(function(Be,ce){Be.edges().length==0&&(Be.nodes().forEach(function(oe,be){z.merge(Be.nodes()[be]),oe.isParent()||(q.nodeIndexes.set(Be.nodes()[be].id(),H++),q.xCoords.push(Be.nodes()[0].position().x),q.yCoords.push(Be.nodes()[0].position().y))}),Z.push(ce))}),z.length>1){var Y=z.boundingBox();D.push({x:Y.x1+Y.w/2,y:Y.y1+Y.h/2}),P.push(z),M.push(q);for(var ie=Z.length-1;ie>=0;ie--)P.splice(Z[ie],1),M.splice(Z[ie],1),D.splice(Z[ie],1)}}P.forEach(function(Be,ce){k.eles=Be,L.push(v(k,M[ce])),p.relocateComponent(D[ce],L[ce],k)})}else P.forEach(function(Be,ce){p.relocateComponent(D[ce],M[ce],k)});var K=new Set;if(P.length>1){var Q=[],te=_.filter(function(Be){return Be.css("display")=="none"});P.forEach(function(Be,ce){var oe=void 0;if(k.quality=="draft"&&(oe=M[ce].nodeIndexes),Be.nodes().not(te).length>0){var be={};be.edges=[],be.nodes=[];var fe=void 0;Be.nodes().not(te).forEach(function(Pe){if(k.quality=="draft")if(!Pe.isParent())fe=oe.get(Pe.id()),be.nodes.push({x:M[ce].xCoords[fe]-Pe.boundingbox().w/2,y:M[ce].yCoords[fe]-Pe.boundingbox().h/2,width:Pe.boundingbox().w,height:Pe.boundingbox().h});else{var ve=p.calcBoundingBox(Pe,M[ce].xCoords,M[ce].yCoords,oe);be.nodes.push({x:ve.topLeftX,y:ve.topLeftY,width:ve.width,height:ve.height})}else L[ce][Pe.id()]&&be.nodes.push({x:L[ce][Pe.id()].getLeft(),y:L[ce][Pe.id()].getTop(),width:L[ce][Pe.id()].getWidth(),height:L[ce][Pe.id()].getHeight()})}),Be.edges().forEach(function(Pe){var ve=Pe.source(),Ce=Pe.target();if(ve.css("display")!="none"&&Ce.css("display")!="none")if(k.quality=="draft"){var Ve=oe.get(ve.id()),se=oe.get(Ce.id()),de=[],Te=[];if(ve.isParent()){var ae=p.calcBoundingBox(ve,M[ce].xCoords,M[ce].yCoords,oe);de.push(ae.topLeftX+ae.width/2),de.push(ae.topLeftY+ae.height/2)}else de.push(M[ce].xCoords[Ve]),de.push(M[ce].yCoords[Ve]);if(Ce.isParent()){var he=p.calcBoundingBox(Ce,M[ce].xCoords,M[ce].yCoords,oe);Te.push(he.topLeftX+he.width/2),Te.push(he.topLeftY+he.height/2)}else Te.push(M[ce].xCoords[se]),Te.push(M[ce].yCoords[se]);be.edges.push({startX:de[0],startY:de[1],endX:Te[0],endY:Te[1]})}else L[ce][ve.id()]&&L[ce][Ce.id()]&&be.edges.push({startX:L[ce][ve.id()].getCenterX(),startY:L[ce][ve.id()].getCenterY(),endX:L[ce][Ce.id()].getCenterX(),endY:L[ce][Ce.id()].getCenterY()})}),be.nodes.length>0&&(Q.push(be),K.add(ce))}});var J=I.packComponents(Q,k.randomize).shifts;if(k.quality=="draft")M.forEach(function(Be,ce){var oe=Be.xCoords.map(function(fe){return fe+J[ce].dx}),be=Be.yCoords.map(function(fe){return fe+J[ce].dy});Be.xCoords=oe,Be.yCoords=be});else{var ge=0;K.forEach(function(Be){Object.keys(L[Be]).forEach(function(ce){var oe=L[Be][ce];oe.setCenter(oe.getCenterX()+J[ge].dx,oe.getCenterY()+J[ge].dy)}),ge++})}}}else{var O=k.eles.boundingBox();if(D.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),k.randomize){var N=m(k);M.push(N)}k.quality=="default"||k.quality=="proof"?(L.push(v(k,M[0])),p.relocateComponent(D[0],L[0],k)):p.relocateComponent(D[0],M[0],k)}var ee=function(ce,oe){if(k.quality=="default"||k.quality=="proof"){typeof ce=="number"&&(ce=oe);var be=void 0,fe=void 0,Pe=ce.data("id");return L.forEach(function(Ce){Pe in Ce&&(be={x:Ce[Pe].getRect().getCenterX(),y:Ce[Pe].getRect().getCenterY()},fe=Ce[Pe])}),k.nodeDimensionsIncludeLabels&&(fe.labelWidth&&(fe.labelPosHorizontal=="left"?be.x+=fe.labelWidth/2:fe.labelPosHorizontal=="right"&&(be.x-=fe.labelWidth/2)),fe.labelHeight&&(fe.labelPosVertical=="top"?be.y+=fe.labelHeight/2:fe.labelPosVertical=="bottom"&&(be.y-=fe.labelHeight/2))),be==null&&(be={x:ce.position("x"),y:ce.position("y")}),{x:be.x,y:be.y}}else{var ve=void 0;return M.forEach(function(Ce){var Ve=Ce.nodeIndexes.get(ce.id());Ve!=null&&(ve={x:Ce.xCoords[Ve],y:Ce.yCoords[Ve]})}),ve==null&&(ve={x:ce.position("x"),y:ce.position("y")}),{x:ve.x,y:ve.y}}};if(k.quality=="default"||k.quality=="proof"||k.randomize){var Re=p.calcParentsWithoutChildren(E,_),Ie=_.filter(function(Be){return Be.css("display")=="none"});k.eles=_.not(Ie),_.nodes().not(":parent").not(Ie).layoutPositions(S,k,ee),Re.length>0&&Re.forEach(function(Be){Be.position(ee(Be))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w})();o.exports=b}),657:((o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var y=m.cy,v=m.eles,T=v.nodes(),b=v.nodes(":parent"),w=new Map,C=new Map,S=new Map,k=[],E=[],_=[],M=[],L=[],P=[],D=[],R=[],I=void 0,$=1e8,O=1e-9,N=m.piTol,F=m.samplingType,z=m.nodeSeparation,V=void 0,B=function(){for(var j=0,ue=0,X=!1;ue=xe;){_e=Oe[xe++];for(var Ae=k[_e],at=0;atHe&&(He=L[pt],De=pt)}return De},H=function(j){var ue=void 0;if(j){ue=Math.floor(Math.random()*I);for(var Oe=0;Oe=1)break;Me=$e}for(var Ke=0;Ke=1)break;Me=$e}for(var at=0;at0&&(ue.isParent()?k[j].push(S.get(ue.id())):k[j].push(ue.id()))})});var Ie=function(j){var ue=C.get(j),X=void 0;w.get(j).forEach(function(Oe){y.getElementById(Oe).isParent()?X=S.get(Oe):X=Oe,k[ue].push(X),k[C.get(X)].push(j)})},Be=!0,ce=!1,oe=void 0;try{for(var be=w.keys()[Symbol.iterator](),fe;!(Be=(fe=be.next()).done);Be=!0){var Pe=fe.value;Ie(Pe)}}catch(ne){ce=!0,oe=ne}finally{try{!Be&&be.return&&be.return()}finally{if(ce)throw oe}}I=C.size;var ve=void 0;if(I>2){V=I{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d}),140:(o=>{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(579);return s})()})})(t5)),t5.exports}var $Nt=ONt();const PNt=eg($Nt);var cae={L:"left",R:"right",T:"top",B:"bottom"},uae={L:x(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:x(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:x(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:x(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},R4={L:x((t,e)=>t-e+2,"L"),R:x((t,e)=>t-2,"R"),T:x((t,e)=>t-e+2,"T"),B:x((t,e)=>t-2,"B")},BNt=x(function(t){return Ns(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),hae=x(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),Ns=x(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),bf=x(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),jU=x(function(t,e){const r=Ns(t)&&bf(e),n=bf(t)&&Ns(e);return r||n},"isArchitectureDirectionXY"),FNt=x(function(t){const e=t[0],r=t[1],n=Ns(e)&&bf(r),i=bf(e)&&Ns(r);return n||i},"isArchitecturePairXY"),zNt=x(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),lF=x(function(t,e){const r=`${t}${e}`;return zNt(r)?r:void 0},"getArchitectureDirectionPair"),VNt=x(function([t,e],r){const n=r[0],i=r[1];return Ns(n)?bf(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:Ns(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),GNt=x(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),WNt=x(function(t,e){return jU(t,e)?"bend":Ns(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),HNt=x(function(t){return t.type==="service"},"isArchitectureService"),qNt=x(function(t){return t.type==="junction"},"isArchitectureJunction"),gRe=x((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),mRe=x(t=>t.data(),"edgeData"),sy=x(t=>t.data(),"nodeData"),UNt=Vr.architecture,lb,yRe=(lb=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Hn,this.getAccTitle=ni,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getAccDescription=ai,this.setAccDescription=ii,this.clear()}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",$n()}addService({id:e,icon:r,in:n,title:i,iconText:a}){if(this.registeredIds.has(e))throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(n)==="node")throw new Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"service",icon:r,iconText:a,title:i,edges:[],in:n})}getServices(){return[...this.nodes.values()].filter(HNt)}addJunction({id:e,in:r}){if(this.registeredIds.has(e))throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(r!==void 0){if(e===r)throw new Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(r))throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(r)==="node")throw new Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"junction",edges:[],in:r})}getJunctions(){return[...this.nodes.values()].filter(qNt)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:r,in:n,title:i}){if(this.registeredIds.has(e))throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(n)==="node")throw new Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,"group"),this.groups.set(e,{id:e,icon:r,title:i,in:n})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:r,lhsDir:n,rhsDir:i,lhsInto:a,rhsInto:s,lhsGroup:o,rhsGroup:l,title:u}){if(!hae(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!hae(i))throw new Error(`Invalid direction given for right hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(i)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(r)&&!this.groups.has(r))throw new Error(`The right-hand id [${r}] does not yet exist. Please create the service/group before declaring an edge to it.`);const h=this.nodes.get(e).in,d=this.nodes.get(r).in;if(o&&h&&d&&h==d)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&d&&h==d)throw new Error(`The right-hand id [${r}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:e,lhsDir:n,lhsInto:a,lhsGroup:o,rhsId:r,rhsDir:i,rhsInto:s,rhsGroup:l,title:u};this.edges.push(f);const p=this.nodes.get(e),g=this.nodes.get(r);p&&g&&(p.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw new Error(`An align directive requires at least two members; got ${e.members.length}`);const r=new Set;e.members.forEach(n=>{if(this.registeredIds.get(n)!=="node")throw new Error(`align ${e.direction} references [${n}], which is not a service or junction`);if(r.has(n))throw new Error(`align ${e.direction} lists [${n}] more than once`);r.add(n)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){var e,r;if(this.dataStructures===void 0){const n=new Map,i=new Map;for(const[u,h]of this.nodes.entries()){const d=new Map;for(const f of h.edges){const p=(e=this.getNode(f.lhsId))==null?void 0:e.in,g=(r=this.getNode(f.rhsId))==null?void 0:r.in;if(p&&g&&p!==g){const m=WNt(f.lhsDir,f.rhsDir);m!=="bend"&&n.set(gRe(p,g),m)}if(f.lhsId===u){const m=lF(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=lF(f.rhsDir,f.lhsDir);m&&d.set(m,f.lhsId)}}i.set(u,d)}const a=new Set,s=new Set(i.keys()),o=x(u=>{const h=new Map([[u,[0,0]]]),d=[u];for(;d.length>0;){const f=d.shift();if(f){a.add(f),s.delete(f);const p=i.get(f);if(!p)throw new Error(`BFS error: adjacency list for id ${f} not found. Please report this as a bug.`);const g=h.get(f);if(!g)throw new Error(`BFS error: position for id ${f} not found in spatial map. Please report this as a bug.`);const[m,y]=g;p.forEach((v,T)=>{a.has(v)||(h.set(v,VNt([m,y],T)),d.push(v))})}}return h},"BFS"),l=[];for(;s.size>0;){const u=s.values().next().value;l.push(o(u))}this.dataStructures={adjList:i,spatialMaps:l,groupAlignments:n}}return this.dataStructures}setElementForId(e,r){this.elements.set(e,r)}getElementById(e){return this.elements.get(e)}getConfig(){return ri({...UNt,...Xt().architecture})}getConfigField(e){return this.getConfig()[e]}},x(lb,"ArchitectureDB"),lb),YNt=x((t,e)=>{var r;eo(t,e),t.groups.map(n=>e.addGroup(n)),t.services.map(n=>e.addService({...n,type:"service"})),t.junctions.map(n=>e.addJunction({...n,type:"junction"})),t.edges.map(n=>e.addEdge(n)),(r=t.alignments)==null||r.map(n=>e.addLayoutHint({direction:n.direction,members:[...n.members]}))},"populateDb"),vRe={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Al("architecture",t);le.debug(e);const r=(n=vRe.parser)==null?void 0:n.yy;if(!(r instanceof yRe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");YNt(e,r)},"parse")},XNt=x(t=>` .edge { stroke-width: ${t.archEdgeWidth}; stroke: ${t.archEdgeColor}; @@ -3429,19 +3431,19 @@ Expecting `+J.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ge="Parse error o display: -webkit-box; -webkit-box-orient: vertical; } -`,"getStyles"),UNt=qNt;function cF(t,e){if(t===0)return e();const r=Math.random;let n=t>>>0;Math.random=function(){n=n+1831565813>>>0;let i=n;return i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61),((i^i>>>14)>>>0)/4294967296};try{return e()}finally{Math.random=r}}x(cF,"withSeededRandom");var um=x(t=>`${t}`,"wrapIcon"),Ok={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:um('')},server:{body:um('')},disk:{body:um('')},internet:{body:um('')},cloud:{body:um('')},unknown:Ode,blank:{body:um("")}}},YNt=x(async function(t,e,r,n){const i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),s=a/2,o=a/6,l=o/2;await Promise.all(e.edges().map(async u=>{var M,L;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:y,targetGroup:v,label:T}=gRe(u);let{x:b,y:w}=u[0].sourceEndpoint();const{x:C,y:S}=u[0].midpoint();let{x:k,y:E}=u[0].targetEndpoint();const _=i+4;if(p&&(Ns(d)?b+=d==="L"?-_:_:w+=d==="T"?-_:_+18),v&&(Ns(m)?k+=m==="L"?-_:_:E+=m==="T"?-_:_+18),!p&&((M=r.getNode(h))==null?void 0:M.type)==="junction"&&(Ns(d)?b+=d==="L"?s:-s:w+=d==="T"?s:-s),!v&&((L=r.getNode(g))==null?void 0:L.type)==="junction"&&(Ns(m)?k+=m==="L"?s:-s:E+=m==="T"?s:-s),u[0]._private.rscratch){const P=t.insert("g");if(P.insert("path").attr("d",`M ${b},${w} L ${C},${S} L${k},${E} `).attr("class","edge").attr("id",`${n}-${dy(h,g,{prefix:"L"})}`),f){const D=Ns(d)?R4[d](b,o):b-l,R=bf(d)?R4[d](w,o):w-l;P.insert("polygon").attr("points",cae[d](o)).attr("transform",`translate(${D},${R})`).attr("class","arrow")}if(y){const D=Ns(m)?R4[m](k,o):k-l,R=bf(m)?R4[m](E,o):E-l;P.insert("polygon").attr("points",cae[m](o)).attr("transform",`translate(${D},${R})`).attr("class","arrow")}if(T){const D=jU(d,m)?"XY":Ns(d)?"X":"Y";let R=0;D==="X"?R=Math.abs(b-k):D==="Y"?R=Math.abs(w-E)/1.5:R=Math.abs(b-k)/2;const I=P.append("g");if(await ws(I,T,{useHtmlLabels:!1,width:R,classes:"architecture-service-label"},Fe()),I.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),D==="X")I.attr("transform","translate("+C+", "+S+")");else if(D==="Y")I.attr("transform","translate("+C+", "+S+") rotate(-90)");else if(D==="XY"){const $=lF(d,m);if($&&$Nt($)){const O=I.node().getBoundingClientRect(),[N,F]=FNt($);I.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*N*F*45})`);const z=I.node().getBoundingClientRect();I.attr("transform",` +`,"getStyles"),jNt=XNt;function cF(t,e){if(t===0)return e();const r=Math.random;let n=t>>>0;Math.random=function(){n=n+1831565813>>>0;let i=n;return i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61),((i^i>>>14)>>>0)/4294967296};try{return e()}finally{Math.random=r}}x(cF,"withSeededRandom");var um=x(t=>`${t}`,"wrapIcon"),Ok={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:um('')},server:{body:um('')},disk:{body:um('')},internet:{body:um('')},cloud:{body:um('')},unknown:$de,blank:{body:um("")}}},KNt=x(async function(t,e,r,n){const i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),s=a/2,o=a/6,l=o/2;await Promise.all(e.edges().map(async u=>{var M,L;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:y,targetGroup:v,label:T}=mRe(u);let{x:b,y:w}=u[0].sourceEndpoint();const{x:C,y:S}=u[0].midpoint();let{x:k,y:E}=u[0].targetEndpoint();const _=i+4;if(p&&(Ns(d)?b+=d==="L"?-_:_:w+=d==="T"?-_:_+18),v&&(Ns(m)?k+=m==="L"?-_:_:E+=m==="T"?-_:_+18),!p&&((M=r.getNode(h))==null?void 0:M.type)==="junction"&&(Ns(d)?b+=d==="L"?s:-s:w+=d==="T"?s:-s),!v&&((L=r.getNode(g))==null?void 0:L.type)==="junction"&&(Ns(m)?k+=m==="L"?s:-s:E+=m==="T"?s:-s),u[0]._private.rscratch){const P=t.insert("g");if(P.insert("path").attr("d",`M ${b},${w} L ${C},${S} L${k},${E} `).attr("class","edge").attr("id",`${n}-${dy(h,g,{prefix:"L"})}`),f){const D=Ns(d)?R4[d](b,o):b-l,R=bf(d)?R4[d](w,o):w-l;P.insert("polygon").attr("points",uae[d](o)).attr("transform",`translate(${D},${R})`).attr("class","arrow")}if(y){const D=Ns(m)?R4[m](k,o):k-l,R=bf(m)?R4[m](E,o):E-l;P.insert("polygon").attr("points",uae[m](o)).attr("transform",`translate(${D},${R})`).attr("class","arrow")}if(T){const D=jU(d,m)?"XY":Ns(d)?"X":"Y";let R=0;D==="X"?R=Math.abs(b-k):D==="Y"?R=Math.abs(w-E)/1.5:R=Math.abs(b-k)/2;const I=P.append("g");if(await ws(I,T,{useHtmlLabels:!1,width:R,classes:"architecture-service-label"},Fe()),I.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),D==="X")I.attr("transform","translate("+C+", "+S+")");else if(D==="Y")I.attr("transform","translate("+C+", "+S+") rotate(-90)");else if(D==="XY"){const $=lF(d,m);if($&&FNt($)){const O=I.node().getBoundingClientRect(),[N,F]=GNt($);I.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*N*F*45})`);const z=I.node().getBoundingClientRect();I.attr("transform",` translate(${C}, ${S-O.height/2}) translate(${N*z.width/2}, ${F*z.height/2}) rotate(${-1*N*F*45}, 0, ${O.height/2}) - `)}}}}}))},"drawEdges"),XNt=x(async function(t,e,r,n){const a=r.getConfigField("padding")*.75,s=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=sy(u);if(h.type==="group"){const{h:d,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${h.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",d).attr("class","node-bkg");const y=t.append("g");let v=p,T=g;if(h.icon){const b=y.append("g");b.html(`${await bh(h.icon,{height:a,width:a,fallbackPrefix:Ok.prefix})}`),b.attr("transform","translate("+(v+l+1)+", "+(T+l+1)+")"),v+=a,T+=s/2-1-2}if(h.label){const b=y.append("g");await ws(b,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},Fe()),b.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),b.attr("transform","translate("+(v+l+4)+", "+(T+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),jNt=x(async function(t,e,r,n){const i=Fe();for(const a of r){const s=e.append("g"),o=t.getConfigField("iconSize");if(a.title){const d=s.append("g");await ws(d,a.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},i),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+o/2+", "+o+")")}const l=s.append("g");if(a.icon)l.html(`${await bh(a.icon,{height:o,width:o,fallbackPrefix:Ok.prefix})}`);else if(a.iconText){l.html(`${await bh("blank",{height:o,width:o,fallbackPrefix:Ok.prefix})}`);const p=l.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(Wr(a.iconText,i)),g=parseInt(window.getComputedStyle(p.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;p.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);s.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");const{width:u,height:h}=s.node().getBBox();a.width=u,a.height=h,t.setElementForId(a.id,s)}return 0},"drawServices"),KNt=x(function(t,e,r,n){r.forEach(i=>{const a=e.append("g"),s=t.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",s).attr("height",s),a.attr("class","architecture-junction");const{width:l,height:u}=a._groups[0][0].getBBox();a.width=l,a.height=u,t.setElementForId(i.id,a)})},"drawJunctions");pV([{name:Ok.prefix,icons:Ok}]);eu.use(DNt);function vRe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}x(vRe,"addServices");function bRe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}x(bRe,"addJunctions");function xRe(t,e){e.nodes().map(r=>{const n=sy(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}x(xRe,"positionNodes");function TRe(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}x(TRe,"addGroups");function wRe(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:s,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=jU(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:s,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}x(wRe,"addEdges");function CRe(t,e,r,n=[]){const i=x((f,p)=>{const g=new Map;for(const[m,y]of f.entries()){const v=`${m}`;let T=0;const b=[...y.entries()];if(b.length===1){g.set(v,b[0][1]);continue}for(let w=0;w{const p=new Map,g=new Map;return f.forEach(([m,y],v)=>{var C;const T=((C=t.getNode(v))==null?void 0:C.in)??"default",b=p.get(y)??new Map;p.has(y)||p.set(y,b);const w=g.get(m)??new Map;g.has(m)||g.set(m,w);for(const S of[b,w]){const k=S.get(T)??[];S.has(T)||S.set(T,k),k.push(v)}}),{horiz:[...i(p,"horizontal").values()].filter(m=>m.length>1),vert:[...i(g,"vertical").values()].filter(m=>m.length>1)}}),[s,o]=a.reduce(([f,p],{horiz:g,vert:m})=>[[...f,...g],[...p,...m]],[[],[]]),l=new Set;n.forEach(f=>f.members.forEach(p=>l.add(p)));const u=x(f=>f.filter(p=>!p.some(g=>l.has(g))),"dropOverlapping"),h=u(s),d=u(o);return n.forEach(f=>{f.members.length<2||(f.direction==="row"?h.push([...f.members]):d.push([...f.members]))}),{horizontal:h,vertical:d}}x(CRe,"getAlignments");function kRe(t,e,r=[]){const n=[],i=e.getConfigField("iconSize"),a=e.getConfigField("idealEdgeLengthMultiplier"),s=a*i,o=new Set;r.forEach(h=>{for(let d=0;d`${h[0]},${h[1]}`,"posToStr"),u=x(h=>h.split(",").map(d=>parseInt(d)),"strToPos");return t.forEach(h=>{const d=new Map([...h.entries()].map(([m,y])=>[l(y),m])),f=[l([0,0])],p={},g={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;f.length>0;){const m=f.shift();if(m){p[m]=1;const y=d.get(m);if(y){const v=u(m);Object.entries(g).forEach(([T,b])=>{const w=l([v[0]+b[0],v[1]+b[1]]),C=d.get(w);if(C&&!p[w]){if(f.push(w),o.has(`${y}|${C}`))return;n.push({[lae[T]]:C,[lae[ONt(T)]]:y,gap:a*i})}})}}}}),n}x(kRe,"getRelativeConstraints");function SRe(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=ut("body").append("div").attr("id","cy").attr("style","display:none"),u=eu({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),TRe(r,u),vRe(t,u,i),bRe(e,u,i),wRe(n,u);const h=i.getLayoutHints(),d=CRe(i,a,s,h),f=kRe(a,i,h),p=i.getConfigField("iconSize"),g=i.getConfigField("idealEdgeLengthMultiplier")*p,m=.5*p,y=i.getConfigField("edgeElasticity"),v=i.getConfigField("seed"),T=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(b){const[w,C]=b.connectedNodes(),{parent:S}=sy(w),{parent:k}=sy(C);return S===k?g:m},edgeElasticity(b){const[w,C]=b.connectedNodes(),{parent:S}=sy(w),{parent:k}=sy(C);return S===k?y:.001},alignmentConstraint:d,relativePlacementConstraint:f});T.one("layoutstop",()=>{var w;function b(C,S,k,E){let _,M;const{x:L,y:P}=C,{x:D,y:R}=S;M=(E-P+(L-k)*(P-R)/(L-D))/Math.sqrt(1+Math.pow((P-R)/(L-D),2)),_=Math.sqrt(Math.pow(E-P,2)+Math.pow(k-L,2)-Math.pow(M,2));const I=Math.sqrt(Math.pow(D-L,2)+Math.pow(R-P,2));_=_/I;let $=(D-L)*(E-P)-(R-P)*(k-L);switch(!0){case $>=0:$=1;break;case $<0:$=-1;break}let O=(D-L)*(k-L)+(R-P)*(E-P);switch(!0){case O>=0:O=1;break;case O<0:O=-1;break}return M=Math.abs(M)*$,_=_*O,{distances:M,weights:_}}x(b,"getSegmentWeights"),u.startBatch();for(const C of Object.values(u.edges()))if((w=C.data)!=null&&w.call(C)){const{x:S,y:k}=C.source().position(),{x:E,y:_}=C.target().position();if(S!==E&&k!==_){const M=C.sourceEndpoint(),L=C.targetEndpoint(),{sourceDir:P}=gRe(C),[D,R]=bf(P)?[M.x,L.y]:[L.x,M.y],{weights:I,distances:$}=b(M,L,D,R);C.style("segment-distances",$),C.style("segment-weights",I)}}u.endBatch(),cF(v,()=>T.run())});try{cF(v,()=>T.run())}catch(b){throw b instanceof RangeError&&b.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):b}u.ready(b=>{le.info("Ready",b),o(u)})})}x(SRe,"layoutArchitecture");var ZNt=x(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=xs(e),d=h.append("g");d.attr("class","architecture-edges");const f=h.append("g");f.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await jNt(i,f,a,e),KNt(i,f,s,e);const g=await SRe(a,s,o,l,i,u);await YNt(d,g,i,e),await XNt(p,g,i,e),xRe(i,g),mx(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),QNt={draw:ZNt},JNt={parser:yRe,get db(){return new mRe},renderer:QNt,styles:UNt};const eDt=Object.freeze(Object.defineProperty({__proto__:null,diagram:JNt},Symbol.toStringTag,{value:"Module"}));var ERe="position frame",ARe="frame positioned",uF="position relation",_Re="relation positioned",tDt=x(function(t){le.debug("options str",t)},"setOptions"),rDt=x(function(){return{}},"getOptions"),nDt=x(function(){RRe(),On()},"clear");function RRe(){KU={}}x(RRe,"reset");var iDt=Vr.eventmodeling,aDt=x(()=>ri({...iDt,...Xt().eventmodeling}),"getConfig"),KU={};function LRe(){let t=sDt;const{ast:e}=KU,r=ZU();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=PRe(n,e.dataEntities,r);t=a5(t,{$kind:ERe,index:i,frame:n,textProps:a});let s;WRe(n)?(le.debug("source frame",n.sourceFrames),s=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),s.forEach(o=>{t=a5(t,{$kind:uF,index:i,frame:n,sourceFrame:o})})):t=a5(t,{$kind:uF,index:i,frame:n})}),t={...t,sortedSwimlanesArray:QU(t.swimlanes)},t}x(LRe,"getState");function MRe(t){KU.ast=t}x(MRe,"setAst");var hn={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function ZU(){return hn}x(ZU,"getDiagramProps");var sDt={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function IRe(t){const e=t.split(".");if(e.length===2)return e[0]}x(IRe,"extractNamespace");function NRe(t){const e=t.split(".");return e.length===2?e[1]:t}x(NRe,"extractName");function DRe(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}x(DRe,"findSwimlaneByNamespace");function i5(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}x(i5,"findNextAvailableIndex");function ORe(t,e){const r=IRe(t.entityIdentifier),n=DRe(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||hn.labelUiAutomation}:r?{index:i5(e,0,100),label:hn.labelUiAutomationPrefix+r}:{index:0,label:hn.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||hn.labelCommandReadModel}:r?{index:i5(e,100,200),label:hn.labelCommandReadModelPrefix+r}:{index:100,label:hn.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||hn.labelEvents}:r?{index:i5(e,200,300),label:hn.labelEventsPrefix+r}:{index:200,label:hn.labelEvents}}}x(ORe,"calculateSwimlaneProps");function $Re(t){const{themeVariables:e}=Xt();switch(t.modelEntityType){case"ui":return{fill:e.emUiFill??"white",stroke:e.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:e.emProcessorFill??"#edb3f6",stroke:e.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:e.emReadModelFill??"#d3f1a2",stroke:e.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:e.emCommandFill??"#bcd6fe",stroke:e.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:e.emEventFill??"#ffb778",stroke:e.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}x($Re,"calculateEntityVisualProps");function PRe(t,e,r){const n=Xt(),i=Wr(NRe(t.entityIdentifier)??"",n);let a;const s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let l=`${Fw(i,r.textMaxWidth,s)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=Wr(a,n),a=Fw(a,r.textMaxWidth,s),a=a.replaceAll(" "," ")),t.dataReference){const g=e.find(m=>{var y;return m.name===((y=t.dataReference)==null?void 0:y.$refText)});g&&(a=g.dataBlockValue,a=a.substring(a.indexOf(`{ -`)+2),a=a.substring(0,a.lastIndexOf("}")-1),a=Wr(a,n),a=Fw(a,r.textMaxWidth,s),a=a.replaceAll(" "," "),a+="
")}const u=a!==void 0;u&&(l+=`

${a}`);const h={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},d=pR(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return le.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}x(PRe,"calculateTextProps");function BRe(t,e){const r=e,n=$Re(r.frame),i={width:r.textProps.width+2*hn.boxTextPadding,height:r.textProps.height+2*hn.boxTextPadding};return[{$kind:ARe,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}x(BRe,"decidePositionFrame");function FRe(t,e,r){return e===void 0?hn.contentStartX:e.index===t.index&&t.r?t.r+hn.boxPadding:r===void 0?hn.contentStartX:r.r-hn.boxOverlap+hn.boxPadding}x(FRe,"calculateX");function zRe(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}x(zRe,"calculateMaxRight");function QU(t){return Object.values(t).sort((e,r)=>e.index-r.index)}x(QU,"sortedSwimlanesArray");function VRe(t,e){const r=e,n=ORe(r.frame,t.swimlanes);let i;n.index in t.swimlanes?i=t.swimlanes[n.index]:i={index:n.index,label:n.label,r:0,y:n.index*hn.swimlaneMinHeight+hn.swimlaneGap,height:hn.swimlaneMinHeight,maxHeight:hn.swimlaneMinHeight};const a=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,s=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,o={width:Math.max(hn.boxMinWidth,Math.min(hn.boxMaxWidth,r.dimension.width))+2*hn.boxPadding,height:Math.max(hn.boxMinHeight,Math.min(hn.boxMaxHeight,r.dimension.height))+2*hn.boxPadding},l=FRe(i,s,a),u=l+o.width+hn.boxPadding,h=zRe(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(hn.swimlaneMinHeight,i.maxHeight)+2*hn.swimlanePadding;const d={x:l,y:hn.swimlanePadding+i.y,r:u,dimension:o,leftSibling:!1,swimlane:i,visual:r.visual,text:r.textProps.content,frame:r.frame,index:r.index},f={...t,boxes:[...t.boxes,d],swimlanes:{...t.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:r.frame,maxR:h},p=QU(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}x(WRe,"hasSourceFrame");function hF(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}x(hF,"findBoxByFrame");function HRe(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}x(HRe,"findBoxByLineIndex");function qRe(t,e){const r=e;if(eAe(r.frame)||GRe(r.index,r.frame))return[];const n=hF(t.boxes,r.frame);if(n===void 0)throw new Error(`Target box not found for frame ${r.frame.name}`);let i;return r.sourceFrame?i=hF(t.boxes,r.sourceFrame):i=HRe(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:_Re,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}x(qRe,"decidePositionRelation");function URe(t,e){const r=e,n={visual:{fill:"none",stroke:"#000"},source:{x:r.sourceBox.x,y:r.sourceBox.y},target:{x:r.targetBox.x,y:r.targetBox.y},sourceBox:r.sourceBox,targetBox:r.targetBox};return{...t,relations:[...t.relations,n]}}x(URe,"evolveRelationPositioned");var oDt={[ERe]:BRe,[uF]:qRe},lDt={[ARe]:VRe,[_Re]:URe};function YRe(t,e){const r=oDt[e.$kind];if(r==null)return[];const n=r(t,e);return le.debug("decided events",n),n}x(YRe,"decide");function XRe(t,e){const r=e.reduce((n,i)=>{const a=lDt[i.$kind];return a==null?n:a(n,i)},t);return le.debug("evolve events",{state:t,newState:r,events:e}),r}x(XRe,"evolve");function a5(t,e){const r=YRe(t,e);return XRe(t,r)}x(a5,"dispatch");var dF={getConfig:aDt,setOptions:tDt,getOptions:rDt,clear:nDt,setAccTitle:Hn,getAccTitle:ni,getAccDescription:ai,setAccDescription:ii,setDiagramTitle:ti,getDiagramTitle:Yn,setAst:MRe,getDiagramProps:ZU,getState:LRe},cDt={parse:x(async t=>{const e=await Al("eventmodeling",t);le.debug(e),dF.setAst(e),eo(e,dF)},"parse")},XN=Fe(),uDt=XN==null?void 0:XN.eventmodeling;function jRe(t,e){return r=>{const n=r.swimlane.y+e.swimlanePadding,i=t.append("g").attr("class","em-box");i.append("rect").attr("x",r.x).attr("y",n).attr("rx","3").attr("width",r.dimension.width).attr("height",r.dimension.height).attr("stroke",r.visual.stroke).attr("fill",r.visual.fill),i.append("foreignObject").attr("x",r.x+e.boxPadding).attr("y",n+10).attr("width",r.dimension.width-2*e.boxPadding).attr("height",r.dimension.height-2*e.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(r.text)}}x(jRe,"renderD3Box");function KRe(t,e){return t>e}x(KRe,"dirUpwards");function ZRe(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,s=i.targetBox.swimlane.y+e.swimlanePadding,o=KRe(a,s),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;le.debug(`rendering relation up=${o} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),o?(h=a,d=s+i.targetBox.dimension.height):(h=a+i.sourceBox.dimension.height,d=s);const f=n.emRelationStroke??i.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${r})`).attr("d",`M${l} ${h} L${u} ${d}`)}}x(ZRe,"renderD3Relation");function QRe(t,e,r,n){return i=>{const a=t.append("g").attr("class","em-swimlane"),s=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",o=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";a.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",e+r.swimlanePadding).attr("height",i.height).attr("fill",s).attr("stroke",o),a.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}x(QRe,"renderD3Swimlane");var hDt=x(function(t,e,r,n){if(le.debug("in eventmodeling renderer",t+` -`,"id:",e,r),!uDt)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:s}=Fe(),o=ut(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(QRe(o,u.maxR,l,a)),u.boxes.forEach(jRe(o,l)),u.relations.forEach(ZRe(o,l,h,a)),o.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",d),Mz(void 0,o,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),dDt={draw:hDt},fDt=x(t=>"","getStyles"),pDt=fDt,gDt={parser:cDt,db:dF,renderer:dDt,styles:pDt};const mDt=Object.freeze(Object.defineProperty({__proto__:null,diagram:gDt},Symbol.toStringTag,{value:"Module"}));var fF=(function(){var t=x(function(v,T,b,w){for(b=b||{},w=v.length;w--;b[v[w]]=T);return b},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],a=[6,7,8],s=[1,20],o=[1,18],l=[1,19],u=[6,7,11],h=[1,6,13,14],d=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:x(function(T,b,w,C,S,k,E){var _=k.length-1;switch(S){case 6:case 7:return C;case 15:C.addNode(k[_-1].length,k[_].trim());break;case 16:C.addNode(0,k[_].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:i},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:s,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:o,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},t(h,[2,14],{7:d,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(h,[2,13],{7:d,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(T,b){if(b.recoverable)this.trace(T);else{var w=new Error(T);throw w.hash=b,w}},"parseError"),parse:x(function(T){var b=this,w=[0],C=[],S=[null],k=[],E=this.table,_="",M=0,L=0,P=2,D=1,R=k.slice.call(arguments,1),I=Object.create(this.lexer),$={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&($.yy[O]=this.yy[O]);I.setInput(T,$.yy),$.yy.lexer=I,$.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var N=I.yylloc;k.push(N);var F=I.options&&I.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(J){w.length=w.length-2*J,S.length=S.length-J,k.length=k.length-J}x(z,"popStack");function V(){var J;return J=C.pop()||I.lex()||D,typeof J!="number"&&(J instanceof Array&&(C=J,J=C.pop()),J=b.symbols_[J]||J),J}x(V,"lex");for(var B,G,H,q,Z={},Y,ie,K,Q;;){if(G=w[w.length-1],this.defaultActions[G]?H=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=V()),H=E[G]&&E[G][B]),typeof H>"u"||!H.length||!H[0]){var te="";Q=[];for(Y in E[G])this.terminals_[Y]&&Y>P&&Q.push("'"+this.terminals_[Y]+"'");I.showPosition?te="Parse error on line "+(M+1)+`: + `)}}}}}))},"drawEdges"),ZNt=x(async function(t,e,r,n){const a=r.getConfigField("padding")*.75,s=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=sy(u);if(h.type==="group"){const{h:d,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${h.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",d).attr("class","node-bkg");const y=t.append("g");let v=p,T=g;if(h.icon){const b=y.append("g");b.html(`${await bh(h.icon,{height:a,width:a,fallbackPrefix:Ok.prefix})}`),b.attr("transform","translate("+(v+l+1)+", "+(T+l+1)+")"),v+=a,T+=s/2-1-2}if(h.label){const b=y.append("g");await ws(b,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},Fe()),b.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),b.attr("transform","translate("+(v+l+4)+", "+(T+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),QNt=x(async function(t,e,r,n){const i=Fe();for(const a of r){const s=e.append("g"),o=t.getConfigField("iconSize");if(a.title){const d=s.append("g");await ws(d,a.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},i),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+o/2+", "+o+")")}const l=s.append("g");if(a.icon)l.html(`${await bh(a.icon,{height:o,width:o,fallbackPrefix:Ok.prefix})}`);else if(a.iconText){l.html(`${await bh("blank",{height:o,width:o,fallbackPrefix:Ok.prefix})}`);const p=l.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(Wr(a.iconText,i)),g=parseInt(window.getComputedStyle(p.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;p.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);s.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");const{width:u,height:h}=s.node().getBBox();a.width=u,a.height=h,t.setElementForId(a.id,s)}return 0},"drawServices"),JNt=x(function(t,e,r,n){r.forEach(i=>{const a=e.append("g"),s=t.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",s).attr("height",s),a.attr("class","architecture-junction");const{width:l,height:u}=a._groups[0][0].getBBox();a.width=l,a.height=u,t.setElementForId(i.id,a)})},"drawJunctions");pV([{name:Ok.prefix,icons:Ok}]);eu.use(PNt);function bRe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}x(bRe,"addServices");function xRe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}x(xRe,"addJunctions");function TRe(t,e){e.nodes().map(r=>{const n=sy(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}x(TRe,"positionNodes");function wRe(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}x(wRe,"addGroups");function CRe(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:s,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=jU(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:s,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}x(CRe,"addEdges");function kRe(t,e,r,n=[]){const i=x((f,p)=>{const g=new Map;for(const[m,y]of f.entries()){const v=`${m}`;let T=0;const b=[...y.entries()];if(b.length===1){g.set(v,b[0][1]);continue}for(let w=0;w{const p=new Map,g=new Map;return f.forEach(([m,y],v)=>{var C;const T=((C=t.getNode(v))==null?void 0:C.in)??"default",b=p.get(y)??new Map;p.has(y)||p.set(y,b);const w=g.get(m)??new Map;g.has(m)||g.set(m,w);for(const S of[b,w]){const k=S.get(T)??[];S.has(T)||S.set(T,k),k.push(v)}}),{horiz:[...i(p,"horizontal").values()].filter(m=>m.length>1),vert:[...i(g,"vertical").values()].filter(m=>m.length>1)}}),[s,o]=a.reduce(([f,p],{horiz:g,vert:m})=>[[...f,...g],[...p,...m]],[[],[]]),l=new Set;n.forEach(f=>f.members.forEach(p=>l.add(p)));const u=x(f=>f.filter(p=>!p.some(g=>l.has(g))),"dropOverlapping"),h=u(s),d=u(o);return n.forEach(f=>{f.members.length<2||(f.direction==="row"?h.push([...f.members]):d.push([...f.members]))}),{horizontal:h,vertical:d}}x(kRe,"getAlignments");function SRe(t,e,r=[]){const n=[],i=e.getConfigField("iconSize"),a=e.getConfigField("idealEdgeLengthMultiplier"),s=a*i,o=new Set;r.forEach(h=>{for(let d=0;d`${h[0]},${h[1]}`,"posToStr"),u=x(h=>h.split(",").map(d=>parseInt(d)),"strToPos");return t.forEach(h=>{const d=new Map([...h.entries()].map(([m,y])=>[l(y),m])),f=[l([0,0])],p={},g={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;f.length>0;){const m=f.shift();if(m){p[m]=1;const y=d.get(m);if(y){const v=u(m);Object.entries(g).forEach(([T,b])=>{const w=l([v[0]+b[0],v[1]+b[1]]),C=d.get(w);if(C&&!p[w]){if(f.push(w),o.has(`${y}|${C}`))return;n.push({[cae[T]]:C,[cae[BNt(T)]]:y,gap:a*i})}})}}}}),n}x(SRe,"getRelativeConstraints");function ERe(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=ut("body").append("div").attr("id","cy").attr("style","display:none"),u=eu({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),wRe(r,u),bRe(t,u,i),xRe(e,u,i),CRe(n,u);const h=i.getLayoutHints(),d=kRe(i,a,s,h),f=SRe(a,i,h),p=i.getConfigField("iconSize"),g=i.getConfigField("idealEdgeLengthMultiplier")*p,m=.5*p,y=i.getConfigField("edgeElasticity"),v=i.getConfigField("seed"),T=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(b){const[w,C]=b.connectedNodes(),{parent:S}=sy(w),{parent:k}=sy(C);return S===k?g:m},edgeElasticity(b){const[w,C]=b.connectedNodes(),{parent:S}=sy(w),{parent:k}=sy(C);return S===k?y:.001},alignmentConstraint:d,relativePlacementConstraint:f});T.one("layoutstop",()=>{var w;function b(C,S,k,E){let _,M;const{x:L,y:P}=C,{x:D,y:R}=S;M=(E-P+(L-k)*(P-R)/(L-D))/Math.sqrt(1+Math.pow((P-R)/(L-D),2)),_=Math.sqrt(Math.pow(E-P,2)+Math.pow(k-L,2)-Math.pow(M,2));const I=Math.sqrt(Math.pow(D-L,2)+Math.pow(R-P,2));_=_/I;let $=(D-L)*(E-P)-(R-P)*(k-L);switch(!0){case $>=0:$=1;break;case $<0:$=-1;break}let O=(D-L)*(k-L)+(R-P)*(E-P);switch(!0){case O>=0:O=1;break;case O<0:O=-1;break}return M=Math.abs(M)*$,_=_*O,{distances:M,weights:_}}x(b,"getSegmentWeights"),u.startBatch();for(const C of Object.values(u.edges()))if((w=C.data)!=null&&w.call(C)){const{x:S,y:k}=C.source().position(),{x:E,y:_}=C.target().position();if(S!==E&&k!==_){const M=C.sourceEndpoint(),L=C.targetEndpoint(),{sourceDir:P}=mRe(C),[D,R]=bf(P)?[M.x,L.y]:[L.x,M.y],{weights:I,distances:$}=b(M,L,D,R);C.style("segment-distances",$),C.style("segment-weights",I)}}u.endBatch(),cF(v,()=>T.run())});try{cF(v,()=>T.run())}catch(b){throw b instanceof RangeError&&b.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):b}u.ready(b=>{le.info("Ready",b),o(u)})})}x(ERe,"layoutArchitecture");var eDt=x(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=xs(e),d=h.append("g");d.attr("class","architecture-edges");const f=h.append("g");f.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await QNt(i,f,a,e),JNt(i,f,s,e);const g=await ERe(a,s,o,l,i,u);await KNt(d,g,i,e),await ZNt(p,g,i,e),TRe(i,g),mx(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),tDt={draw:eDt},rDt={parser:vRe,get db(){return new yRe},renderer:tDt,styles:jNt};const nDt=Object.freeze(Object.defineProperty({__proto__:null,diagram:rDt},Symbol.toStringTag,{value:"Module"}));var ARe="position frame",_Re="frame positioned",uF="position relation",RRe="relation positioned",iDt=x(function(t){le.debug("options str",t)},"setOptions"),aDt=x(function(){return{}},"getOptions"),sDt=x(function(){LRe(),$n()},"clear");function LRe(){KU={}}x(LRe,"reset");var oDt=Vr.eventmodeling,lDt=x(()=>ri({...oDt,...Xt().eventmodeling}),"getConfig"),KU={};function MRe(){let t=cDt;const{ast:e}=KU,r=ZU();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=BRe(n,e.dataEntities,r);t=a5(t,{$kind:ARe,index:i,frame:n,textProps:a});let s;HRe(n)?(le.debug("source frame",n.sourceFrames),s=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),s.forEach(o=>{t=a5(t,{$kind:uF,index:i,frame:n,sourceFrame:o})})):t=a5(t,{$kind:uF,index:i,frame:n})}),t={...t,sortedSwimlanesArray:QU(t.swimlanes)},t}x(MRe,"getState");function IRe(t){KU.ast=t}x(IRe,"setAst");var hn={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function ZU(){return hn}x(ZU,"getDiagramProps");var cDt={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function NRe(t){const e=t.split(".");if(e.length===2)return e[0]}x(NRe,"extractNamespace");function DRe(t){const e=t.split(".");return e.length===2?e[1]:t}x(DRe,"extractName");function ORe(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}x(ORe,"findSwimlaneByNamespace");function i5(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}x(i5,"findNextAvailableIndex");function $Re(t,e){const r=NRe(t.entityIdentifier),n=ORe(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||hn.labelUiAutomation}:r?{index:i5(e,0,100),label:hn.labelUiAutomationPrefix+r}:{index:0,label:hn.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||hn.labelCommandReadModel}:r?{index:i5(e,100,200),label:hn.labelCommandReadModelPrefix+r}:{index:100,label:hn.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||hn.labelEvents}:r?{index:i5(e,200,300),label:hn.labelEventsPrefix+r}:{index:200,label:hn.labelEvents}}}x($Re,"calculateSwimlaneProps");function PRe(t){const{themeVariables:e}=Xt();switch(t.modelEntityType){case"ui":return{fill:e.emUiFill??"white",stroke:e.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:e.emProcessorFill??"#edb3f6",stroke:e.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:e.emReadModelFill??"#d3f1a2",stroke:e.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:e.emCommandFill??"#bcd6fe",stroke:e.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:e.emEventFill??"#ffb778",stroke:e.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}x(PRe,"calculateEntityVisualProps");function BRe(t,e,r){const n=Xt(),i=Wr(DRe(t.entityIdentifier)??"",n);let a;const s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let l=`${Fw(i,r.textMaxWidth,s)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=Wr(a,n),a=Fw(a,r.textMaxWidth,s),a=a.replaceAll(" "," ")),t.dataReference){const g=e.find(m=>{var y;return m.name===((y=t.dataReference)==null?void 0:y.$refText)});g&&(a=g.dataBlockValue,a=a.substring(a.indexOf(`{ +`)+2),a=a.substring(0,a.lastIndexOf("}")-1),a=Wr(a,n),a=Fw(a,r.textMaxWidth,s),a=a.replaceAll(" "," "),a+="
")}const u=a!==void 0;u&&(l+=`

${a}`);const h={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},d=pR(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return le.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}x(BRe,"calculateTextProps");function FRe(t,e){const r=e,n=PRe(r.frame),i={width:r.textProps.width+2*hn.boxTextPadding,height:r.textProps.height+2*hn.boxTextPadding};return[{$kind:_Re,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}x(FRe,"decidePositionFrame");function zRe(t,e,r){return e===void 0?hn.contentStartX:e.index===t.index&&t.r?t.r+hn.boxPadding:r===void 0?hn.contentStartX:r.r-hn.boxOverlap+hn.boxPadding}x(zRe,"calculateX");function VRe(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}x(VRe,"calculateMaxRight");function QU(t){return Object.values(t).sort((e,r)=>e.index-r.index)}x(QU,"sortedSwimlanesArray");function GRe(t,e){const r=e,n=$Re(r.frame,t.swimlanes);let i;n.index in t.swimlanes?i=t.swimlanes[n.index]:i={index:n.index,label:n.label,r:0,y:n.index*hn.swimlaneMinHeight+hn.swimlaneGap,height:hn.swimlaneMinHeight,maxHeight:hn.swimlaneMinHeight};const a=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,s=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,o={width:Math.max(hn.boxMinWidth,Math.min(hn.boxMaxWidth,r.dimension.width))+2*hn.boxPadding,height:Math.max(hn.boxMinHeight,Math.min(hn.boxMaxHeight,r.dimension.height))+2*hn.boxPadding},l=zRe(i,s,a),u=l+o.width+hn.boxPadding,h=VRe(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(hn.swimlaneMinHeight,i.maxHeight)+2*hn.swimlanePadding;const d={x:l,y:hn.swimlanePadding+i.y,r:u,dimension:o,leftSibling:!1,swimlane:i,visual:r.visual,text:r.textProps.content,frame:r.frame,index:r.index},f={...t,boxes:[...t.boxes,d],swimlanes:{...t.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:r.frame,maxR:h},p=QU(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}x(HRe,"hasSourceFrame");function hF(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}x(hF,"findBoxByFrame");function qRe(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}x(qRe,"findBoxByLineIndex");function URe(t,e){const r=e;if(tAe(r.frame)||WRe(r.index,r.frame))return[];const n=hF(t.boxes,r.frame);if(n===void 0)throw new Error(`Target box not found for frame ${r.frame.name}`);let i;return r.sourceFrame?i=hF(t.boxes,r.sourceFrame):i=qRe(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:RRe,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}x(URe,"decidePositionRelation");function YRe(t,e){const r=e,n={visual:{fill:"none",stroke:"#000"},source:{x:r.sourceBox.x,y:r.sourceBox.y},target:{x:r.targetBox.x,y:r.targetBox.y},sourceBox:r.sourceBox,targetBox:r.targetBox};return{...t,relations:[...t.relations,n]}}x(YRe,"evolveRelationPositioned");var uDt={[ARe]:FRe,[uF]:URe},hDt={[_Re]:GRe,[RRe]:YRe};function XRe(t,e){const r=uDt[e.$kind];if(r==null)return[];const n=r(t,e);return le.debug("decided events",n),n}x(XRe,"decide");function jRe(t,e){const r=e.reduce((n,i)=>{const a=hDt[i.$kind];return a==null?n:a(n,i)},t);return le.debug("evolve events",{state:t,newState:r,events:e}),r}x(jRe,"evolve");function a5(t,e){const r=XRe(t,e);return jRe(t,r)}x(a5,"dispatch");var dF={getConfig:lDt,setOptions:iDt,getOptions:aDt,clear:sDt,setAccTitle:Hn,getAccTitle:ni,getAccDescription:ai,setAccDescription:ii,setDiagramTitle:ti,getDiagramTitle:Yn,setAst:IRe,getDiagramProps:ZU,getState:MRe},dDt={parse:x(async t=>{const e=await Al("eventmodeling",t);le.debug(e),dF.setAst(e),eo(e,dF)},"parse")},XN=Fe(),fDt=XN==null?void 0:XN.eventmodeling;function KRe(t,e){return r=>{const n=r.swimlane.y+e.swimlanePadding,i=t.append("g").attr("class","em-box");i.append("rect").attr("x",r.x).attr("y",n).attr("rx","3").attr("width",r.dimension.width).attr("height",r.dimension.height).attr("stroke",r.visual.stroke).attr("fill",r.visual.fill),i.append("foreignObject").attr("x",r.x+e.boxPadding).attr("y",n+10).attr("width",r.dimension.width-2*e.boxPadding).attr("height",r.dimension.height-2*e.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(r.text)}}x(KRe,"renderD3Box");function ZRe(t,e){return t>e}x(ZRe,"dirUpwards");function QRe(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,s=i.targetBox.swimlane.y+e.swimlanePadding,o=ZRe(a,s),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;le.debug(`rendering relation up=${o} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),o?(h=a,d=s+i.targetBox.dimension.height):(h=a+i.sourceBox.dimension.height,d=s);const f=n.emRelationStroke??i.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${r})`).attr("d",`M${l} ${h} L${u} ${d}`)}}x(QRe,"renderD3Relation");function JRe(t,e,r,n){return i=>{const a=t.append("g").attr("class","em-swimlane"),s=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",o=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";a.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",e+r.swimlanePadding).attr("height",i.height).attr("fill",s).attr("stroke",o),a.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}x(JRe,"renderD3Swimlane");var pDt=x(function(t,e,r,n){if(le.debug("in eventmodeling renderer",t+` +`,"id:",e,r),!fDt)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:s}=Fe(),o=ut(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(JRe(o,u.maxR,l,a)),u.boxes.forEach(KRe(o,l)),u.relations.forEach(QRe(o,l,h,a)),o.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",d),Mz(void 0,o,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),gDt={draw:pDt},mDt=x(t=>"","getStyles"),yDt=mDt,vDt={parser:dDt,db:dF,renderer:gDt,styles:yDt};const bDt=Object.freeze(Object.defineProperty({__proto__:null,diagram:vDt},Symbol.toStringTag,{value:"Module"}));var fF=(function(){var t=x(function(v,T,b,w){for(b=b||{},w=v.length;w--;b[v[w]]=T);return b},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],a=[6,7,8],s=[1,20],o=[1,18],l=[1,19],u=[6,7,11],h=[1,6,13,14],d=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:x(function(T,b,w,C,S,k,E){var _=k.length-1;switch(S){case 6:case 7:return C;case 15:C.addNode(k[_-1].length,k[_].trim());break;case 16:C.addNode(0,k[_].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:i},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:s,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:o,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},t(h,[2,14],{7:d,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(h,[2,13],{7:d,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(T,b){if(b.recoverable)this.trace(T);else{var w=new Error(T);throw w.hash=b,w}},"parseError"),parse:x(function(T){var b=this,w=[0],C=[],S=[null],k=[],E=this.table,_="",M=0,L=0,P=2,D=1,R=k.slice.call(arguments,1),I=Object.create(this.lexer),$={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&($.yy[O]=this.yy[O]);I.setInput(T,$.yy),$.yy.lexer=I,$.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var N=I.yylloc;k.push(N);var F=I.options&&I.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(J){w.length=w.length-2*J,S.length=S.length-J,k.length=k.length-J}x(z,"popStack");function V(){var J;return J=C.pop()||I.lex()||D,typeof J!="number"&&(J instanceof Array&&(C=J,J=C.pop()),J=b.symbols_[J]||J),J}x(V,"lex");for(var B,G,H,q,Z={},Y,ie,K,Q;;){if(G=w[w.length-1],this.defaultActions[G]?H=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=V()),H=E[G]&&E[G][B]),typeof H>"u"||!H.length||!H[0]){var te="";Q=[];for(Y in E[G])this.terminals_[Y]&&Y>P&&Q.push("'"+this.terminals_[Y]+"'");I.showPosition?te="Parse error on line "+(M+1)+`: `+I.showPosition()+` Expecting `+Q.join(", ")+", got '"+(this.terminals_[B]||B)+"'":te="Parse error on line "+(M+1)+": Unexpected "+(B==D?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(te,{text:I.match,token:this.terminals_[B]||B,line:I.yylineno,loc:N,expected:Q})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+B);switch(H[0]){case 1:w.push(B),S.push(I.yytext),k.push(I.yylloc),w.push(H[1]),B=null,L=I.yyleng,_=I.yytext,M=I.yylineno,N=I.yylloc;break;case 2:if(ie=this.productions_[H[1]][1],Z.$=S[S.length-ie],Z._$={first_line:k[k.length-(ie||1)].first_line,last_line:k[k.length-1].last_line,first_column:k[k.length-(ie||1)].first_column,last_column:k[k.length-1].last_column},F&&(Z._$.range=[k[k.length-(ie||1)].range[0],k[k.length-1].range[1]]),q=this.performAction.apply(Z,[_,L,M,$.yy,H[1],S,k].concat(R)),typeof q<"u")return q;ie&&(w=w.slice(0,-1*ie*2),S=S.slice(0,-1*ie),k=k.slice(0,-1*ie)),w.push(this.productions_[H[1]][0]),S.push(Z.$),k.push(Z._$),K=E[w[w.length-2]][w[w.length-1]],w.push(K);break;case 3:return!0}}return!0},"parse")},m=(function(){var v={EOF:1,parseError:x(function(b,w){if(this.yy.parser)this.yy.parser.parseError(b,w);else throw new Error(b)},"parseError"),setInput:x(function(T,b){return this.yy=b||this.yy||{},this._input=T,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var T=this._input[0];this.yytext+=T,this.yyleng++,this.offset++,this.match+=T,this.matched+=T;var b=T.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),T},"input"),unput:x(function(T){var b=T.length,w=T.split(/(?:\r\n?|\n)/g);this._input=T+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var C=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),w.length-1&&(this.yylineno-=w.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:w?(w.length===C.length?this.yylloc.first_column:0)+C[C.length-w.length].length-w[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(T){this.unput(this.match.slice(T))},"less"),pastInput:x(function(){var T=this.matched.substr(0,this.matched.length-this.match.length);return(T.length>20?"...":"")+T.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var T=this.match;return T.length<20&&(T+=this._input.substr(0,20-T.length)),(T.substr(0,20)+(T.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var T=this.pastInput(),b=new Array(T.length+1).join("-");return T+this.upcomingInput()+` `+b+"^"},"showPosition"),test_match:x(function(T,b){var w,C,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),C=T[0].match(/(?:\r\n?|\n).*/g),C&&(this.yylineno+=C.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C?C[C.length-1].length-C[C.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+T[0].length},this.yytext+=T[0],this.match+=T[0],this.matches=T,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(T[0].length),this.matched+=T[0],w=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),w)return w;if(this._backtrack){for(var k in S)this[k]=S[k];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var T,b,w,C;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),k=0;kb[0].length)){if(b=w,C=k,this.options.backtrack_lexer){if(T=this.test_match(w,S[k]),T!==!1)return T;if(this._backtrack){b=!1;continue}else return!1}else if(!this.options.flex)break}return b?(T=this.test_match(b,S[C]),T!==!1?T:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var b=this.next();return b||this.lex()},"lex"),begin:x(function(b){this.conditionStack.push(b)},"begin"),popState:x(function(){var b=this.conditionStack.length-1;return b>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(b){return b=this.conditionStack.length-1-Math.abs(b||0),b>=0?this.conditionStack[b]:"INITIAL"},"topState"),pushState:x(function(b){this.begin(b)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(b,w,C,S){switch(C){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return v})();g.lexer=m;function y(){this.yy={}}return x(y,"Parser"),y.prototype=g,g.Parser=y,new y})();fF.parser=fF;var yDt=fF,cb,vDt=(cb=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,On()}getRoot(){return this.root}addNode(e,r){const n=At.sanitizeText(r,Fe());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],ti(n);return}this.baseLevel??(this.baseLevel=e);let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();const a=this.stack[this.stack.length-1].node,s={text:n,children:[]};a.children.push(s),this.stack.push({level:i,node:s})}getAccTitle(){return ni()}setAccTitle(e){Hn(e)}getAccDescription(){return ai()}setAccDescription(e){ii(e)}getDiagramTitle(){return Yn()}setDiagramTitle(e){ti(e)}},x(cb,"IshikawaDB"),cb),bDt=14,hm=250,xDt=30,TDt=60,wDt=5,JRe=82*Math.PI/180,hae=Math.cos(JRe),dae=Math.sin(JRe),fae=x((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;Ai(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),CDt=x((t,e,r,n)=>{var $,O;const a=n.db.getRoot();if(!a)return;const s=Fe(),{look:o,handDrawnSeed:l,themeVariables:u}=s,h=Oh(s.fontSize)[0]??bDt,d=o==="handDrawn",f=a.children??[],p=(($=s.ishikawa)==null?void 0:$.diagramPadding)??20,g=((O=s.ishikawa)==null?void 0:O.useMaxWidth)??!1,m=xs(e),y=m.append("g").attr("class","ishikawa"),v=d?Gt.svg(m.node()):void 0,T=v?{roughSvg:v,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,b=`ishikawa-arrow-${e}`;d||y.append("defs").append("marker").attr("id",b).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let w=0,C=hm;const S=d?void 0:Ry(y,w,C,w,C,"ishikawa-spine");if(kDt(y,w,C,a.text,h,T),!f.length){d&&Ry(y,w,C,w,C,"ishikawa-spine",T),fae(m,p,g);return}w-=20;const k=f.filter((N,F)=>F%2===0),E=f.filter((N,F)=>F%2===1),_=pae(k),M=pae(E),L=_.total+M.total;let P=hm,D=hm;if(L>0){const N=hm*2,F=hm*.3;P=Math.max(F,N*(_.total/L)),D=Math.max(F,N*(M.total/L))}const R=h*2;P=Math.max(P,_.max*R),D=Math.max(D,M.max*R),C=Math.max(P,hm),S&&S.attr("y1",C).attr("y2",C),y.select(".ishikawa-head-group").attr("transform",`translate(0,${C})`);const I=Math.ceil(f.length/2);for(let N=0;NMath.min(z,V.getBBox().x),1/0)}if(d)Ry(y,w,C,0,C,"ishikawa-spine",T);else{S.attr("x1",w);const N=`url(#${b})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",N)}fae(m,p,g)},"draw"),pae=x(t=>{const e=x(r=>r.children.reduce((n,i)=>n+1+e(i),0),"countDescendants");return t.reduce((r,n)=>{const i=e(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),kDt=x((t,e,r,n,i,a)=>{const s=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=R6(o,eLe(n,s),0,0,"ishikawa-head-label","start",i),u=l.node().getBBox(),h=Math.max(60,u.width+6),d=Math.max(40,u.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${h*2.4} 0 0 ${-d/2} Z`;if(a){const p=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>p,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",f);l.attr("transform",`translate(${(h-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),SDt=x((t,e)=>{const r=[],n=[],i=x((a,s,o)=>{const l=e===-1?[...a].reverse():a;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:eLe(u.text,15),parentIndex:s,childCount:d.length}),o%2===0?(n.push(h),d.length&&i(d,h,o+1)):(d.length&&i(d,h,o+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),EDt=x((t,e,r,n,i,a,s)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=R6(o,e,r,n+11*i,"ishikawa-label cause","middle",a).node().getBBox();if(s){const h=s.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:s.seed,fill:s.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:s.lineColor,strokeWidth:2});o.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else o.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),jN=x((t,e,r,n,i,a)=>{const s=Math.sqrt(n*n+i*i);if(s===0)return;const o=n/s,l=i/s,u=6,h=-l*u,d=o*u,f=e,p=r,g=`M ${f} ${p} L ${f-o*u*2+h} ${p-l*u*2+d} L ${f-o*u*2-h} ${p-l*u*2-d} Z`,m=a.roughSvg.path(g,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),ADt=x((t,e,r,n,i,a,s,o)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-hae*u,d=dae*u*i,f=r+h,p=n+d;if(Ry(t,r,n,f,p,"ishikawa-branch",o),o&&jN(t,r,n,r-f,n-p,o),EDt(t,e.text,f,p,i,s,o),!l.length)return;const{entries:g,yOrder:m}=SDt(l,i),y=g.length,v=new Array(y);for(const[S,k]of m.entries())v[k]=n+d*((S+1)/(y+1));const T=new Map;T.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const b=-hae,w=dae*i,C=i<0?"ishikawa-label up":"ishikawa-label down";for(const[S,k]of g.entries()){const E=v[S],_=T.get(k.parentIndex),M=t.append("g").attr("class","ishikawa-sub-group");let L=0,P=0,D=0;if(k.depth%2===0){const R=_.y1-_.y0;L=gae(_.x0,_.x1,R?(E-_.y0)/R:.5),P=E,D=L-(k.childCount>0?TDt+k.childCount*wDt:xDt),Ry(M,L,E,D,E,"ishikawa-sub-branch",o),o&&jN(M,L,E,1,0,o),R6(M,k.text,D,E,"ishikawa-label align","end",s)}else{const R=_.childrenDrawn++;L=gae(_.x0,_.x1,(_.childCount-R)/(_.childCount+1)),P=_.y0,D=L+b*((E-P)/w),Ry(M,L,P,D,E,"ishikawa-sub-branch",o),o&&jN(M,L,P,L-D,P-E,o),R6(M,k.text,D,E,C,"end",s)}k.childCount>0&&T.set(S,{x0:L,y0:P,x1:D,y1:E,childCount:k.childCount,childrenDrawn:0})}},"drawBranch"),_Dt=x(t=>t.split(/|\n/),"splitLines"),eLe=x((t,e)=>{if(t.length<=e)return t;const r=[];for(const n of t.split(/\s+/)){const i=r.length-1;i>=0&&r[i].length+1+n.length<=e?r[i]+=" "+n:r.push(n)}return r.join(` -`)},"wrapText"),R6=x((t,e,r,n,i,a,s)=>{const o=_Dt(e),l=s*1.05,u=t.append("text").attr("class",i).attr("text-anchor",a).attr("x",r).attr("y",n-(o.length-1)*l/2);for(const[h,d]of o.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),gae=x((t,e,r)=>t+(e-t)*r,"lerp"),Ry=x((t,e,r,n,i,a,s)=>{if(s){const o=s.roughSvg.line(e,r,n,i,{roughness:1.5,seed:s.seed,stroke:s.lineColor,strokeWidth:2});t.append(()=>o).attr("class",a);return}return t.append("line").attr("class",a).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),RDt={draw:CDt},LDt=x(t=>` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var b=this.next();return b||this.lex()},"lex"),begin:x(function(b){this.conditionStack.push(b)},"begin"),popState:x(function(){var b=this.conditionStack.length-1;return b>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(b){return b=this.conditionStack.length-1-Math.abs(b||0),b>=0?this.conditionStack[b]:"INITIAL"},"topState"),pushState:x(function(b){this.begin(b)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(b,w,C,S){switch(C){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return v})();g.lexer=m;function y(){this.yy={}}return x(y,"Parser"),y.prototype=g,g.Parser=y,new y})();fF.parser=fF;var xDt=fF,cb,TDt=(cb=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,$n()}getRoot(){return this.root}addNode(e,r){const n=At.sanitizeText(r,Fe());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],ti(n);return}this.baseLevel??(this.baseLevel=e);let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();const a=this.stack[this.stack.length-1].node,s={text:n,children:[]};a.children.push(s),this.stack.push({level:i,node:s})}getAccTitle(){return ni()}setAccTitle(e){Hn(e)}getAccDescription(){return ai()}setAccDescription(e){ii(e)}getDiagramTitle(){return Yn()}setDiagramTitle(e){ti(e)}},x(cb,"IshikawaDB"),cb),wDt=14,hm=250,CDt=30,kDt=60,SDt=5,eLe=82*Math.PI/180,dae=Math.cos(eLe),fae=Math.sin(eLe),pae=x((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;Ai(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),EDt=x((t,e,r,n)=>{var $,O;const a=n.db.getRoot();if(!a)return;const s=Fe(),{look:o,handDrawnSeed:l,themeVariables:u}=s,h=Oh(s.fontSize)[0]??wDt,d=o==="handDrawn",f=a.children??[],p=(($=s.ishikawa)==null?void 0:$.diagramPadding)??20,g=((O=s.ishikawa)==null?void 0:O.useMaxWidth)??!1,m=xs(e),y=m.append("g").attr("class","ishikawa"),v=d?Gt.svg(m.node()):void 0,T=v?{roughSvg:v,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,b=`ishikawa-arrow-${e}`;d||y.append("defs").append("marker").attr("id",b).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let w=0,C=hm;const S=d?void 0:Ry(y,w,C,w,C,"ishikawa-spine");if(ADt(y,w,C,a.text,h,T),!f.length){d&&Ry(y,w,C,w,C,"ishikawa-spine",T),pae(m,p,g);return}w-=20;const k=f.filter((N,F)=>F%2===0),E=f.filter((N,F)=>F%2===1),_=gae(k),M=gae(E),L=_.total+M.total;let P=hm,D=hm;if(L>0){const N=hm*2,F=hm*.3;P=Math.max(F,N*(_.total/L)),D=Math.max(F,N*(M.total/L))}const R=h*2;P=Math.max(P,_.max*R),D=Math.max(D,M.max*R),C=Math.max(P,hm),S&&S.attr("y1",C).attr("y2",C),y.select(".ishikawa-head-group").attr("transform",`translate(0,${C})`);const I=Math.ceil(f.length/2);for(let N=0;NMath.min(z,V.getBBox().x),1/0)}if(d)Ry(y,w,C,0,C,"ishikawa-spine",T);else{S.attr("x1",w);const N=`url(#${b})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",N)}pae(m,p,g)},"draw"),gae=x(t=>{const e=x(r=>r.children.reduce((n,i)=>n+1+e(i),0),"countDescendants");return t.reduce((r,n)=>{const i=e(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),ADt=x((t,e,r,n,i,a)=>{const s=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=R6(o,tLe(n,s),0,0,"ishikawa-head-label","start",i),u=l.node().getBBox(),h=Math.max(60,u.width+6),d=Math.max(40,u.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${h*2.4} 0 0 ${-d/2} Z`;if(a){const p=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>p,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",f);l.attr("transform",`translate(${(h-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),_Dt=x((t,e)=>{const r=[],n=[],i=x((a,s,o)=>{const l=e===-1?[...a].reverse():a;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:tLe(u.text,15),parentIndex:s,childCount:d.length}),o%2===0?(n.push(h),d.length&&i(d,h,o+1)):(d.length&&i(d,h,o+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),RDt=x((t,e,r,n,i,a,s)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=R6(o,e,r,n+11*i,"ishikawa-label cause","middle",a).node().getBBox();if(s){const h=s.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:s.seed,fill:s.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:s.lineColor,strokeWidth:2});o.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else o.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),jN=x((t,e,r,n,i,a)=>{const s=Math.sqrt(n*n+i*i);if(s===0)return;const o=n/s,l=i/s,u=6,h=-l*u,d=o*u,f=e,p=r,g=`M ${f} ${p} L ${f-o*u*2+h} ${p-l*u*2+d} L ${f-o*u*2-h} ${p-l*u*2-d} Z`,m=a.roughSvg.path(g,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),LDt=x((t,e,r,n,i,a,s,o)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-dae*u,d=fae*u*i,f=r+h,p=n+d;if(Ry(t,r,n,f,p,"ishikawa-branch",o),o&&jN(t,r,n,r-f,n-p,o),RDt(t,e.text,f,p,i,s,o),!l.length)return;const{entries:g,yOrder:m}=_Dt(l,i),y=g.length,v=new Array(y);for(const[S,k]of m.entries())v[k]=n+d*((S+1)/(y+1));const T=new Map;T.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const b=-dae,w=fae*i,C=i<0?"ishikawa-label up":"ishikawa-label down";for(const[S,k]of g.entries()){const E=v[S],_=T.get(k.parentIndex),M=t.append("g").attr("class","ishikawa-sub-group");let L=0,P=0,D=0;if(k.depth%2===0){const R=_.y1-_.y0;L=mae(_.x0,_.x1,R?(E-_.y0)/R:.5),P=E,D=L-(k.childCount>0?kDt+k.childCount*SDt:CDt),Ry(M,L,E,D,E,"ishikawa-sub-branch",o),o&&jN(M,L,E,1,0,o),R6(M,k.text,D,E,"ishikawa-label align","end",s)}else{const R=_.childrenDrawn++;L=mae(_.x0,_.x1,(_.childCount-R)/(_.childCount+1)),P=_.y0,D=L+b*((E-P)/w),Ry(M,L,P,D,E,"ishikawa-sub-branch",o),o&&jN(M,L,P,L-D,P-E,o),R6(M,k.text,D,E,C,"end",s)}k.childCount>0&&T.set(S,{x0:L,y0:P,x1:D,y1:E,childCount:k.childCount,childrenDrawn:0})}},"drawBranch"),MDt=x(t=>t.split(/|\n/),"splitLines"),tLe=x((t,e)=>{if(t.length<=e)return t;const r=[];for(const n of t.split(/\s+/)){const i=r.length-1;i>=0&&r[i].length+1+n.length<=e?r[i]+=" "+n:r.push(n)}return r.join(` +`)},"wrapText"),R6=x((t,e,r,n,i,a,s)=>{const o=MDt(e),l=s*1.05,u=t.append("text").attr("class",i).attr("text-anchor",a).attr("x",r).attr("y",n-(o.length-1)*l/2);for(const[h,d]of o.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),mae=x((t,e,r)=>t+(e-t)*r,"lerp"),Ry=x((t,e,r,n,i,a,s)=>{if(s){const o=s.roughSvg.line(e,r,n,i,{roughness:1.5,seed:s.seed,stroke:s.lineColor,strokeWidth:2});t.append(()=>o).attr("class",a);return}return t.append("line").attr("class",a).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),IDt={draw:EDt},NDt=x(t=>` .ishikawa .ishikawa-spine, .ishikawa .ishikawa-branch, .ishikawa .ishikawa-sub-branch { @@ -3504,18 +3506,18 @@ Expecting `+Q.join(", ")+", got '"+(this.terminals_[B]||B)+"'":te="Parse error o .ishikawa .ishikawa-label.down { dominant-baseline: hanging; } -`,"getStyles"),MDt=LDt,IDt={parser:yDt,get db(){return new vDt},renderer:RDt,styles:MDt};const NDt=Object.freeze(Object.defineProperty({__proto__:null,diagram:IDt},Symbol.toStringTag,{value:"Module"})),tLe=1e-10;function H7(t,e){const r=ODt(t),n=r.filter(o=>DDt(o,t));let i=0,a=0;const s=[];if(n.length>1){const o=nLe(n);for(let u=0;uh.angle-u.angle);let l=n[n.length-1];for(let u=0;ug.radius*2&&(b=g.radius*2),(f==null||f.width>b)&&(f={circle:g,width:b,p1:h,p2:l,large:b>g.radius,sweep:!0})}f!=null&&(s.push(f),i+=pF(f.circle.radius,f.width),l=h)}}else{let o=t[0];for(let u=1;uMath.abs(o.radius-t[u].radius)){l=!0;break}l?i=a=0:(i=o.radius*o.radius*Math.PI,s.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-tLe,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=s,e.innerPoints=n,e.intersectionPoints=r),i+a}function DDt(t,e){return e.every(r=>xo(t,r)=t+e)return 0;if(r<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=t-(r*r-e*e+t*t)/(2*r),i=e-(r*r-t*t+e*e)/(2*r);return pF(t,n)+pF(e,i)}function rLe(t,e){const r=xo(t,e),n=t.radius,i=e.radius;if(r>=n+i||r<=Math.abs(n-i))return[];const a=(n*n-i*i+r*r)/(2*r),s=Math.sqrt(n*n-a*a),o=t.x+a*(e.x-t.x)/r,l=t.y+a*(e.y-t.y)/r,u=-(e.y-t.y)*(s/r),h=-(e.x-t.x)*(s/r);return[{x:o+u,y:l-h},{x:o-u,y:l+h}]}function nLe(t){const e={x:0,y:0};for(const r of t)e.x+=r.x,e.y+=r.y;return e.x/=t.length,e.y/=t.length,e}function $Dt(t,e,r,n){n=n||{};const i=n.maxIterations||100,a=n.tolerance||1e-10,s=t(e),o=t(r);let l=r-e;if(s*o>0)throw"Initial bisect points must have opposite signs";if(s===0)return e;if(o===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)gF(e))}function Ly(t,e){let r=0;for(let n=0;nC.fx-S.fx,v=e.slice(),T=e.slice(),b=e.slice(),w=e.slice();for(let C=0;C{const _=E.slice();return _.fx=E.fx,_.id=E.id,_});k.sort((E,_)=>E.id-_.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:k})}f=0;for(let k=0;k=g[p-1].fx){let k=!1;if(T.fx>S.fx?(Xu(b,1+h,v,-h,S),b.fx=t(b),b.fx=1)break;for(let E=1;Eo+a*i*l||u>=y)m=i;else{if(Math.abs(d)<=-s*l)return i;d*(m-g)>=0&&(m=g),g=i,y=u}return 0}for(let g=0;g<10;++g){if(Xu(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=Ly(n.fxprime,e),u>o+a*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-s*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function BDt(t,e,r){let n={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const a=e.slice();let s,o,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),s=n.fxprime.slice(),yF(s,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fJU(t,e,n)-r,0,t+e)}function FDt(t,e={}){const r=e.distinct,n=t.map(o=>Object.assign({},o));function i(o){return o.join(";")}if(r){const o=new Map;for(const l of n)for(let u=0;uo===l?0:oa.sets.length===2).forEach(a=>{const s=r[a.sets[0]],o=r[a.sets[1]],l=Math.sqrt(e[s].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),h=vF(l,u,a.size);n[s][o]=n[o][s]=h;let d=0;a.size+1e-10>=Math.min(e[s].size,e[o].size)?d=1:a.size<=1e-10&&(d=-1),i[s][o]=i[o][s]=d}),{distances:n,constraints:i}}function VDt(t,e,r,n){for(let a=0;a0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*a]+=4*m*(s-u),e[2*a+1]+=4*m*(o-h),e[2*l]+=4*m*(u-s),e[2*l+1]+=4*m*(h-o))}}return i}function GDt(t,e={}){let r=HDt(t,e);const n=e.lossFunction||dx;if(t.length>=8){const i=WDt(t,e),a=n(i,t),s=n(r,t);a+1e-8f.map(p=>p/o));const l=(f,p)=>VDt(f,p,a,s);let u=null;for(let f=0;fd.sets.length===2);for(const d of t){let f=d.weight!=null?d.weight:1;const p=d.sets[0],g=d.sets[1];d.size+sLe>=Math.min(n[p].size,n[g].size)&&(f=0),i[p].push({set:g,size:d.size,weight:f}),i[g].push({set:p,size:d.size,weight:f})}const a=[];Object.keys(i).forEach(d=>{let f=0;for(let p=0;pt[s]));const a=n.weight!=null?n.weight:1;r+=a*(i-n.size)*(i-n.size)}return r}function oLe(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const o=t[n.sets[0]],l=t[n.sets[1]];i=JU(o.radius,l.radius,xo(o,l))}else i=H7(n.sets.map(o=>t[o]));const a=n.weight!=null?n.weight:1,s=Math.log((i+1)/(n.size+1));r+=a*s*s}return r}function qDt(t,e,r){if(r==null?t.sort((i,a)=>a.radius-i.radius):t.sort(r),t.length>0){const i=t[0].x,a=t[0].y;for(const s of t)s.x-=i,s.y-=a}if(t.length===2&&xo(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,a=Math.cos(i),s=Math.sin(i);for(const o of t){const l=o.x,u=o.y;o.x=a*l-s*u,o.y=s*l+a*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const a=t[1].y/(1e-10+t[1].x);for(const s of t){var n=(s.x+a*s.y)/(1+a*a);s.x=2*n-s.x,s.y=2*n*a-s.y}}}}function UDt(t){t.forEach(i=>{i.parent=i});function e(i){return i.parent!==i&&(i.parent=e(i.parent)),i.parent}function r(i,a){const s=e(i),o=e(a);s.parent=o}for(let i=0;i{delete i.parent}),Array.from(n.values())}function bF(t){const e=r=>{const n=t.reduce((a,s)=>Math.max(a,s[r]+s.radius),Number.NEGATIVE_INFINITY),i=t.reduce((a,s)=>Math.min(a,s[r]-s.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function lLe(t,e,r){e==null&&(e=Math.PI/2);let n=hLe(t).map(u=>Object.assign({},u));const i=UDt(n);for(const u of i){qDt(u,e,r);const h=bF(u);u.size=(h.xRange.max-h.xRange.min)*(h.yRange.max-h.yRange.min),u.bounds=h}i.sort((u,h)=>h.size-u.size),n=i[0];let a=n.bounds;const s=(a.xRange.max-a.xRange.min)/50;function o(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=a.xRange.max-f.xRange.min+s;else{p=a.xRange.max-f.xRange.max;const m=(f.xRange.max-f.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;m<0&&(p+=m)}if(d)g=a.yRange.max-f.yRange.min+s;else{g=a.yRange.max-f.yRange.max;const m=(f.yRange.max-f.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;m<0&&(g+=m)}for(const m of u)m.x+=p,m.y+=g,n.push(m)}let l=1;for(;l({radius:h*p.radius,x:n+d+(p.x-s.min)*h,y:n+f+(p.y-o.min)*h,setid:p.setid})))}function uLe(t){const e={};for(const r of t)e[r.setid]=r;return e}function hLe(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function YDt(t={}){let e=!1,r=600,n=350,i=15,a=1e3,s=Math.PI/2,o=!0,l=null,u=!0,h=!0,d=null,f=null,p=!1,g=null,m=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,y={},v=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],T=0,b=function(k){if(k in y)return y[k];var E=y[k]=v[T];return T+=1,T>=v.length&&(T=0),E},w=aLe,C=dx;function S(k){let E=k.datum();const _=new Set;E.forEach(Y=>{Y.size==0&&Y.sets.length==1&&_.add(Y.sets[0])}),E=E.filter(Y=>!Y.sets.some(ie=>_.has(ie)));let M={},L={};if(E.length>0){let Y=w(E,{lossFunction:C,distinct:p});o&&(Y=lLe(Y,s,f)),M=cLe(Y,r,n,i,l),L=fLe(M,E,m)}const P={};E.forEach(Y=>{Y.label&&(P[Y.sets]=Y.label)});function D(Y){if(Y.sets in P)return P[Y.sets];if(Y.sets.length==1)return""+Y.sets[0]}k.selectAll("svg").data([M]).enter().append("svg");const R=k.select("svg");e?R.attr("viewBox",`0 0 ${r} ${n}`):R.attr("width",r).attr("height",n);const I={};let $=!1;R.selectAll(".venn-area path").each(function(Y){const ie=this.getAttribute("d");Y.sets.length==1&&ie&&!p&&($=!0,I[Y.sets[0]]=KDt(ie))});function O(Y){return ie=>{const K=Y.sets.map(Q=>{let te=I[Q],J=M[Q];return te||(te={x:r/2,y:n/2,radius:1}),J||(J={x:r/2,y:n/2,radius:1}),{x:te.x*(1-ie)+J.x*ie,y:te.y*(1-ie)+J.y*ie,radius:te.radius*(1-ie)+J.radius*ie}});return yae(K,g)}}const N=R.selectAll(".venn-area").data(E,Y=>Y.sets),F=N.enter().append("g").attr("class",Y=>`venn-area venn-${Y.sets.length==1?"circle":"intersection"}${Y.colour||Y.color?" venn-coloured":""}`).attr("data-venn-sets",Y=>Y.sets.join("_")),z=F.append("path"),V=F.append("text").attr("class","label").text(Y=>D(Y)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(z.style("fill-opacity","0").filter(Y=>Y.sets.length==1).style("fill",Y=>Y.colour?Y.colour:Y.color?Y.color:b(Y.sets)).style("fill-opacity",".25"),V.style("fill",Y=>Y.colour||Y.color?"#FFF":t.textFill?t.textFill:Y.sets.length==1?b(Y.sets):"#444"));function B(Y){return typeof Y.transition=="function"?Y.transition("venn").duration(a):Y}let G=k;$&&typeof G.transition=="function"?(G=B(k),G.selectAll("path").attrTween("d",O)):G.selectAll("path").attr("d",Y=>yae(Y.sets.map(ie=>M[ie])),g);const H=G.selectAll("text").filter(Y=>Y.sets in L).text(Y=>D(Y)).attr("x",Y=>Math.floor(L[Y.sets].x)).attr("y",Y=>Math.floor(L[Y.sets].y));u&&($?"on"in H?H.on("end",KN(M,D)):H.each("end",KN(M,D)):H.each(KN(M,D)));const q=B(N.exit()).remove();typeof N.transition=="function"&&q.selectAll("path").attrTween("d",O);const Z=q.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(V.style("font-size","0px"),H.style("font-size",d),Z.style("font-size","0px")),{circles:M,textCentres:L,nodes:N,enter:F,update:G,exit:q}}return S.wrap=function(k){return arguments.length?(u=k,S):u},S.useViewBox=function(){return e=!0,S},S.width=function(k){return arguments.length?(r=k,S):r},S.height=function(k){return arguments.length?(n=k,S):n},S.padding=function(k){return arguments.length?(i=k,S):i},S.distinct=function(k){return arguments.length?(p=k,S):p},S.colours=function(k){return arguments.length?(b=k,S):b},S.colors=function(k){return arguments.length?(b=k,S):b},S.fontSize=function(k){return arguments.length?(d=k,S):d},S.round=function(k){return arguments.length?(g=k,S):g},S.duration=function(k){return arguments.length?(a=k,S):a},S.layoutFunction=function(k){return arguments.length?(w=k,S):w},S.normalize=function(k){return arguments.length?(o=k,S):o},S.scaleToFit=function(k){return arguments.length?(l=k,S):l},S.styled=function(k){return arguments.length?(h=k,S):h},S.orientation=function(k){return arguments.length?(s=k,S):s},S.orientationOrder=function(k){return arguments.length?(f=k,S):f},S.lossFunction=function(k){return arguments.length?(C=k==="default"?dx:k==="logRatio"?oLe:k,S):C},S}function KN(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,a=e(r)||"",s=a.split(/\s+/).reverse(),l=(a.length+s.length)/3;let u=s.pop(),h=[u],d=0;const f=1.1;n.textContent=null;const p=[];function g(b){const w=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return w.textContent=b,p.push(w),n.append(w),w}let m=g(u);for(;u=s.pop(),!!u;){h.push(u);const b=h.join(" ");m.textContent=b,b.length>l&&m.getComputedTextLength()>i&&(h.pop(),m.textContent=h.join(" "),h=[u],m=g(u),d++)}const y=.35-d*f/2,v=n.getAttribute("x"),T=n.getAttribute("y");p.forEach((b,w)=>{b.setAttribute("x",v),b.setAttribute("y",T),b.setAttribute("dy",`${y+w*f}em`)})}}function ZN(t,e,r){let n=e[0].radius-xo(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const s=iLe(h=>-1*ZN({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:r?0:s[0],y:s[1]};let l=!0;for(const h of t)if(xo(o,h)>h.radius){l=!1;break}for(const h of e)if(xo(o,h)h.p1))}function XDt(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+s+" not represented on screen")}return n}function jDt(t,e,r){const n=[];return n.push(` +`,"getStyles"),DDt=NDt,ODt={parser:xDt,get db(){return new TDt},renderer:IDt,styles:DDt};const $Dt=Object.freeze(Object.defineProperty({__proto__:null,diagram:ODt},Symbol.toStringTag,{value:"Module"})),rLe=1e-10;function H7(t,e){const r=BDt(t),n=r.filter(o=>PDt(o,t));let i=0,a=0;const s=[];if(n.length>1){const o=iLe(n);for(let u=0;uh.angle-u.angle);let l=n[n.length-1];for(let u=0;ug.radius*2&&(b=g.radius*2),(f==null||f.width>b)&&(f={circle:g,width:b,p1:h,p2:l,large:b>g.radius,sweep:!0})}f!=null&&(s.push(f),i+=pF(f.circle.radius,f.width),l=h)}}else{let o=t[0];for(let u=1;uMath.abs(o.radius-t[u].radius)){l=!0;break}l?i=a=0:(i=o.radius*o.radius*Math.PI,s.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-rLe,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=s,e.innerPoints=n,e.intersectionPoints=r),i+a}function PDt(t,e){return e.every(r=>xo(t,r)=t+e)return 0;if(r<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=t-(r*r-e*e+t*t)/(2*r),i=e-(r*r-t*t+e*e)/(2*r);return pF(t,n)+pF(e,i)}function nLe(t,e){const r=xo(t,e),n=t.radius,i=e.radius;if(r>=n+i||r<=Math.abs(n-i))return[];const a=(n*n-i*i+r*r)/(2*r),s=Math.sqrt(n*n-a*a),o=t.x+a*(e.x-t.x)/r,l=t.y+a*(e.y-t.y)/r,u=-(e.y-t.y)*(s/r),h=-(e.x-t.x)*(s/r);return[{x:o+u,y:l-h},{x:o-u,y:l+h}]}function iLe(t){const e={x:0,y:0};for(const r of t)e.x+=r.x,e.y+=r.y;return e.x/=t.length,e.y/=t.length,e}function FDt(t,e,r,n){n=n||{};const i=n.maxIterations||100,a=n.tolerance||1e-10,s=t(e),o=t(r);let l=r-e;if(s*o>0)throw"Initial bisect points must have opposite signs";if(s===0)return e;if(o===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)gF(e))}function Ly(t,e){let r=0;for(let n=0;nC.fx-S.fx,v=e.slice(),T=e.slice(),b=e.slice(),w=e.slice();for(let C=0;C{const _=E.slice();return _.fx=E.fx,_.id=E.id,_});k.sort((E,_)=>E.id-_.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:k})}f=0;for(let k=0;k=g[p-1].fx){let k=!1;if(T.fx>S.fx?(Xu(b,1+h,v,-h,S),b.fx=t(b),b.fx=1)break;for(let E=1;Eo+a*i*l||u>=y)m=i;else{if(Math.abs(d)<=-s*l)return i;d*(m-g)>=0&&(m=g),g=i,y=u}return 0}for(let g=0;g<10;++g){if(Xu(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=Ly(n.fxprime,e),u>o+a*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-s*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function VDt(t,e,r){let n={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const a=e.slice();let s,o,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),s=n.fxprime.slice(),yF(s,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fJU(t,e,n)-r,0,t+e)}function GDt(t,e={}){const r=e.distinct,n=t.map(o=>Object.assign({},o));function i(o){return o.join(";")}if(r){const o=new Map;for(const l of n)for(let u=0;uo===l?0:oa.sets.length===2).forEach(a=>{const s=r[a.sets[0]],o=r[a.sets[1]],l=Math.sqrt(e[s].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),h=vF(l,u,a.size);n[s][o]=n[o][s]=h;let d=0;a.size+1e-10>=Math.min(e[s].size,e[o].size)?d=1:a.size<=1e-10&&(d=-1),i[s][o]=i[o][s]=d}),{distances:n,constraints:i}}function HDt(t,e,r,n){for(let a=0;a0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*a]+=4*m*(s-u),e[2*a+1]+=4*m*(o-h),e[2*l]+=4*m*(u-s),e[2*l+1]+=4*m*(h-o))}}return i}function qDt(t,e={}){let r=YDt(t,e);const n=e.lossFunction||dx;if(t.length>=8){const i=UDt(t,e),a=n(i,t),s=n(r,t);a+1e-8f.map(p=>p/o));const l=(f,p)=>HDt(f,p,a,s);let u=null;for(let f=0;fd.sets.length===2);for(const d of t){let f=d.weight!=null?d.weight:1;const p=d.sets[0],g=d.sets[1];d.size+oLe>=Math.min(n[p].size,n[g].size)&&(f=0),i[p].push({set:g,size:d.size,weight:f}),i[g].push({set:p,size:d.size,weight:f})}const a=[];Object.keys(i).forEach(d=>{let f=0;for(let p=0;pt[s]));const a=n.weight!=null?n.weight:1;r+=a*(i-n.size)*(i-n.size)}return r}function lLe(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const o=t[n.sets[0]],l=t[n.sets[1]];i=JU(o.radius,l.radius,xo(o,l))}else i=H7(n.sets.map(o=>t[o]));const a=n.weight!=null?n.weight:1,s=Math.log((i+1)/(n.size+1));r+=a*s*s}return r}function XDt(t,e,r){if(r==null?t.sort((i,a)=>a.radius-i.radius):t.sort(r),t.length>0){const i=t[0].x,a=t[0].y;for(const s of t)s.x-=i,s.y-=a}if(t.length===2&&xo(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,a=Math.cos(i),s=Math.sin(i);for(const o of t){const l=o.x,u=o.y;o.x=a*l-s*u,o.y=s*l+a*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const a=t[1].y/(1e-10+t[1].x);for(const s of t){var n=(s.x+a*s.y)/(1+a*a);s.x=2*n-s.x,s.y=2*n*a-s.y}}}}function jDt(t){t.forEach(i=>{i.parent=i});function e(i){return i.parent!==i&&(i.parent=e(i.parent)),i.parent}function r(i,a){const s=e(i),o=e(a);s.parent=o}for(let i=0;i{delete i.parent}),Array.from(n.values())}function bF(t){const e=r=>{const n=t.reduce((a,s)=>Math.max(a,s[r]+s.radius),Number.NEGATIVE_INFINITY),i=t.reduce((a,s)=>Math.min(a,s[r]-s.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function cLe(t,e,r){e==null&&(e=Math.PI/2);let n=dLe(t).map(u=>Object.assign({},u));const i=jDt(n);for(const u of i){XDt(u,e,r);const h=bF(u);u.size=(h.xRange.max-h.xRange.min)*(h.yRange.max-h.yRange.min),u.bounds=h}i.sort((u,h)=>h.size-u.size),n=i[0];let a=n.bounds;const s=(a.xRange.max-a.xRange.min)/50;function o(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=a.xRange.max-f.xRange.min+s;else{p=a.xRange.max-f.xRange.max;const m=(f.xRange.max-f.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;m<0&&(p+=m)}if(d)g=a.yRange.max-f.yRange.min+s;else{g=a.yRange.max-f.yRange.max;const m=(f.yRange.max-f.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;m<0&&(g+=m)}for(const m of u)m.x+=p,m.y+=g,n.push(m)}let l=1;for(;l({radius:h*p.radius,x:n+d+(p.x-s.min)*h,y:n+f+(p.y-o.min)*h,setid:p.setid})))}function hLe(t){const e={};for(const r of t)e[r.setid]=r;return e}function dLe(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function KDt(t={}){let e=!1,r=600,n=350,i=15,a=1e3,s=Math.PI/2,o=!0,l=null,u=!0,h=!0,d=null,f=null,p=!1,g=null,m=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,y={},v=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],T=0,b=function(k){if(k in y)return y[k];var E=y[k]=v[T];return T+=1,T>=v.length&&(T=0),E},w=sLe,C=dx;function S(k){let E=k.datum();const _=new Set;E.forEach(Y=>{Y.size==0&&Y.sets.length==1&&_.add(Y.sets[0])}),E=E.filter(Y=>!Y.sets.some(ie=>_.has(ie)));let M={},L={};if(E.length>0){let Y=w(E,{lossFunction:C,distinct:p});o&&(Y=cLe(Y,s,f)),M=uLe(Y,r,n,i,l),L=pLe(M,E,m)}const P={};E.forEach(Y=>{Y.label&&(P[Y.sets]=Y.label)});function D(Y){if(Y.sets in P)return P[Y.sets];if(Y.sets.length==1)return""+Y.sets[0]}k.selectAll("svg").data([M]).enter().append("svg");const R=k.select("svg");e?R.attr("viewBox",`0 0 ${r} ${n}`):R.attr("width",r).attr("height",n);const I={};let $=!1;R.selectAll(".venn-area path").each(function(Y){const ie=this.getAttribute("d");Y.sets.length==1&&ie&&!p&&($=!0,I[Y.sets[0]]=JDt(ie))});function O(Y){return ie=>{const K=Y.sets.map(Q=>{let te=I[Q],J=M[Q];return te||(te={x:r/2,y:n/2,radius:1}),J||(J={x:r/2,y:n/2,radius:1}),{x:te.x*(1-ie)+J.x*ie,y:te.y*(1-ie)+J.y*ie,radius:te.radius*(1-ie)+J.radius*ie}});return vae(K,g)}}const N=R.selectAll(".venn-area").data(E,Y=>Y.sets),F=N.enter().append("g").attr("class",Y=>`venn-area venn-${Y.sets.length==1?"circle":"intersection"}${Y.colour||Y.color?" venn-coloured":""}`).attr("data-venn-sets",Y=>Y.sets.join("_")),z=F.append("path"),V=F.append("text").attr("class","label").text(Y=>D(Y)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(z.style("fill-opacity","0").filter(Y=>Y.sets.length==1).style("fill",Y=>Y.colour?Y.colour:Y.color?Y.color:b(Y.sets)).style("fill-opacity",".25"),V.style("fill",Y=>Y.colour||Y.color?"#FFF":t.textFill?t.textFill:Y.sets.length==1?b(Y.sets):"#444"));function B(Y){return typeof Y.transition=="function"?Y.transition("venn").duration(a):Y}let G=k;$&&typeof G.transition=="function"?(G=B(k),G.selectAll("path").attrTween("d",O)):G.selectAll("path").attr("d",Y=>vae(Y.sets.map(ie=>M[ie])),g);const H=G.selectAll("text").filter(Y=>Y.sets in L).text(Y=>D(Y)).attr("x",Y=>Math.floor(L[Y.sets].x)).attr("y",Y=>Math.floor(L[Y.sets].y));u&&($?"on"in H?H.on("end",KN(M,D)):H.each("end",KN(M,D)):H.each(KN(M,D)));const q=B(N.exit()).remove();typeof N.transition=="function"&&q.selectAll("path").attrTween("d",O);const Z=q.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(V.style("font-size","0px"),H.style("font-size",d),Z.style("font-size","0px")),{circles:M,textCentres:L,nodes:N,enter:F,update:G,exit:q}}return S.wrap=function(k){return arguments.length?(u=k,S):u},S.useViewBox=function(){return e=!0,S},S.width=function(k){return arguments.length?(r=k,S):r},S.height=function(k){return arguments.length?(n=k,S):n},S.padding=function(k){return arguments.length?(i=k,S):i},S.distinct=function(k){return arguments.length?(p=k,S):p},S.colours=function(k){return arguments.length?(b=k,S):b},S.colors=function(k){return arguments.length?(b=k,S):b},S.fontSize=function(k){return arguments.length?(d=k,S):d},S.round=function(k){return arguments.length?(g=k,S):g},S.duration=function(k){return arguments.length?(a=k,S):a},S.layoutFunction=function(k){return arguments.length?(w=k,S):w},S.normalize=function(k){return arguments.length?(o=k,S):o},S.scaleToFit=function(k){return arguments.length?(l=k,S):l},S.styled=function(k){return arguments.length?(h=k,S):h},S.orientation=function(k){return arguments.length?(s=k,S):s},S.orientationOrder=function(k){return arguments.length?(f=k,S):f},S.lossFunction=function(k){return arguments.length?(C=k==="default"?dx:k==="logRatio"?lLe:k,S):C},S}function KN(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,a=e(r)||"",s=a.split(/\s+/).reverse(),l=(a.length+s.length)/3;let u=s.pop(),h=[u],d=0;const f=1.1;n.textContent=null;const p=[];function g(b){const w=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return w.textContent=b,p.push(w),n.append(w),w}let m=g(u);for(;u=s.pop(),!!u;){h.push(u);const b=h.join(" ");m.textContent=b,b.length>l&&m.getComputedTextLength()>i&&(h.pop(),m.textContent=h.join(" "),h=[u],m=g(u),d++)}const y=.35-d*f/2,v=n.getAttribute("x"),T=n.getAttribute("y");p.forEach((b,w)=>{b.setAttribute("x",v),b.setAttribute("y",T),b.setAttribute("dy",`${y+w*f}em`)})}}function ZN(t,e,r){let n=e[0].radius-xo(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const s=aLe(h=>-1*ZN({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:r?0:s[0],y:s[1]};let l=!0;for(const h of t)if(xo(o,h)>h.radius){l=!1;break}for(const h of e)if(xo(o,h)h.p1))}function ZDt(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+s+" not represented on screen")}return n}function QDt(t,e,r){const n=[];return n.push(` M`,t,e),n.push(` m`,-r,0),n.push(` a`,r,r,0,1,0,r*2,0),n.push(` -a`,r,r,0,1,0,-r*2,0),n.join(" ")}function KDt(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function pLe(t){if(t.length===0)return[];const e={};return H7(t,e),e.arcs}function gLe(t,e){if(t.length===0)return"M 0 0";const r=Math.pow(10,e||0),n=e!=null?a=>Math.round(a*r)/r:a=>a;if(t.length==1){const a=t[0].circle;return jDt(n(a.x),n(a.y),n(a.radius))}const i=[` +a`,r,r,0,1,0,-r*2,0),n.join(" ")}function JDt(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function gLe(t){if(t.length===0)return[];const e={};return H7(t,e),e.arcs}function mLe(t,e){if(t.length===0)return"M 0 0";const r=Math.pow(10,e||0),n=e!=null?a=>Math.round(a*r)/r:a=>a;if(t.length==1){const a=t[0].circle;return QDt(n(a.x),n(a.y),n(a.radius))}const i=[` M`,n(t[0].p2.x),n(t[0].p2.y)];for(const a of t){const s=n(a.circle.radius);i.push(` -A`,s,s,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}function yae(t,e){return gLe(pLe(t),e)}function ZDt(t,e={}){const{lossFunction:r,layoutFunction:n=aLe,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:s,width:o=600,height:l=350,padding:u=15,scaleToFit:h=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=e;let g=n(t,{lossFunction:r==="default"||!r?dx:r==="logRatio"?oLe:r,distinct:f});i&&(g=lLe(g,a,s));const m=cLe(g,o,l,u,h),y=fLe(m,t,d),v=new Map(Object.keys(m).map(w=>[w,{set:w,x:m[w].x,y:m[w].y,radius:m[w].radius}])),T=t.map(w=>{const C=w.sets.map(E=>v.get(E)),S=pLe(C),k=gLe(S,p);return{circles:C,arcs:S,path:k,area:w,has:new Set(w.sets)}});function b(w){let C="";for(const S of T)S.has.size>w.length&&w.every(k=>S.has.has(k))&&(C+=" "+S.path);return C}return T.map(({circles:w,arcs:C,path:S,area:k})=>({data:k,text:y[k.sets],circles:w,arcs:C,path:S,distinctPath:S+b(k.sets)}))}var xF=(function(){var t=x(function(T,b,w,C){for(w=w||{},C=T.length;C--;w[T[C]]=b);return w},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],a=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],s=[1,31],o=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],h=[1,56],d=[1,58],f=[1,59],p=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],m={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:x(function(b,w,C,S,k,E,_){var M=E.length-1;switch(k){case 1:return E[M-1];case 2:case 3:case 4:this.$=[];break;case 5:E[M-1].push(E[M]),this.$=E[M-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=E[M];break;case 8:S.setDiagramTitle(E[M].substr(6)),this.$=E[M].substr(6);break;case 9:S.addSubsetData([E[M]],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 10:S.addSubsetData([E[M-1]],E[M],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 11:S.addSubsetData([E[M-2]],void 0,parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 12:S.addSubsetData([E[M-3]],E[M-2],parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 13:if(E[M].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M]),S.addSubsetData(E[M],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 14:if(E[M-1].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M-1]),S.addSubsetData(E[M-1],E[M],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 15:if(E[M-2].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M-2]),S.addSubsetData(E[M-2],void 0,parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 16:if(E[M-3].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M-3]),S.addSubsetData(E[M-3],E[M-2],parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 17:case 18:case 19:S.addTextData(E[M-1],E[M],void 0);break;case 20:case 21:S.addTextData(E[M-2],E[M-1],E[M]);break;case 23:S.addStyleData(E[M-1],E[M]);break;case 24:case 25:case 26:var L=S.getCurrentSets();if(!L)throw new Error("text requires set");S.addTextData(L,E[M],void 0);break;case 27:case 28:var L=S.getCurrentSets();if(!L)throw new Error("text requires set");S.addTextData(L,E[M-1],E[M]);break;case 29:case 41:this.$=[E[M]];break;case 30:case 42:this.$=[...E[M-2],E[M]];break;case 31:this.$=[E[M-2],E[M]];break;case 33:this.$=E[M].join(" ");break;case 34:this.$=[E[M]];break;case 35:E[M-1].push(E[M]),this.$=E[M-1];break;case 43:case 44:this.$=E[M];break}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},t(r,[2,9],{14:[1,27],15:[1,28]}),t(a,[2,43]),t(a,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:s}),t(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:s},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:o,25:37,26:38,27:s},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(a,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:o,26:51},{16:u,20:h,21:[1,53],28:52,29:54,30:55,31:d,32:f,33:p},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:h,31:d,32:f,33:p}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:x(function(b,w){if(w.recoverable)this.trace(b);else{var C=new Error(b);throw C.hash=w,C}},"parseError"),parse:x(function(b){var w=this,C=[0],S=[],k=[null],E=[],_=this.table,M="",L=0,P=0,D=2,R=1,I=E.slice.call(arguments,1),$=Object.create(this.lexer),O={yy:{}};for(var N in this.yy)Object.prototype.hasOwnProperty.call(this.yy,N)&&(O.yy[N]=this.yy[N]);$.setInput(b,O.yy),O.yy.lexer=$,O.yy.parser=this,typeof $.yylloc>"u"&&($.yylloc={});var F=$.yylloc;E.push(F);var z=$.options&&$.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(ge){C.length=C.length-2*ge,k.length=k.length-ge,E.length=E.length-ge}x(V,"popStack");function B(){var ge;return ge=S.pop()||$.lex()||R,typeof ge!="number"&&(ge instanceof Array&&(S=ge,ge=S.pop()),ge=w.symbols_[ge]||ge),ge}x(B,"lex");for(var G,H,q,Z,Y={},ie,K,Q,te;;){if(H=C[C.length-1],this.defaultActions[H]?q=this.defaultActions[H]:((G===null||typeof G>"u")&&(G=B()),q=_[H]&&_[H][G]),typeof q>"u"||!q.length||!q[0]){var J="";te=[];for(ie in _[H])this.terminals_[ie]&&ie>D&&te.push("'"+this.terminals_[ie]+"'");$.showPosition?J="Parse error on line "+(L+1)+`: +A`,s,s,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}function vae(t,e){return mLe(gLe(t),e)}function eOt(t,e={}){const{lossFunction:r,layoutFunction:n=sLe,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:s,width:o=600,height:l=350,padding:u=15,scaleToFit:h=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=e;let g=n(t,{lossFunction:r==="default"||!r?dx:r==="logRatio"?lLe:r,distinct:f});i&&(g=cLe(g,a,s));const m=uLe(g,o,l,u,h),y=pLe(m,t,d),v=new Map(Object.keys(m).map(w=>[w,{set:w,x:m[w].x,y:m[w].y,radius:m[w].radius}])),T=t.map(w=>{const C=w.sets.map(E=>v.get(E)),S=gLe(C),k=mLe(S,p);return{circles:C,arcs:S,path:k,area:w,has:new Set(w.sets)}});function b(w){let C="";for(const S of T)S.has.size>w.length&&w.every(k=>S.has.has(k))&&(C+=" "+S.path);return C}return T.map(({circles:w,arcs:C,path:S,area:k})=>({data:k,text:y[k.sets],circles:w,arcs:C,path:S,distinctPath:S+b(k.sets)}))}var xF=(function(){var t=x(function(T,b,w,C){for(w=w||{},C=T.length;C--;w[T[C]]=b);return w},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],a=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],s=[1,31],o=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],h=[1,56],d=[1,58],f=[1,59],p=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],m={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:x(function(b,w,C,S,k,E,_){var M=E.length-1;switch(k){case 1:return E[M-1];case 2:case 3:case 4:this.$=[];break;case 5:E[M-1].push(E[M]),this.$=E[M-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=E[M];break;case 8:S.setDiagramTitle(E[M].substr(6)),this.$=E[M].substr(6);break;case 9:S.addSubsetData([E[M]],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 10:S.addSubsetData([E[M-1]],E[M],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 11:S.addSubsetData([E[M-2]],void 0,parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 12:S.addSubsetData([E[M-3]],E[M-2],parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 13:if(E[M].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M]),S.addSubsetData(E[M],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 14:if(E[M-1].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M-1]),S.addSubsetData(E[M-1],E[M],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 15:if(E[M-2].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M-2]),S.addSubsetData(E[M-2],void 0,parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 16:if(E[M-3].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M-3]),S.addSubsetData(E[M-3],E[M-2],parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 17:case 18:case 19:S.addTextData(E[M-1],E[M],void 0);break;case 20:case 21:S.addTextData(E[M-2],E[M-1],E[M]);break;case 23:S.addStyleData(E[M-1],E[M]);break;case 24:case 25:case 26:var L=S.getCurrentSets();if(!L)throw new Error("text requires set");S.addTextData(L,E[M],void 0);break;case 27:case 28:var L=S.getCurrentSets();if(!L)throw new Error("text requires set");S.addTextData(L,E[M-1],E[M]);break;case 29:case 41:this.$=[E[M]];break;case 30:case 42:this.$=[...E[M-2],E[M]];break;case 31:this.$=[E[M-2],E[M]];break;case 33:this.$=E[M].join(" ");break;case 34:this.$=[E[M]];break;case 35:E[M-1].push(E[M]),this.$=E[M-1];break;case 43:case 44:this.$=E[M];break}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},t(r,[2,9],{14:[1,27],15:[1,28]}),t(a,[2,43]),t(a,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:s}),t(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:s},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:o,25:37,26:38,27:s},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(a,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:o,26:51},{16:u,20:h,21:[1,53],28:52,29:54,30:55,31:d,32:f,33:p},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:h,31:d,32:f,33:p}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:x(function(b,w){if(w.recoverable)this.trace(b);else{var C=new Error(b);throw C.hash=w,C}},"parseError"),parse:x(function(b){var w=this,C=[0],S=[],k=[null],E=[],_=this.table,M="",L=0,P=0,D=2,R=1,I=E.slice.call(arguments,1),$=Object.create(this.lexer),O={yy:{}};for(var N in this.yy)Object.prototype.hasOwnProperty.call(this.yy,N)&&(O.yy[N]=this.yy[N]);$.setInput(b,O.yy),O.yy.lexer=$,O.yy.parser=this,typeof $.yylloc>"u"&&($.yylloc={});var F=$.yylloc;E.push(F);var z=$.options&&$.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(ge){C.length=C.length-2*ge,k.length=k.length-ge,E.length=E.length-ge}x(V,"popStack");function B(){var ge;return ge=S.pop()||$.lex()||R,typeof ge!="number"&&(ge instanceof Array&&(S=ge,ge=S.pop()),ge=w.symbols_[ge]||ge),ge}x(B,"lex");for(var G,H,q,Z,Y={},ie,K,Q,te;;){if(H=C[C.length-1],this.defaultActions[H]?q=this.defaultActions[H]:((G===null||typeof G>"u")&&(G=B()),q=_[H]&&_[H][G]),typeof q>"u"||!q.length||!q[0]){var J="";te=[];for(ie in _[H])this.terminals_[ie]&&ie>D&&te.push("'"+this.terminals_[ie]+"'");$.showPosition?J="Parse error on line "+(L+1)+`: `+$.showPosition()+` Expecting `+te.join(", ")+", got '"+(this.terminals_[G]||G)+"'":J="Parse error on line "+(L+1)+": Unexpected "+(G==R?"end of input":"'"+(this.terminals_[G]||G)+"'"),this.parseError(J,{text:$.match,token:this.terminals_[G]||G,line:$.yylineno,loc:F,expected:te})}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+H+", token: "+G);switch(q[0]){case 1:C.push(G),k.push($.yytext),E.push($.yylloc),C.push(q[1]),G=null,P=$.yyleng,M=$.yytext,L=$.yylineno,F=$.yylloc;break;case 2:if(K=this.productions_[q[1]][1],Y.$=k[k.length-K],Y._$={first_line:E[E.length-(K||1)].first_line,last_line:E[E.length-1].last_line,first_column:E[E.length-(K||1)].first_column,last_column:E[E.length-1].last_column},z&&(Y._$.range=[E[E.length-(K||1)].range[0],E[E.length-1].range[1]]),Z=this.performAction.apply(Y,[M,P,L,O.yy,q[1],k,E].concat(I)),typeof Z<"u")return Z;K&&(C=C.slice(0,-1*K*2),k=k.slice(0,-1*K),E=E.slice(0,-1*K)),C.push(this.productions_[q[1]][0]),k.push(Y.$),E.push(Y._$),Q=_[C[C.length-2]][C[C.length-1]],C.push(Q);break;case 3:return!0}}return!0},"parse")},y=(function(){var T={EOF:1,parseError:x(function(w,C){if(this.yy.parser)this.yy.parser.parseError(w,C);else throw new Error(w)},"parseError"),setInput:x(function(b,w){return this.yy=w||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var w=b.match(/(?:\r\n?|\n).*/g);return w?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:x(function(b){var w=b.length,C=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-w),this.offset-=w;var S=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),C.length-1&&(this.yylineno-=C.length-1);var k=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:C?(C.length===S.length?this.yylloc.first_column:0)+S[S.length-C.length].length-C[0].length:this.yylloc.first_column-w},this.options.ranges&&(this.yylloc.range=[k[0],k[0]+this.yyleng-w]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(b){this.unput(this.match.slice(b))},"less"),pastInput:x(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var b=this.pastInput(),w=new Array(b.length+1).join("-");return b+this.upcomingInput()+` `+w+"^"},"showPosition"),test_match:x(function(b,w){var C,S,k;if(this.options.backtrack_lexer&&(k={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(k.yylloc.range=this.yylloc.range.slice(0))),S=b[0].match(/(?:\r\n?|\n).*/g),S&&(this.yylineno+=S.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:S?S[S.length-1].length-S[S.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],C=this.performAction.call(this,this.yy,this,w,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),C)return C;if(this._backtrack){for(var E in k)this[E]=k[E];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,w,C,S;this._more||(this.yytext="",this.match="");for(var k=this._currentRules(),E=0;Ew[0].length)){if(w=C,S=E,this.options.backtrack_lexer){if(b=this.test_match(C,k[E]),b!==!1)return b;if(this._backtrack){w=!1;continue}else return!1}else if(!this.options.flex)break}return w?(b=this.test_match(w,k[S]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var w=this.next();return w||this.lex()},"lex"),begin:x(function(w){this.conditionStack.push(w)},"begin"),popState:x(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:x(function(w){this.begin(w)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(w,C,S,k){switch(S){case 0:break;case 1:break;case 2:break;case 3:if(w.getIndentMode&&w.getIndentMode())return w.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:w.setIndentMode&&w.setIndentMode(!1),this.begin("INITIAL"),this.unput(C.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(w.consumeIndentText)w.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return C.yytext=C.yytext.slice(2,-2),14;case 17:return C.yytext=C.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return T})();m.lexer=y;function v(){this.yy={}}return x(v,"Parser"),v.prototype=m,m.Parser=v,new v})();xF.parser=xF;var QDt=xF,eY=[],tY=[],rY=[],nY=new Set,iY,aY=!1,JDt=x((t,e,r)=>{const n=q7(t).sort(),i=r??10/Math.pow(t.length,2);iY=n,n.length===1&&nY.add(n[0]),eY.push({sets:n,size:i,label:e?$k(e):void 0})},"addSubsetData"),eOt=x(()=>eY,"getSubsetData"),$k=x(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),tOt=x(t=>t&&$k(t),"normalizeStyleValue"),rOt=x((t,e,r)=>{const n=$k(e);tY.push({sets:q7(t).sort(),id:n,label:r?$k(r):void 0})},"addTextData"),nOt=x((t,e)=>{const r=q7(t).sort(),n={};for(const[i,a]of e)n[i]=tOt(a)??a;rY.push({targets:r,styles:n})},"addStyleData"),iOt=x(()=>rY,"getStyleData"),q7=x(t=>t.map(e=>$k(e)),"normalizeIdentifierList"),aOt=x(t=>{const r=q7(t).filter(n=>!nY.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),sOt=x(()=>tY,"getTextData"),oOt=x(()=>iY,"getCurrentSets"),lOt=x(()=>aY,"getIndentMode"),cOt=x(t=>{aY=t},"setIndentMode"),uOt=Vr.venn;function mLe(){return ri(uOt,Xt().venn)}x(mLe,"getConfig");var hOt=x(()=>{On(),eY.length=0,tY.length=0,rY.length=0,nY.clear(),iY=void 0,aY=!1},"customClear"),dOt={getConfig:mLe,clear:hOt,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii,addSubsetData:JDt,getSubsetData:eOt,addTextData:rOt,addStyleData:nOt,validateUnionIdentifiers:aOt,getTextData:sOt,getStyleData:iOt,getCurrentSets:oOt,getIndentMode:lOt,setIndentMode:cOt},fOt=x(t=>` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var w=this.next();return w||this.lex()},"lex"),begin:x(function(w){this.conditionStack.push(w)},"begin"),popState:x(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:x(function(w){this.begin(w)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(w,C,S,k){switch(S){case 0:break;case 1:break;case 2:break;case 3:if(w.getIndentMode&&w.getIndentMode())return w.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:w.setIndentMode&&w.setIndentMode(!1),this.begin("INITIAL"),this.unput(C.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(w.consumeIndentText)w.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return C.yytext=C.yytext.slice(2,-2),14;case 17:return C.yytext=C.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return T})();m.lexer=y;function v(){this.yy={}}return x(v,"Parser"),v.prototype=m,m.Parser=v,new v})();xF.parser=xF;var tOt=xF,eY=[],tY=[],rY=[],nY=new Set,iY,aY=!1,rOt=x((t,e,r)=>{const n=q7(t).sort(),i=r??10/Math.pow(t.length,2);iY=n,n.length===1&&nY.add(n[0]),eY.push({sets:n,size:i,label:e?$k(e):void 0})},"addSubsetData"),nOt=x(()=>eY,"getSubsetData"),$k=x(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),iOt=x(t=>t&&$k(t),"normalizeStyleValue"),aOt=x((t,e,r)=>{const n=$k(e);tY.push({sets:q7(t).sort(),id:n,label:r?$k(r):void 0})},"addTextData"),sOt=x((t,e)=>{const r=q7(t).sort(),n={};for(const[i,a]of e)n[i]=iOt(a)??a;rY.push({targets:r,styles:n})},"addStyleData"),oOt=x(()=>rY,"getStyleData"),q7=x(t=>t.map(e=>$k(e)),"normalizeIdentifierList"),lOt=x(t=>{const r=q7(t).filter(n=>!nY.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),cOt=x(()=>tY,"getTextData"),uOt=x(()=>iY,"getCurrentSets"),hOt=x(()=>aY,"getIndentMode"),dOt=x(t=>{aY=t},"setIndentMode"),fOt=Vr.venn;function yLe(){return ri(fOt,Xt().venn)}x(yLe,"getConfig");var pOt=x(()=>{$n(),eY.length=0,tY.length=0,rY.length=0,nY.clear(),iY=void 0,aY=!1},"customClear"),gOt={getConfig:yLe,clear:pOt,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii,addSubsetData:rOt,getSubsetData:nOt,addTextData:aOt,addStyleData:sOt,validateUnionIdentifiers:lOt,getTextData:cOt,getStyleData:oOt,getCurrentSets:uOt,getIndentMode:hOt,setIndentMode:dOt},mOt=x(t=>` .venn-title { font-size: 32px; fill: ${t.vennTitleTextColor}; @@ -3537,7 +3539,7 @@ Expecting `+te.join(", ")+", got '"+(this.terminals_[G]||G)+"'":J="Parse error o font-family: ${t.fontFamily}; color: ${t.vennSetTextColor}; } -`,"getStyles"),pOt=fOt;function yLe(t){const e=new Map;for(const r of t){const n=r.targets.join("|"),i=e.get(n);i?Object.assign(i,r.styles):e.set(n,{...r.styles})}return e}x(yLe,"buildStyleByKey");var gOt=x((t,e,r,n)=>{var I,$,O;const i=n.db,a=(I=i.getConfig)==null?void 0:I.call(i),{themeVariables:s,look:o,handDrawnSeed:l}=Xt(),u=o==="handDrawn",h=[s.venn1,s.venn2,s.venn3,s.venn4,s.venn5,s.venn6,s.venn7,s.venn8].filter(Boolean),d=($=i.getDiagramTitle)==null?void 0:$.call(i),f=i.getSubsetData(),p=i.getTextData(),g=yLe(i.getStyleData()),m=bLe(f),y=(a==null?void 0:a.width)??800,v=(a==null?void 0:a.height)??450,b=y/1600,w=d?48*b:0,C=s.primaryTextColor??s.textColor,S=xs(e);S.attr("viewBox",`0 0 ${y} ${v}`),d&&S.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*b}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*b).style("fill",s.vennTitleTextColor||s.titleColor);const k=ut(document.createElement("div")),E=YDt().width(y).height(v-w);k.datum(m).call(E);const _=u?Gt.svg(k.select("svg").node()):void 0,M=ZDt(m,{width:y,height:v-w,padding:(a==null?void 0:a.padding)??15}),L=new Map;for(const N of M){const F=Td([...N.data.sets].sort());L.set(F,N)}p.length>0&&vLe(a,L,k,p,b,g);const P=Zs(s.background||"#f4f4f4");k.selectAll(".venn-circle").each(function(N,F){var K;const z=ut(this),B=Td([...N.sets].sort()),G=g.get(B),H=(G==null?void 0:G.fill)||h[F%h.length]||s.primaryColor;z.classed(`venn-set-${F%8}`,!0);const q=(G==null?void 0:G["fill-opacity"])??.1,Z=(G==null?void 0:G.stroke)||H,Y=(G==null?void 0:G["stroke-width"])||`${5*b}`;if(u&&_){const Q=L.get(B);if(Q&&Q.circles.length>0){const te=Q.circles[0],J=_.circle(te.x,te.y,te.radius*2,{roughness:.7,seed:l,fill:aj(H,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+F*60,stroke:Z,strokeWidth:parseFloat(String(Y))});z.select("path").remove(),(K=z.node())==null||K.insertBefore(J,z.select("text").node())}}else z.select("path").style("fill",H).style("fill-opacity",q).style("stroke",Z).style("stroke-width",Y).style("stroke-opacity",.95);const ie=(G==null?void 0:G.color)||(P?Je(H,30):et(H,30));z.select("text").style("font-size",`${48*b}px`).style("fill",ie)}),u&&_?k.selectAll(".venn-intersection").each(function(N){var H;const F=ut(this),V=Td([...N.sets].sort()),B=g.get(V),G=B==null?void 0:B.fill;if(G){const q=F.select("path"),Z=q.attr("d");if(Z){const Y=_.path(Z,{roughness:.7,seed:l,fill:aj(G,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),ie=q.node();(H=ie==null?void 0:ie.parentNode)==null||H.insertBefore(Y,ie),q.remove()}}else F.select("path").style("fill-opacity",0);F.select("text").style("font-size",`${48*b}px`).style("fill",(B==null?void 0:B.color)??s.vennSetTextColor??C)}):(k.selectAll(".venn-intersection text").style("font-size",`${48*b}px`).style("fill",N=>{var V;const z=Td([...N.sets].sort());return((V=g.get(z))==null?void 0:V.color)??s.vennSetTextColor??C}),k.selectAll(".venn-intersection path").style("fill-opacity",N=>{var V;const z=Td([...N.sets].sort());return(V=g.get(z))!=null&&V.fill?1:0}).style("fill",N=>{var V;const z=Td([...N.sets].sort());return((V=g.get(z))==null?void 0:V.fill)??"transparent"}));const D=S.append("g").attr("transform",`translate(0, ${w})`),R=k.select("svg").node();if(R&&"childNodes"in R)for(const N of[...R.childNodes])(O=D.node())==null||O.appendChild(N);Ai(S,v,y,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function Td(t){return t.join("|")}x(Td,"stableSetsKey");function vLe(t,e,r,n,i,a){var h;const s=(t==null?void 0:t.useDebugLayout)??!1,l=r.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const d of n){const f=Td(d.sets),p=u.get(f);p?p.push(d):u.set(f,[d])}for(const[d,f]of u.entries()){const p=e.get(d);if(!(p!=null&&p.text))continue;const g=p.text.x,m=p.text.y,y=Math.min(...p.circles.map(I=>I.radius)),v=Math.min(...p.circles.map(I=>I.radius-Math.hypot(g-I.x,m-I.y)));let T=Number.isFinite(v)?Math.max(0,v):0;T===0&&Number.isFinite(y)&&(T=y*.6);const b=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);s&&b.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",T).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const w=Math.max(80*i,T*2*.95),C=Math.max(60*i,T*2*.95),E=(p.data.label&&p.data.label.length>0?Math.min(32*i,T*.25):0)+(f.length<=2?30*i:0),_=g-w/2,M=m-C/2+E,L=Math.max(1,Math.ceil(Math.sqrt(f.length))),P=Math.max(1,Math.ceil(f.length/L)),D=w/L,R=C/P;for(const[I,$]of f.entries()){const O=I%L,N=Math.floor(I/L),F=_+D*(O+.5),z=M+R*(N+.5);s&&b.append("rect").attr("class","venn-text-debug-cell").attr("x",_+D*O).attr("y",M+R*N).attr("width",D).attr("height",R).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const V=D*.9,B=R*.9,G=b.append("foreignObject").attr("class","venn-text-node-fo").attr("width",V).attr("height",B).attr("x",F-V/2).attr("y",z-B/2).attr("overflow","visible"),H=(h=a.get($.id))==null?void 0:h.color,q=G.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text($.label??$.id);H&&q.style("color",H)}}}x(vLe,"renderTextNodes");function bLe(t){const e=new Set(t.map(i=>[...i.sets].sort().join("|"))),r=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),n=[];for(const i of t){if(i.sets.length<3)continue;const a=[...i.sets].sort();for(let s=0;s0?[...t,...n]:t}x(bLe,"ensurePairwiseSubsets");var mOt={draw:gOt},yOt={parser:QDt,db:dOt,renderer:mOt,styles:pOt};const vOt=Object.freeze(Object.defineProperty({__proto__:null,diagram:yOt},Symbol.toStringTag,{value:"Module"}));var ub,xLe=(ub=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Hn,this.getAccTitle=ni,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getAccDescription=ai,this.setAccDescription=ii}getNodes(){return this.nodes}getConfig(){const e=Vr,r=Xt();return ri({...e.treemap,...r.treemap??{}})}addNode(e,r){this.nodes.push(e),this.levels.set(e,r),r===0&&(this.outerNodes.push(e),this.root??(this.root=e))}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},i=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(a=>{tV(a)&&(n!=null&&n.textStyles?n.textStyles.push(a):n.textStyles=[a]),n!=null&&n.styles?n.styles.push(a):n.styles=[a]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){var r;return((r=this.classes.get(e))==null?void 0:r.styles)??[]}clear(){On(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},x(ub,"TreeMapDB"),ub);function TLe(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const a=r[r.length-1].node;a.children?a.children.push(i):a.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}x(TLe,"buildHierarchy");var bOt=x((t,e)=>{eo(t,e);const r=[];for(const a of t.TreemapRows??[])a.$type==="ClassDefStatement"&&e.addClass(a.className??"",a.styleText??"");for(const a of t.TreemapRows??[]){const s=a.item;if(!s)continue;const o=a.indent?parseInt(a.indent):0,l=xOt(s),u=s.classSelector?e.getStylesForClass(s.classSelector):[],h=u.length>0?u:void 0,d={level:o,name:l,type:s.$type,value:s.value,classSelector:s.classSelector,cssCompiledStyles:h};r.push(d)}const n=TLe(r),i=x((a,s)=>{for(const o of a)e.addNode(o,s),o.children&&o.children.length>0&&i(o.children,s+1)},"addNodesRecursively");i(n,0)},"populate"),xOt=x(t=>t.name?String(t.name):"","getItemName"),wLe={parser:{yy:void 0},parse:x(async t=>{var e;try{const n=await Al("treemap",t);le.debug("Treemap AST:",n);const i=(e=wLe.parser)==null?void 0:e.yy;if(!(i instanceof xLe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");bOt(n,i)}catch(r){throw le.error("Error parsing treemap:",r),r}},"parse")},TOt=10,dm=10,IT=25,wOt=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??TOt,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=Xt();if(!l)return;const h=o?30:0,d=xs(e),f=a.nodeWidth?a.nodeWidth*dm:960,p=a.nodeHeight?a.nodeHeight*dm:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),Ai(d,m,g,a.useMaxWidth);let y;try{const B=a.valueFormat||",";if(B==="$0,0")y=x(G=>"$"+Cp(",")(G),"valueFormat");else if(B.startsWith("$")&&B.includes(",")){const G=/\.\d+/.exec(B),H=G?G[0]:"";y=x(q=>"$"+Cp(","+H)(q),"valueFormat")}else if(B.startsWith("$")){const G=B.substring(1);y=x(H=>"$"+Cp(G||"")(H),"valueFormat")}else y=Cp(B)}catch(B){le.error("Error creating format function:",B),y=Cp(",")}const v=h0().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),T=h0().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),b=h0().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const w=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),C=zz(l).sum(B=>B.value??0).sort((B,G)=>(G.value??0)-(B.value??0)),k=EHe().size([f,p]).paddingTop(B=>B.children&&B.children.length>0?IT+dm:0).paddingInner(s).paddingLeft(B=>B.children&&B.children.length>0?dm:0).paddingRight(B=>B.children&&B.children.length>0?dm:0).paddingBottom(B=>B.children&&B.children.length>0?dm:0).round(!0)(C),E=k.descendants().filter(B=>B.children&&B.children.length>0),_=w.selectAll(".treemapSection").data(E).enter().append("g").attr("class","treemapSection").attr("transform",B=>`translate(${B.x0},${B.y0})`);_.append("rect").attr("width",B=>B.x1-B.x0).attr("height",IT).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",B=>B.depth===0?"display: none;":""),_.append("clipPath").attr("id",(B,G)=>`clip-section-${e}-${G}`).append("rect").attr("width",B=>Math.max(0,B.x1-B.x0-12)).attr("height",IT),_.append("rect").attr("width",B=>B.x1-B.x0).attr("height",B=>B.y1-B.y0).attr("class",(B,G)=>`treemapSection section${G}`).attr("fill",B=>v(B.data.name)).attr("fill-opacity",.6).attr("stroke",B=>T(B.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",B=>{if(B.depth===0)return"display: none;";const G=zt({cssCompiledStyles:B.data.cssCompiledStyles});return G.nodeStyles+";"+G.borderStyles.join(";")}),_.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",IT/2).attr("dominant-baseline","middle").text(B=>B.depth===0?"":B.data.name).attr("font-weight","bold").attr("clip-path",(B,G)=>`url(#clip-section-${e}-${G})`).attr("style",B=>{if(B.depth===0)return"display: none;";const G="dominant-baseline: middle; font-size: 12px; fill:"+b(B.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",H=zt({cssCompiledStyles:B.data.cssCompiledStyles});return G+H.labelStyles.replace("color:","fill:")}).each(function(B){if(B.depth===0)return;const G=ut(this),H=B.data.name;G.text(H);const q=B.x1-B.x0,Z=6;let Y;a.showValues!==!1&&B.value?Y=q-10-30-10-Z:Y=q-Z-6;const K=Math.max(15,Y),Q=G.node();if(Q.getComputedTextLength()>K){let ge=H;for(;ge.length>0;){if(ge=H.substring(0,ge.length-1),ge.length===0){G.text("..."),Q.getComputedTextLength()>K&&G.text("");break}if(G.text(ge+"..."),Q.getComputedTextLength()<=K)break}}}),a.showValues!==!1&&_.append("text").attr("class","treemapSectionValue").attr("x",B=>B.x1-B.x0-10).attr("y",IT/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(B=>B.value?y(B.value):"").attr("font-style","italic").attr("style",B=>{if(B.depth===0)return"display: none;";const G="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+b(B.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",H=zt({cssCompiledStyles:B.data.cssCompiledStyles});return G+H.labelStyles.replace("color:","fill:")});const M=k.leaves(),L=M.length>20,P=L?16:38,D=L?14:28,R=L?4:8,I=L?4:6,$=L?2:4,O=L?8:10,N=L?1:2,F=w.selectAll(".treemapLeafGroup").data(M).enter().append("g").attr("class",(B,G)=>`treemapNode treemapLeafGroup leaf${G}${B.data.classSelector?` ${B.data.classSelector}`:""}x`).attr("transform",B=>`translate(${B.x0},${B.y0})`);F.append("rect").attr("width",B=>B.x1-B.x0).attr("height",B=>B.y1-B.y0).attr("class","treemapLeaf").attr("fill",B=>B.parent?v(B.parent.data.name):v(B.data.name)).attr("style",B=>zt({cssCompiledStyles:B.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",B=>B.parent?v(B.parent.data.name):v(B.data.name)).attr("stroke-width",3),F.append("clipPath").attr("id",(B,G)=>`clip-${e}-${G}`).append("rect").attr("width",B=>Math.max(0,B.x1-B.x0-4)).attr("height",B=>Math.max(0,B.y1-B.y0-4)),F.append("text").attr("class","treemapLabel").attr("x",B=>(B.x1-B.x0)/2).attr("y",B=>(B.y1-B.y0)/2).attr("style",B=>{const G=`text-anchor: middle; dominant-baseline: middle; font-size: ${P}px;fill:`+b(B.data.name)+";",H=zt({cssCompiledStyles:B.data.cssCompiledStyles});return G+H.labelStyles.replace("color:","fill:")}).attr("clip-path",(B,G)=>`url(#clip-${e}-${G})`).text(B=>B.data.name).each(function(B){const G=ut(this),H=B.x1-B.x0,q=B.y1-B.y0,Z=G.node(),Y=H-2*$,ie=q-2*$;if(YY&&K>R;)K--,G.style("font-size",`${K}px`);let te=Math.max(I,Math.min(D,Math.round(K*Q))),J=K+N+te;for(;J>ie&&K>R&&(K--,te=Math.max(I,Math.min(D,Math.round(K*Q))),!(teY||K(G.x1-G.x0)/2).attr("y",function(G){return(G.y1-G.y0)/2}).attr("style",G=>{const H=`text-anchor: middle; dominant-baseline: hanging; font-size: ${D}px;fill:`+b(G.data.name)+";",q=zt({cssCompiledStyles:G.data.cssCompiledStyles});return H+q.labelStyles.replace("color:","fill:")}).attr("clip-path",(G,H)=>`url(#clip-${e}-${H})`).text(G=>G.value?y(G.value):"").each(function(G){const H=ut(this),q=this.parentNode;if(!q){H.style("display","none");return}const Z=ut(q).select(".treemapLabel");if(Z.empty()||Z.style("display")==="none"){H.style("display","none");return}const Y=parseFloat(Z.style("font-size")),K=Math.max(I,Math.min(D,Math.round(Y*.6)));H.style("font-size",`${K}px`);const te=(G.y1-G.y0)/2+Y/2+N;H.attr("y",te);const J=G.x1-G.x0,Re=G.y1-G.y0-4,Ie=J-2*$;H.node().getComputedTextLength()>Ie||te+K>Re||K{const e=Dh(),r=Xt(),n=ri(e,r.themeVariables),i=ri(SOt,t),a=i.titleColor??n.titleColor,s=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` +`,"getStyles"),yOt=mOt;function vLe(t){const e=new Map;for(const r of t){const n=r.targets.join("|"),i=e.get(n);i?Object.assign(i,r.styles):e.set(n,{...r.styles})}return e}x(vLe,"buildStyleByKey");var vOt=x((t,e,r,n)=>{var I,$,O;const i=n.db,a=(I=i.getConfig)==null?void 0:I.call(i),{themeVariables:s,look:o,handDrawnSeed:l}=Xt(),u=o==="handDrawn",h=[s.venn1,s.venn2,s.venn3,s.venn4,s.venn5,s.venn6,s.venn7,s.venn8].filter(Boolean),d=($=i.getDiagramTitle)==null?void 0:$.call(i),f=i.getSubsetData(),p=i.getTextData(),g=vLe(i.getStyleData()),m=xLe(f),y=(a==null?void 0:a.width)??800,v=(a==null?void 0:a.height)??450,b=y/1600,w=d?48*b:0,C=s.primaryTextColor??s.textColor,S=xs(e);S.attr("viewBox",`0 0 ${y} ${v}`),d&&S.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*b}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*b).style("fill",s.vennTitleTextColor||s.titleColor);const k=ut(document.createElement("div")),E=KDt().width(y).height(v-w);k.datum(m).call(E);const _=u?Gt.svg(k.select("svg").node()):void 0,M=eOt(m,{width:y,height:v-w,padding:(a==null?void 0:a.padding)??15}),L=new Map;for(const N of M){const F=Td([...N.data.sets].sort());L.set(F,N)}p.length>0&&bLe(a,L,k,p,b,g);const P=Zs(s.background||"#f4f4f4");k.selectAll(".venn-circle").each(function(N,F){var K;const z=ut(this),B=Td([...N.sets].sort()),G=g.get(B),H=(G==null?void 0:G.fill)||h[F%h.length]||s.primaryColor;z.classed(`venn-set-${F%8}`,!0);const q=(G==null?void 0:G["fill-opacity"])??.1,Z=(G==null?void 0:G.stroke)||H,Y=(G==null?void 0:G["stroke-width"])||`${5*b}`;if(u&&_){const Q=L.get(B);if(Q&&Q.circles.length>0){const te=Q.circles[0],J=_.circle(te.x,te.y,te.radius*2,{roughness:.7,seed:l,fill:aj(H,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+F*60,stroke:Z,strokeWidth:parseFloat(String(Y))});z.select("path").remove(),(K=z.node())==null||K.insertBefore(J,z.select("text").node())}}else z.select("path").style("fill",H).style("fill-opacity",q).style("stroke",Z).style("stroke-width",Y).style("stroke-opacity",.95);const ie=(G==null?void 0:G.color)||(P?Je(H,30):et(H,30));z.select("text").style("font-size",`${48*b}px`).style("fill",ie)}),u&&_?k.selectAll(".venn-intersection").each(function(N){var H;const F=ut(this),V=Td([...N.sets].sort()),B=g.get(V),G=B==null?void 0:B.fill;if(G){const q=F.select("path"),Z=q.attr("d");if(Z){const Y=_.path(Z,{roughness:.7,seed:l,fill:aj(G,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),ie=q.node();(H=ie==null?void 0:ie.parentNode)==null||H.insertBefore(Y,ie),q.remove()}}else F.select("path").style("fill-opacity",0);F.select("text").style("font-size",`${48*b}px`).style("fill",(B==null?void 0:B.color)??s.vennSetTextColor??C)}):(k.selectAll(".venn-intersection text").style("font-size",`${48*b}px`).style("fill",N=>{var V;const z=Td([...N.sets].sort());return((V=g.get(z))==null?void 0:V.color)??s.vennSetTextColor??C}),k.selectAll(".venn-intersection path").style("fill-opacity",N=>{var V;const z=Td([...N.sets].sort());return(V=g.get(z))!=null&&V.fill?1:0}).style("fill",N=>{var V;const z=Td([...N.sets].sort());return((V=g.get(z))==null?void 0:V.fill)??"transparent"}));const D=S.append("g").attr("transform",`translate(0, ${w})`),R=k.select("svg").node();if(R&&"childNodes"in R)for(const N of[...R.childNodes])(O=D.node())==null||O.appendChild(N);Ai(S,v,y,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function Td(t){return t.join("|")}x(Td,"stableSetsKey");function bLe(t,e,r,n,i,a){var h;const s=(t==null?void 0:t.useDebugLayout)??!1,l=r.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const d of n){const f=Td(d.sets),p=u.get(f);p?p.push(d):u.set(f,[d])}for(const[d,f]of u.entries()){const p=e.get(d);if(!(p!=null&&p.text))continue;const g=p.text.x,m=p.text.y,y=Math.min(...p.circles.map(I=>I.radius)),v=Math.min(...p.circles.map(I=>I.radius-Math.hypot(g-I.x,m-I.y)));let T=Number.isFinite(v)?Math.max(0,v):0;T===0&&Number.isFinite(y)&&(T=y*.6);const b=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);s&&b.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",T).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const w=Math.max(80*i,T*2*.95),C=Math.max(60*i,T*2*.95),E=(p.data.label&&p.data.label.length>0?Math.min(32*i,T*.25):0)+(f.length<=2?30*i:0),_=g-w/2,M=m-C/2+E,L=Math.max(1,Math.ceil(Math.sqrt(f.length))),P=Math.max(1,Math.ceil(f.length/L)),D=w/L,R=C/P;for(const[I,$]of f.entries()){const O=I%L,N=Math.floor(I/L),F=_+D*(O+.5),z=M+R*(N+.5);s&&b.append("rect").attr("class","venn-text-debug-cell").attr("x",_+D*O).attr("y",M+R*N).attr("width",D).attr("height",R).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const V=D*.9,B=R*.9,G=b.append("foreignObject").attr("class","venn-text-node-fo").attr("width",V).attr("height",B).attr("x",F-V/2).attr("y",z-B/2).attr("overflow","visible"),H=(h=a.get($.id))==null?void 0:h.color,q=G.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text($.label??$.id);H&&q.style("color",H)}}}x(bLe,"renderTextNodes");function xLe(t){const e=new Set(t.map(i=>[...i.sets].sort().join("|"))),r=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),n=[];for(const i of t){if(i.sets.length<3)continue;const a=[...i.sets].sort();for(let s=0;s0?[...t,...n]:t}x(xLe,"ensurePairwiseSubsets");var bOt={draw:vOt},xOt={parser:tOt,db:gOt,renderer:bOt,styles:yOt};const TOt=Object.freeze(Object.defineProperty({__proto__:null,diagram:xOt},Symbol.toStringTag,{value:"Module"}));var ub,TLe=(ub=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Hn,this.getAccTitle=ni,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getAccDescription=ai,this.setAccDescription=ii}getNodes(){return this.nodes}getConfig(){const e=Vr,r=Xt();return ri({...e.treemap,...r.treemap??{}})}addNode(e,r){this.nodes.push(e),this.levels.set(e,r),r===0&&(this.outerNodes.push(e),this.root??(this.root=e))}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},i=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(a=>{tV(a)&&(n!=null&&n.textStyles?n.textStyles.push(a):n.textStyles=[a]),n!=null&&n.styles?n.styles.push(a):n.styles=[a]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){var r;return((r=this.classes.get(e))==null?void 0:r.styles)??[]}clear(){$n(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},x(ub,"TreeMapDB"),ub);function wLe(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const a=r[r.length-1].node;a.children?a.children.push(i):a.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}x(wLe,"buildHierarchy");var wOt=x((t,e)=>{eo(t,e);const r=[];for(const a of t.TreemapRows??[])a.$type==="ClassDefStatement"&&e.addClass(a.className??"",a.styleText??"");for(const a of t.TreemapRows??[]){const s=a.item;if(!s)continue;const o=a.indent?parseInt(a.indent):0,l=COt(s),u=s.classSelector?e.getStylesForClass(s.classSelector):[],h=u.length>0?u:void 0,d={level:o,name:l,type:s.$type,value:s.value,classSelector:s.classSelector,cssCompiledStyles:h};r.push(d)}const n=wLe(r),i=x((a,s)=>{for(const o of a)e.addNode(o,s),o.children&&o.children.length>0&&i(o.children,s+1)},"addNodesRecursively");i(n,0)},"populate"),COt=x(t=>t.name?String(t.name):"","getItemName"),CLe={parser:{yy:void 0},parse:x(async t=>{var e;try{const n=await Al("treemap",t);le.debug("Treemap AST:",n);const i=(e=CLe.parser)==null?void 0:e.yy;if(!(i instanceof TLe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");wOt(n,i)}catch(r){throw le.error("Error parsing treemap:",r),r}},"parse")},kOt=10,dm=10,IT=25,SOt=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??kOt,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=Xt();if(!l)return;const h=o?30:0,d=xs(e),f=a.nodeWidth?a.nodeWidth*dm:960,p=a.nodeHeight?a.nodeHeight*dm:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),Ai(d,m,g,a.useMaxWidth);let y;try{const B=a.valueFormat||",";if(B==="$0,0")y=x(G=>"$"+Cp(",")(G),"valueFormat");else if(B.startsWith("$")&&B.includes(",")){const G=/\.\d+/.exec(B),H=G?G[0]:"";y=x(q=>"$"+Cp(","+H)(q),"valueFormat")}else if(B.startsWith("$")){const G=B.substring(1);y=x(H=>"$"+Cp(G||"")(H),"valueFormat")}else y=Cp(B)}catch(B){le.error("Error creating format function:",B),y=Cp(",")}const v=h0().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),T=h0().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),b=h0().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const w=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),C=zz(l).sum(B=>B.value??0).sort((B,G)=>(G.value??0)-(B.value??0)),k=AHe().size([f,p]).paddingTop(B=>B.children&&B.children.length>0?IT+dm:0).paddingInner(s).paddingLeft(B=>B.children&&B.children.length>0?dm:0).paddingRight(B=>B.children&&B.children.length>0?dm:0).paddingBottom(B=>B.children&&B.children.length>0?dm:0).round(!0)(C),E=k.descendants().filter(B=>B.children&&B.children.length>0),_=w.selectAll(".treemapSection").data(E).enter().append("g").attr("class","treemapSection").attr("transform",B=>`translate(${B.x0},${B.y0})`);_.append("rect").attr("width",B=>B.x1-B.x0).attr("height",IT).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",B=>B.depth===0?"display: none;":""),_.append("clipPath").attr("id",(B,G)=>`clip-section-${e}-${G}`).append("rect").attr("width",B=>Math.max(0,B.x1-B.x0-12)).attr("height",IT),_.append("rect").attr("width",B=>B.x1-B.x0).attr("height",B=>B.y1-B.y0).attr("class",(B,G)=>`treemapSection section${G}`).attr("fill",B=>v(B.data.name)).attr("fill-opacity",.6).attr("stroke",B=>T(B.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",B=>{if(B.depth===0)return"display: none;";const G=zt({cssCompiledStyles:B.data.cssCompiledStyles});return G.nodeStyles+";"+G.borderStyles.join(";")}),_.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",IT/2).attr("dominant-baseline","middle").text(B=>B.depth===0?"":B.data.name).attr("font-weight","bold").attr("clip-path",(B,G)=>`url(#clip-section-${e}-${G})`).attr("style",B=>{if(B.depth===0)return"display: none;";const G="dominant-baseline: middle; font-size: 12px; fill:"+b(B.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",H=zt({cssCompiledStyles:B.data.cssCompiledStyles});return G+H.labelStyles.replace("color:","fill:")}).each(function(B){if(B.depth===0)return;const G=ut(this),H=B.data.name;G.text(H);const q=B.x1-B.x0,Z=6;let Y;a.showValues!==!1&&B.value?Y=q-10-30-10-Z:Y=q-Z-6;const K=Math.max(15,Y),Q=G.node();if(Q.getComputedTextLength()>K){let ge=H;for(;ge.length>0;){if(ge=H.substring(0,ge.length-1),ge.length===0){G.text("..."),Q.getComputedTextLength()>K&&G.text("");break}if(G.text(ge+"..."),Q.getComputedTextLength()<=K)break}}}),a.showValues!==!1&&_.append("text").attr("class","treemapSectionValue").attr("x",B=>B.x1-B.x0-10).attr("y",IT/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(B=>B.value?y(B.value):"").attr("font-style","italic").attr("style",B=>{if(B.depth===0)return"display: none;";const G="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+b(B.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",H=zt({cssCompiledStyles:B.data.cssCompiledStyles});return G+H.labelStyles.replace("color:","fill:")});const M=k.leaves(),L=M.length>20,P=L?16:38,D=L?14:28,R=L?4:8,I=L?4:6,$=L?2:4,O=L?8:10,N=L?1:2,F=w.selectAll(".treemapLeafGroup").data(M).enter().append("g").attr("class",(B,G)=>`treemapNode treemapLeafGroup leaf${G}${B.data.classSelector?` ${B.data.classSelector}`:""}x`).attr("transform",B=>`translate(${B.x0},${B.y0})`);F.append("rect").attr("width",B=>B.x1-B.x0).attr("height",B=>B.y1-B.y0).attr("class","treemapLeaf").attr("fill",B=>B.parent?v(B.parent.data.name):v(B.data.name)).attr("style",B=>zt({cssCompiledStyles:B.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",B=>B.parent?v(B.parent.data.name):v(B.data.name)).attr("stroke-width",3),F.append("clipPath").attr("id",(B,G)=>`clip-${e}-${G}`).append("rect").attr("width",B=>Math.max(0,B.x1-B.x0-4)).attr("height",B=>Math.max(0,B.y1-B.y0-4)),F.append("text").attr("class","treemapLabel").attr("x",B=>(B.x1-B.x0)/2).attr("y",B=>(B.y1-B.y0)/2).attr("style",B=>{const G=`text-anchor: middle; dominant-baseline: middle; font-size: ${P}px;fill:`+b(B.data.name)+";",H=zt({cssCompiledStyles:B.data.cssCompiledStyles});return G+H.labelStyles.replace("color:","fill:")}).attr("clip-path",(B,G)=>`url(#clip-${e}-${G})`).text(B=>B.data.name).each(function(B){const G=ut(this),H=B.x1-B.x0,q=B.y1-B.y0,Z=G.node(),Y=H-2*$,ie=q-2*$;if(YY&&K>R;)K--,G.style("font-size",`${K}px`);let te=Math.max(I,Math.min(D,Math.round(K*Q))),J=K+N+te;for(;J>ie&&K>R&&(K--,te=Math.max(I,Math.min(D,Math.round(K*Q))),!(teY||K(G.x1-G.x0)/2).attr("y",function(G){return(G.y1-G.y0)/2}).attr("style",G=>{const H=`text-anchor: middle; dominant-baseline: hanging; font-size: ${D}px;fill:`+b(G.data.name)+";",q=zt({cssCompiledStyles:G.data.cssCompiledStyles});return H+q.labelStyles.replace("color:","fill:")}).attr("clip-path",(G,H)=>`url(#clip-${e}-${H})`).text(G=>G.value?y(G.value):"").each(function(G){const H=ut(this),q=this.parentNode;if(!q){H.style("display","none");return}const Z=ut(q).select(".treemapLabel");if(Z.empty()||Z.style("display")==="none"){H.style("display","none");return}const Y=parseFloat(Z.style("font-size")),K=Math.max(I,Math.min(D,Math.round(Y*.6)));H.style("font-size",`${K}px`);const te=(G.y1-G.y0)/2+Y/2+N;H.attr("y",te);const J=G.x1-G.x0,Re=G.y1-G.y0-4,Ie=J-2*$;H.node().getComputedTextLength()>Ie||te+K>Re||K{const e=Dh(),r=Xt(),n=ri(e,r.themeVariables),i=ri(_Ot,t),a=i.titleColor??n.titleColor,s=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` .treemapNode.section { stroke: ${i.sectionStrokeColor}; stroke-width: ${i.sectionStrokeWidth}; @@ -3560,8 +3562,8 @@ Expecting `+te.join(", ")+", got '"+(this.terminals_[G]||G)+"'":J="Parse error o fill: ${a}; font-size: ${i.titleFontSize}; } - `},"getStyles"),AOt=EOt,_Ot={parser:wLe,get db(){return new xLe},renderer:kOt,styles:AOt};const ROt=Object.freeze(Object.defineProperty({__proto__:null,diagram:_Ot},Symbol.toStringTag,{value:"Module"}));var L6=x((t,e)=>{const r=t<=1?t*100:t;if(r<0||r>100)throw new Error(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${t}`);return r},"toPercent"),ip=x((t,e,r)=>({x:L6(e,`${r} evolution`),y:L6(t,`${r} visibility`)}),"toCoordinates"),vae=x(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),LOt=x(t=>{if(!(t!=null&&t.startsWith("+")))return{};const e=/^\+'([^']*)'/.exec(t),r=e==null?void 0:e[1];return t.includes("<>")?{flow:"bidirectional",label:r}:t.includes("<")?{flow:"backward",label:r}:t.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),MOt=x((t,e)=>{if(eo(t,e),t.size&&e.setSize(t.size.width,t.size.height),t.evolution){const r=t.evolution.stages.map(i=>i.secondName?`${i.name.trim()} / ${i.secondName.trim()}`:i.name.trim()),n=t.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);e.updateAxes({stages:r,stageBoundaries:n})}if(t.anchors.forEach(r=>{const n=ip(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var o;const n=ip(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,a=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,s=(o=r.decorator)==null?void 0:o.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,a,r.inertia,s)}),t.notes.forEach(r=>{const n=ip(r.visibility,r.evolution,`Note "${r.text}"`);e.addNote(r.text,n.x,n.y)}),t.pipelines.forEach(r=>{const n=e.getNode(r.parent);if(!n||typeof n.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const i=n.y;e.startPipeline(r.parent),r.components.forEach(a=>{const s=`${r.parent}_${a.name}`,o=a.label?(a.label.negX?-1:1)*a.label.offsetX:void 0,l=a.label?(a.label.negY?-1:1)*a.label.offsetY:void 0,u=L6(a.evolution,`Pipeline component "${a.name}" evolution`);e.addNode(s,a.name,u,i,"pipeline-component",o,l),e.addPipelineComponent(r.parent,s)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=vae(r.fromPort)??vae(r.toPort);const{flow:a,label:s}=LOt(r.arrow);!i&&a&&(i=a);const o=r.linkLabel,l=s??o;e.addLink(e.resolveNodeId(r.from),e.resolveNodeId(r.to),n,l,i)}),t.evolves.forEach(r=>{const n=e.getNode(r.component);if((n==null?void 0:n.y)!==void 0){const i=L6(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=ip(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=ip(r.x,r.y,`Annotation ${r.number}`);e.addAnnotation(r.number,[{x:n.x,y:n.y}],r.text)}),t.accelerators.forEach(r=>{const n=ip(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=ip(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),CLe={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Al("wardley",t);le.debug(e);const r=(n=CLe.parser)==null?void 0:n.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");MOt(e,r)},"parse")},hb,IOt=(hb=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(e){const r=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...r,...e,className:e.className??r.className,labelOffsetX:e.labelOffsetX??r.labelOffsetX,labelOffsetY:e.labelOffsetY??r.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const r=this.nodes.get(e);r&&(r.isPipelineParent=!0)}addPipelineComponent(e,r){const n=this.pipelines.get(e);n&&n.componentIds.push(r);const i=this.nodes.get(r);i&&(i.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,r){this.annotationsBox={x:e,y:r}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,r){this.size={width:e,height:r}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[r,n]of this.nodes)if(n.label===e)return r;return e}build(){const e=[];for(const r of this.nodes.values()){if(typeof r.x!="number"||typeof r.y!="number")throw new Error(`Node "${r.label}" is missing coordinates`);e.push(r)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},x(hb,"WardleyBuilder"),hb),ks=new IOt;function kLe(){return Fe()["wardley-beta"]}x(kLe,"getConfig");function SLe(t,e,r,n,i,a,s,o,l){ks.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:s,inertia:o,sourceStrategy:l})}x(SLe,"addNode");function ELe(t,e,r=!1,n,i){ks.addLink({source:t,target:e,dashed:r,label:n,flow:i})}x(ELe,"addLink");function ALe(t,e,r){ks.addTrend({nodeId:t,targetX:e,targetY:r})}x(ALe,"addTrend");function _Le(t,e,r){ks.addAnnotation({number:t,coordinates:e,text:r})}x(_Le,"addAnnotation");function RLe(t,e,r){ks.addNote({text:t,x:e,y:r})}x(RLe,"addNote");function LLe(t,e,r){ks.addAccelerator({name:t,x:e,y:r})}x(LLe,"addAccelerator");function MLe(t,e,r){ks.addDeaccelerator({name:t,x:e,y:r})}x(MLe,"addDeaccelerator");function ILe(t,e){ks.setAnnotationsBox(t,e)}x(ILe,"setAnnotationsBox");function NLe(t,e){ks.setSize(t,e)}x(NLe,"setSize");function DLe(t){ks.startPipeline(t)}x(DLe,"startPipeline");function OLe(t,e){ks.addPipelineComponent(t,e)}x(OLe,"addPipelineComponent");function $Le(t){ks.setAxes(t)}x($Le,"updateAxes");function PLe(t){return ks.getNode(t)}x(PLe,"getNode");function BLe(t){return ks.resolveNodeId(t)}x(BLe,"resolveNodeId");function FLe(){return ks.build()}x(FLe,"getWardleyData");function zLe(){ks.clear(),On()}x(zLe,"clear");var NOt={getConfig:kLe,addNode:SLe,addLink:ELe,addTrend:ALe,addAnnotation:_Le,addNote:RLe,addAccelerator:LLe,addDeaccelerator:MLe,setAnnotationsBox:ILe,setSize:NLe,startPipeline:DLe,addPipelineComponent:OLe,updateAxes:$Le,getNode:PLe,resolveNodeId:BLe,getWardleyData:FLe,clear:zLe,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii},DOt=["Genesis","Custom Built","Product","Commodity"],OOt=x(()=>{var e,r,n,i,a,s,o,l,u,h,d,f;const{themeVariables:t}=Fe();return{backgroundColor:((e=t.wardley)==null?void 0:e.backgroundColor)??t.background??"#fff",axisColor:((r=t.wardley)==null?void 0:r.axisColor)??"#000",axisTextColor:((n=t.wardley)==null?void 0:n.axisTextColor)??t.primaryTextColor??"#222",gridColor:((i=t.wardley)==null?void 0:i.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((a=t.wardley)==null?void 0:a.componentFill)??"#fff",componentStroke:((s=t.wardley)==null?void 0:s.componentStroke)??"#000",componentLabelColor:((o=t.wardley)==null?void 0:o.componentLabelColor)??t.primaryTextColor??"#222",linkStroke:((l=t.wardley)==null?void 0:l.linkStroke)??"#000",evolutionStroke:((u=t.wardley)==null?void 0:u.evolutionStroke)??"#dc3545",annotationStroke:((h=t.wardley)==null?void 0:h.annotationStroke)??"#000",annotationTextColor:((d=t.wardley)==null?void 0:d.annotationTextColor)??t.primaryTextColor??"#222",annotationFill:((f=t.wardley)==null?void 0:f.annotationFill)??t.background??"#fff"}},"getTheme"),$Ot=x(()=>{const t=Fe()["wardley-beta"];return{width:(t==null?void 0:t.width)??900,height:(t==null?void 0:t.height)??600,padding:(t==null?void 0:t.padding)??48,nodeRadius:(t==null?void 0:t.nodeRadius)??6,nodeLabelOffset:(t==null?void 0:t.nodeLabelOffset)??8,axisFontSize:(t==null?void 0:t.axisFontSize)??12,labelFontSize:(t==null?void 0:t.labelFontSize)??10,showGrid:(t==null?void 0:t.showGrid)??!1,useMaxWidth:(t==null?void 0:t.useMaxWidth)??!0}},"getConfigValues"),POt=x((t,e,r,n)=>{var N,F;le.debug(`Rendering Wardley map -`+t);const i=$Ot(),a=OOt(),s=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((N=l.size)==null?void 0:N.width)??i.width,d=((F=l.size)==null?void 0:F.height)??i.height,f=xs(e);f.selectAll("*").remove(),Ai(f,d,h,i.useMaxWidth),f.attr("viewBox",`0 0 ${h} ${d}`);const p=f.append("g").attr("class","wardley-map"),g=f.append("defs");g.append("marker").attr("id",`arrow-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.evolutionStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-end-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.linkStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-start-${e}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",a.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",h).attr("height",d).attr("fill",a.backgroundColor);const m=h-i.padding*2,y=d-i.padding*2;u&&p.append("text").attr("class","wardley-title").attr("x",h/2).attr("y",i.padding/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const v=x(z=>i.padding+z/100*m,"projectX"),T=x(z=>d-i.padding-z/100*y,"projectY"),b=p.append("g").attr("class","wardley-axes");b.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1),b.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1);const w=l.axes.xLabel??"Evolution",C=l.axes.yLabel??"Visibility";b.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+m/2).attr("y",d-i.padding/4).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(w),b.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+y/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+y/2})`).text(C);const S=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:DOt;if(S.length>0){const z=p.append("g").attr("class","wardley-stages"),V=l.axes.stageBoundaries,B=[];if(V&&V.length===S.length){let G=0;V.forEach(H=>{B.push({start:G,end:H}),G=H})}else{const G=1/S.length;S.forEach((H,q)=>{B.push({start:q*G,end:(q+1)*G})})}S.forEach((G,H)=>{const q=B[H],Z=i.padding+q.start*m,Y=i.padding+q.end*m,ie=(Z+Y)/2;H>0&&z.append("line").attr("x1",Z).attr("x2",Z).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),z.append("text").attr("class","wardley-stage-label").attr("x",ie).attr("y",d-i.padding/1.5).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(G)})}if(i.showGrid){const z=p.append("g").attr("class","wardley-grid");for(let V=1;V<4;V++){const B=V/4,G=i.padding+m*B;z.append("line").attr("x1",G).attr("x2",G).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6"),z.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-y*B).attr("y2",d-i.padding-y*B).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6")}}const k=new Map;if(l.nodes.forEach(z=>{k.set(z.id,{x:v(z.x),y:T(z.y),node:z})}),l.pipelines.length>0){const z=p.append("g").attr("class","wardley-pipelines"),V=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(B=>{if(B.componentIds.length===0)return;const G=B.componentIds.map(Y=>({id:Y,pos:k.get(Y),node:l.nodes.find(ie=>ie.id===Y)})).filter(Y=>Y.pos&&Y.node).sort((Y,ie)=>Y.node.x-ie.node.x);for(let Y=0;Y{const ie=k.get(Y);ie&&(H=Math.min(H,ie.x),q=Math.max(q,ie.x),Z=ie.y)}),H!==1/0&&q!==-1/0){const ie=i.nodeRadius*4,K=Z-ie/2,Q=k.get(B.nodeId);if(Q){const te=(H+q)/2;Q.x=te,Q.y=K-s/6}z.append("rect").attr("class","wardley-pipeline-box").attr("x",H-15).attr("y",K).attr("width",q-H+30).attr("height",ie).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const E=p.append("g").attr("class","wardley-links"),_=new Map;l.pipelines.forEach(z=>{_.set(z.nodeId,new Set(z.componentIds))});const M=l.links.filter(z=>{if(!k.has(z.source)||!k.has(z.target))return!1;const V=_.get(z.target);return!(V!=null&&V.has(z.source))});E.selectAll("line").data(M).enter().append("line").attr("class",z=>`wardley-link${z.dashed?" wardley-link--dashed":""}`).attr("x1",z=>{const V=k.get(z.source),B=k.get(z.target),H=l.nodes.find(ie=>ie.id===z.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,q=B.x-V.x,Z=B.y-V.y,Y=Math.sqrt(q*q+Z*Z);return V.x+q/Y*H}).attr("y1",z=>{const V=k.get(z.source),B=k.get(z.target),H=l.nodes.find(ie=>ie.id===z.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,q=B.x-V.x,Z=B.y-V.y,Y=Math.sqrt(q*q+Z*Z);return V.y+Z/Y*H}).attr("x2",z=>{const V=k.get(z.source),B=k.get(z.target),H=l.nodes.find(ie=>ie.id===z.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,q=V.x-B.x,Z=V.y-B.y,Y=Math.sqrt(q*q+Z*Z);return B.x+q/Y*H}).attr("y2",z=>{const V=k.get(z.source),B=k.get(z.target),H=l.nodes.find(ie=>ie.id===z.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,q=V.x-B.x,Z=V.y-B.y,Y=Math.sqrt(q*q+Z*Z);return B.y+Z/Y*H}).attr("stroke",a.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",z=>z.dashed?"6 6":null).attr("marker-end",z=>z.flow==="forward"||z.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",z=>z.flow==="backward"||z.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),E.selectAll("text").data(M.filter(z=>z.label)).enter().append("text").attr("class","wardley-link-label").attr("x",z=>{const V=k.get(z.source),B=k.get(z.target),G=(V.x+B.x)/2,H=B.y-V.y,q=B.x-V.x,Z=Math.sqrt(q*q+H*H),Y=8,ie=H/Z;return G+ie*Y}).attr("y",z=>{const V=k.get(z.source),B=k.get(z.target),G=(V.y+B.y)/2,H=B.x-V.x,q=B.y-V.y,Z=Math.sqrt(H*H+q*q),Y=8,ie=-H/Z;return G+ie*Y}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",z=>{const V=k.get(z.source),B=k.get(z.target),G=(V.x+B.x)/2,H=(V.y+B.y)/2,q=B.x-V.x,Z=B.y-V.y,Y=Math.sqrt(q*q+Z*Z),ie=8,K=Z/Y,Q=-q/Y,te=G+K*ie,J=H+Q*ie;let ge=Math.atan2(Z,q)*180/Math.PI;return(ge>90||ge<-90)&&(ge+=180),`rotate(${ge} ${te} ${J})`}).text(z=>z.label);const L=p.append("g").attr("class","wardley-trends"),P=l.trends.map(z=>{const V=k.get(z.nodeId);if(!V)return null;const B=v(z.targetX),G=T(z.targetY),H=B-V.x,q=G-V.y,Z=Math.sqrt(H*H+q*q),Y=i.nodeRadius+2,ie=Z>Y?B-H/Z*Y:B,K=Z>Y?G-q/Z*Y:G;return{origin:V,targetX:B,targetY:G,adjustedX2:ie,adjustedY2:K}}).filter(z=>z!==null);L.selectAll("line").data(P).enter().append("line").attr("class","wardley-trend").attr("x1",z=>z.origin.x).attr("y1",z=>z.origin.y).attr("x2",z=>z.adjustedX2).attr("y2",z=>z.adjustedY2).attr("stroke",a.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const R=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",z=>["wardley-node",z.className?`wardley-node--${z.className}`:""].filter(Boolean).join(" "));R.filter(z=>z.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(z=>z.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(z=>z.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const I=R.filter(z=>z.sourceStrategy==="market");I.append("circle").attr("class","wardley-market-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(z=>!z.isPipelineParent&&z.sourceStrategy!=="market"&&z.className!=="anchor").append("circle").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);const $=i.nodeRadius*.7,O=i.nodeRadius*1.2;if(I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x).attr("y1",z=>k.get(z.id).y-O).attr("x2",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("y2",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("y1",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("x2",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("y2",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("y1",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("x2",z=>k.get(z.id).x).attr("y2",z=>k.get(z.id).y-O).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y-O).attr("r",$).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("cy",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("r",$).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("cy",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("r",$).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.filter(z=>z.isPipelineParent===!0).append("rect").attr("x",z=>k.get(z.id).x-s/2).attr("y",z=>k.get(z.id).y-s/2).attr("width",s).attr("height",s).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(z=>z.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",z=>{const V=k.get(z.id);let B=z.isPipelineParent?s/2+15:i.nodeRadius+15;return z.sourceStrategy&&(B+=i.nodeRadius+10),V.x+B}).attr("y1",z=>{const V=k.get(z.id),B=z.isPipelineParent?s:i.nodeRadius*2;return V.y-B/2}).attr("x2",z=>{const V=k.get(z.id);let B=z.isPipelineParent?s/2+15:i.nodeRadius+15;return z.sourceStrategy&&(B+=i.nodeRadius+10),V.x+B}).attr("y2",z=>{const V=k.get(z.id),B=z.isPipelineParent?s:i.nodeRadius*2;return V.y+B/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),R.append("text").attr("x",z=>{const V=k.get(z.id);if(z.className==="anchor")return z.labelOffsetX!==void 0?V.x+z.labelOffsetX:V.x;let B=i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetX===void 0&&(B+=10);const G=z.labelOffsetX??B;return V.x+G}).attr("y",z=>{const V=k.get(z.id);if(z.className==="anchor")return z.labelOffsetY!==void 0?V.y+z.labelOffsetY:V.y-3;let B=-i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetY===void 0&&(B-=10);const G=z.labelOffsetY??B;return V.y+G}).attr("class","wardley-node-label").attr("fill",z=>z.className==="evolved"?a.evolutionStroke:z.className==="anchor"?"#000":a.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",z=>z.className==="anchor"?"bold":"normal").attr("text-anchor",z=>z.className==="anchor"?"middle":"start").attr("dominant-baseline",z=>z.className==="anchor"?"middle":"auto").text(z=>z.label),l.annotations.length>0){const z=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(V=>{const B=V.coordinates.map(G=>({x:v(G.x),y:T(G.y)}));if(B.length>1)for(let G=0;G{const H=z.append("g").attr("class","wardley-annotation");H.append("circle").attr("cx",G.x).attr("cy",G.y).attr("r",10).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5),H.append("text").attr("x",G.x).attr("y",G.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.number)})}),l.annotationsBox){let V=v(l.annotationsBox.x),B=T(l.annotationsBox.y);const G=10,H=16,q=11,Z=z.append("g").attr("class","wardley-annotations-box"),Y=[...l.annotations].filter(K=>K.text).sort((K,Q)=>K.number-Q.number),ie=[];if(Y.forEach((K,Q)=>{const te=Z.append("text").attr("x",V+G).attr("y",B+G+(Q+1)*H).attr("font-size",q).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${K.number}. ${K.text}`);ie.push(te)}),ie.length>0){let K=0,Q=0;ie.forEach(Be=>{const ce=Be.node(),oe=ce.getComputedTextLength();K=Math.max(K,oe);const be=ce.getBBox();Q=Math.max(Q,be.height)});const te=K+G*2+105,J=Y.length*H+G*2+Q/2,ge=i.padding,ee=h-i.padding-te,Re=i.padding,Ie=d-i.padding-J;V=Math.max(ge,Math.min(V,ee)),B=Math.max(Re,Math.min(B,Ie)),ie.forEach((Be,ce)=>{Be.attr("x",V+G).attr("y",B+G+(ce+1)*H)}),Z.insert("rect","text").attr("x",V).attr("y",B).attr("width",te).attr("height",J).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const z=p.append("g").attr("class","wardley-notes");l.notes.forEach(V=>{const B=v(V.x),G=T(V.y);z.append("text").attr("x",B).attr("y",G).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.text)})}if(l.accelerators.length>0){const z=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(V=>{const B=v(V.x),G=T(V.y),H=60,q=30,Z=20,Y=` + `},"getStyles"),LOt=ROt,MOt={parser:CLe,get db(){return new TLe},renderer:AOt,styles:LOt};const IOt=Object.freeze(Object.defineProperty({__proto__:null,diagram:MOt},Symbol.toStringTag,{value:"Module"}));var L6=x((t,e)=>{const r=t<=1?t*100:t;if(r<0||r>100)throw new Error(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${t}`);return r},"toPercent"),ip=x((t,e,r)=>({x:L6(e,`${r} evolution`),y:L6(t,`${r} visibility`)}),"toCoordinates"),bae=x(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),NOt=x(t=>{if(!(t!=null&&t.startsWith("+")))return{};const e=/^\+'([^']*)'/.exec(t),r=e==null?void 0:e[1];return t.includes("<>")?{flow:"bidirectional",label:r}:t.includes("<")?{flow:"backward",label:r}:t.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),DOt=x((t,e)=>{if(eo(t,e),t.size&&e.setSize(t.size.width,t.size.height),t.evolution){const r=t.evolution.stages.map(i=>i.secondName?`${i.name.trim()} / ${i.secondName.trim()}`:i.name.trim()),n=t.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);e.updateAxes({stages:r,stageBoundaries:n})}if(t.anchors.forEach(r=>{const n=ip(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var o;const n=ip(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,a=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,s=(o=r.decorator)==null?void 0:o.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,a,r.inertia,s)}),t.notes.forEach(r=>{const n=ip(r.visibility,r.evolution,`Note "${r.text}"`);e.addNote(r.text,n.x,n.y)}),t.pipelines.forEach(r=>{const n=e.getNode(r.parent);if(!n||typeof n.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const i=n.y;e.startPipeline(r.parent),r.components.forEach(a=>{const s=`${r.parent}_${a.name}`,o=a.label?(a.label.negX?-1:1)*a.label.offsetX:void 0,l=a.label?(a.label.negY?-1:1)*a.label.offsetY:void 0,u=L6(a.evolution,`Pipeline component "${a.name}" evolution`);e.addNode(s,a.name,u,i,"pipeline-component",o,l),e.addPipelineComponent(r.parent,s)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=bae(r.fromPort)??bae(r.toPort);const{flow:a,label:s}=NOt(r.arrow);!i&&a&&(i=a);const o=r.linkLabel,l=s??o;e.addLink(e.resolveNodeId(r.from),e.resolveNodeId(r.to),n,l,i)}),t.evolves.forEach(r=>{const n=e.getNode(r.component);if((n==null?void 0:n.y)!==void 0){const i=L6(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=ip(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=ip(r.x,r.y,`Annotation ${r.number}`);e.addAnnotation(r.number,[{x:n.x,y:n.y}],r.text)}),t.accelerators.forEach(r=>{const n=ip(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=ip(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),kLe={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Al("wardley",t);le.debug(e);const r=(n=kLe.parser)==null?void 0:n.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");DOt(e,r)},"parse")},hb,OOt=(hb=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(e){const r=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...r,...e,className:e.className??r.className,labelOffsetX:e.labelOffsetX??r.labelOffsetX,labelOffsetY:e.labelOffsetY??r.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const r=this.nodes.get(e);r&&(r.isPipelineParent=!0)}addPipelineComponent(e,r){const n=this.pipelines.get(e);n&&n.componentIds.push(r);const i=this.nodes.get(r);i&&(i.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,r){this.annotationsBox={x:e,y:r}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,r){this.size={width:e,height:r}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[r,n]of this.nodes)if(n.label===e)return r;return e}build(){const e=[];for(const r of this.nodes.values()){if(typeof r.x!="number"||typeof r.y!="number")throw new Error(`Node "${r.label}" is missing coordinates`);e.push(r)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},x(hb,"WardleyBuilder"),hb),ks=new OOt;function SLe(){return Fe()["wardley-beta"]}x(SLe,"getConfig");function ELe(t,e,r,n,i,a,s,o,l){ks.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:s,inertia:o,sourceStrategy:l})}x(ELe,"addNode");function ALe(t,e,r=!1,n,i){ks.addLink({source:t,target:e,dashed:r,label:n,flow:i})}x(ALe,"addLink");function _Le(t,e,r){ks.addTrend({nodeId:t,targetX:e,targetY:r})}x(_Le,"addTrend");function RLe(t,e,r){ks.addAnnotation({number:t,coordinates:e,text:r})}x(RLe,"addAnnotation");function LLe(t,e,r){ks.addNote({text:t,x:e,y:r})}x(LLe,"addNote");function MLe(t,e,r){ks.addAccelerator({name:t,x:e,y:r})}x(MLe,"addAccelerator");function ILe(t,e,r){ks.addDeaccelerator({name:t,x:e,y:r})}x(ILe,"addDeaccelerator");function NLe(t,e){ks.setAnnotationsBox(t,e)}x(NLe,"setAnnotationsBox");function DLe(t,e){ks.setSize(t,e)}x(DLe,"setSize");function OLe(t){ks.startPipeline(t)}x(OLe,"startPipeline");function $Le(t,e){ks.addPipelineComponent(t,e)}x($Le,"addPipelineComponent");function PLe(t){ks.setAxes(t)}x(PLe,"updateAxes");function BLe(t){return ks.getNode(t)}x(BLe,"getNode");function FLe(t){return ks.resolveNodeId(t)}x(FLe,"resolveNodeId");function zLe(){return ks.build()}x(zLe,"getWardleyData");function VLe(){ks.clear(),$n()}x(VLe,"clear");var $Ot={getConfig:SLe,addNode:ELe,addLink:ALe,addTrend:_Le,addAnnotation:RLe,addNote:LLe,addAccelerator:MLe,addDeaccelerator:ILe,setAnnotationsBox:NLe,setSize:DLe,startPipeline:OLe,addPipelineComponent:$Le,updateAxes:PLe,getNode:BLe,resolveNodeId:FLe,getWardleyData:zLe,clear:VLe,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii},POt=["Genesis","Custom Built","Product","Commodity"],BOt=x(()=>{var e,r,n,i,a,s,o,l,u,h,d,f;const{themeVariables:t}=Fe();return{backgroundColor:((e=t.wardley)==null?void 0:e.backgroundColor)??t.background??"#fff",axisColor:((r=t.wardley)==null?void 0:r.axisColor)??"#000",axisTextColor:((n=t.wardley)==null?void 0:n.axisTextColor)??t.primaryTextColor??"#222",gridColor:((i=t.wardley)==null?void 0:i.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((a=t.wardley)==null?void 0:a.componentFill)??"#fff",componentStroke:((s=t.wardley)==null?void 0:s.componentStroke)??"#000",componentLabelColor:((o=t.wardley)==null?void 0:o.componentLabelColor)??t.primaryTextColor??"#222",linkStroke:((l=t.wardley)==null?void 0:l.linkStroke)??"#000",evolutionStroke:((u=t.wardley)==null?void 0:u.evolutionStroke)??"#dc3545",annotationStroke:((h=t.wardley)==null?void 0:h.annotationStroke)??"#000",annotationTextColor:((d=t.wardley)==null?void 0:d.annotationTextColor)??t.primaryTextColor??"#222",annotationFill:((f=t.wardley)==null?void 0:f.annotationFill)??t.background??"#fff"}},"getTheme"),FOt=x(()=>{const t=Fe()["wardley-beta"];return{width:(t==null?void 0:t.width)??900,height:(t==null?void 0:t.height)??600,padding:(t==null?void 0:t.padding)??48,nodeRadius:(t==null?void 0:t.nodeRadius)??6,nodeLabelOffset:(t==null?void 0:t.nodeLabelOffset)??8,axisFontSize:(t==null?void 0:t.axisFontSize)??12,labelFontSize:(t==null?void 0:t.labelFontSize)??10,showGrid:(t==null?void 0:t.showGrid)??!1,useMaxWidth:(t==null?void 0:t.useMaxWidth)??!0}},"getConfigValues"),zOt=x((t,e,r,n)=>{var N,F;le.debug(`Rendering Wardley map +`+t);const i=FOt(),a=BOt(),s=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((N=l.size)==null?void 0:N.width)??i.width,d=((F=l.size)==null?void 0:F.height)??i.height,f=xs(e);f.selectAll("*").remove(),Ai(f,d,h,i.useMaxWidth),f.attr("viewBox",`0 0 ${h} ${d}`);const p=f.append("g").attr("class","wardley-map"),g=f.append("defs");g.append("marker").attr("id",`arrow-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.evolutionStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-end-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.linkStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-start-${e}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",a.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",h).attr("height",d).attr("fill",a.backgroundColor);const m=h-i.padding*2,y=d-i.padding*2;u&&p.append("text").attr("class","wardley-title").attr("x",h/2).attr("y",i.padding/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const v=x(z=>i.padding+z/100*m,"projectX"),T=x(z=>d-i.padding-z/100*y,"projectY"),b=p.append("g").attr("class","wardley-axes");b.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1),b.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1);const w=l.axes.xLabel??"Evolution",C=l.axes.yLabel??"Visibility";b.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+m/2).attr("y",d-i.padding/4).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(w),b.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+y/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+y/2})`).text(C);const S=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:POt;if(S.length>0){const z=p.append("g").attr("class","wardley-stages"),V=l.axes.stageBoundaries,B=[];if(V&&V.length===S.length){let G=0;V.forEach(H=>{B.push({start:G,end:H}),G=H})}else{const G=1/S.length;S.forEach((H,q)=>{B.push({start:q*G,end:(q+1)*G})})}S.forEach((G,H)=>{const q=B[H],Z=i.padding+q.start*m,Y=i.padding+q.end*m,ie=(Z+Y)/2;H>0&&z.append("line").attr("x1",Z).attr("x2",Z).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),z.append("text").attr("class","wardley-stage-label").attr("x",ie).attr("y",d-i.padding/1.5).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(G)})}if(i.showGrid){const z=p.append("g").attr("class","wardley-grid");for(let V=1;V<4;V++){const B=V/4,G=i.padding+m*B;z.append("line").attr("x1",G).attr("x2",G).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6"),z.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-y*B).attr("y2",d-i.padding-y*B).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6")}}const k=new Map;if(l.nodes.forEach(z=>{k.set(z.id,{x:v(z.x),y:T(z.y),node:z})}),l.pipelines.length>0){const z=p.append("g").attr("class","wardley-pipelines"),V=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(B=>{if(B.componentIds.length===0)return;const G=B.componentIds.map(Y=>({id:Y,pos:k.get(Y),node:l.nodes.find(ie=>ie.id===Y)})).filter(Y=>Y.pos&&Y.node).sort((Y,ie)=>Y.node.x-ie.node.x);for(let Y=0;Y{const ie=k.get(Y);ie&&(H=Math.min(H,ie.x),q=Math.max(q,ie.x),Z=ie.y)}),H!==1/0&&q!==-1/0){const ie=i.nodeRadius*4,K=Z-ie/2,Q=k.get(B.nodeId);if(Q){const te=(H+q)/2;Q.x=te,Q.y=K-s/6}z.append("rect").attr("class","wardley-pipeline-box").attr("x",H-15).attr("y",K).attr("width",q-H+30).attr("height",ie).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const E=p.append("g").attr("class","wardley-links"),_=new Map;l.pipelines.forEach(z=>{_.set(z.nodeId,new Set(z.componentIds))});const M=l.links.filter(z=>{if(!k.has(z.source)||!k.has(z.target))return!1;const V=_.get(z.target);return!(V!=null&&V.has(z.source))});E.selectAll("line").data(M).enter().append("line").attr("class",z=>`wardley-link${z.dashed?" wardley-link--dashed":""}`).attr("x1",z=>{const V=k.get(z.source),B=k.get(z.target),H=l.nodes.find(ie=>ie.id===z.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,q=B.x-V.x,Z=B.y-V.y,Y=Math.sqrt(q*q+Z*Z);return V.x+q/Y*H}).attr("y1",z=>{const V=k.get(z.source),B=k.get(z.target),H=l.nodes.find(ie=>ie.id===z.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,q=B.x-V.x,Z=B.y-V.y,Y=Math.sqrt(q*q+Z*Z);return V.y+Z/Y*H}).attr("x2",z=>{const V=k.get(z.source),B=k.get(z.target),H=l.nodes.find(ie=>ie.id===z.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,q=V.x-B.x,Z=V.y-B.y,Y=Math.sqrt(q*q+Z*Z);return B.x+q/Y*H}).attr("y2",z=>{const V=k.get(z.source),B=k.get(z.target),H=l.nodes.find(ie=>ie.id===z.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,q=V.x-B.x,Z=V.y-B.y,Y=Math.sqrt(q*q+Z*Z);return B.y+Z/Y*H}).attr("stroke",a.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",z=>z.dashed?"6 6":null).attr("marker-end",z=>z.flow==="forward"||z.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",z=>z.flow==="backward"||z.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),E.selectAll("text").data(M.filter(z=>z.label)).enter().append("text").attr("class","wardley-link-label").attr("x",z=>{const V=k.get(z.source),B=k.get(z.target),G=(V.x+B.x)/2,H=B.y-V.y,q=B.x-V.x,Z=Math.sqrt(q*q+H*H),Y=8,ie=H/Z;return G+ie*Y}).attr("y",z=>{const V=k.get(z.source),B=k.get(z.target),G=(V.y+B.y)/2,H=B.x-V.x,q=B.y-V.y,Z=Math.sqrt(H*H+q*q),Y=8,ie=-H/Z;return G+ie*Y}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",z=>{const V=k.get(z.source),B=k.get(z.target),G=(V.x+B.x)/2,H=(V.y+B.y)/2,q=B.x-V.x,Z=B.y-V.y,Y=Math.sqrt(q*q+Z*Z),ie=8,K=Z/Y,Q=-q/Y,te=G+K*ie,J=H+Q*ie;let ge=Math.atan2(Z,q)*180/Math.PI;return(ge>90||ge<-90)&&(ge+=180),`rotate(${ge} ${te} ${J})`}).text(z=>z.label);const L=p.append("g").attr("class","wardley-trends"),P=l.trends.map(z=>{const V=k.get(z.nodeId);if(!V)return null;const B=v(z.targetX),G=T(z.targetY),H=B-V.x,q=G-V.y,Z=Math.sqrt(H*H+q*q),Y=i.nodeRadius+2,ie=Z>Y?B-H/Z*Y:B,K=Z>Y?G-q/Z*Y:G;return{origin:V,targetX:B,targetY:G,adjustedX2:ie,adjustedY2:K}}).filter(z=>z!==null);L.selectAll("line").data(P).enter().append("line").attr("class","wardley-trend").attr("x1",z=>z.origin.x).attr("y1",z=>z.origin.y).attr("x2",z=>z.adjustedX2).attr("y2",z=>z.adjustedY2).attr("stroke",a.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const R=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",z=>["wardley-node",z.className?`wardley-node--${z.className}`:""].filter(Boolean).join(" "));R.filter(z=>z.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(z=>z.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(z=>z.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const I=R.filter(z=>z.sourceStrategy==="market");I.append("circle").attr("class","wardley-market-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(z=>!z.isPipelineParent&&z.sourceStrategy!=="market"&&z.className!=="anchor").append("circle").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);const $=i.nodeRadius*.7,O=i.nodeRadius*1.2;if(I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x).attr("y1",z=>k.get(z.id).y-O).attr("x2",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("y2",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("y1",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("x2",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("y2",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("y1",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("x2",z=>k.get(z.id).x).attr("y2",z=>k.get(z.id).y-O).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y-O).attr("r",$).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("cy",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("r",$).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("cy",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("r",$).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.filter(z=>z.isPipelineParent===!0).append("rect").attr("x",z=>k.get(z.id).x-s/2).attr("y",z=>k.get(z.id).y-s/2).attr("width",s).attr("height",s).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(z=>z.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",z=>{const V=k.get(z.id);let B=z.isPipelineParent?s/2+15:i.nodeRadius+15;return z.sourceStrategy&&(B+=i.nodeRadius+10),V.x+B}).attr("y1",z=>{const V=k.get(z.id),B=z.isPipelineParent?s:i.nodeRadius*2;return V.y-B/2}).attr("x2",z=>{const V=k.get(z.id);let B=z.isPipelineParent?s/2+15:i.nodeRadius+15;return z.sourceStrategy&&(B+=i.nodeRadius+10),V.x+B}).attr("y2",z=>{const V=k.get(z.id),B=z.isPipelineParent?s:i.nodeRadius*2;return V.y+B/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),R.append("text").attr("x",z=>{const V=k.get(z.id);if(z.className==="anchor")return z.labelOffsetX!==void 0?V.x+z.labelOffsetX:V.x;let B=i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetX===void 0&&(B+=10);const G=z.labelOffsetX??B;return V.x+G}).attr("y",z=>{const V=k.get(z.id);if(z.className==="anchor")return z.labelOffsetY!==void 0?V.y+z.labelOffsetY:V.y-3;let B=-i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetY===void 0&&(B-=10);const G=z.labelOffsetY??B;return V.y+G}).attr("class","wardley-node-label").attr("fill",z=>z.className==="evolved"?a.evolutionStroke:z.className==="anchor"?"#000":a.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",z=>z.className==="anchor"?"bold":"normal").attr("text-anchor",z=>z.className==="anchor"?"middle":"start").attr("dominant-baseline",z=>z.className==="anchor"?"middle":"auto").text(z=>z.label),l.annotations.length>0){const z=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(V=>{const B=V.coordinates.map(G=>({x:v(G.x),y:T(G.y)}));if(B.length>1)for(let G=0;G{const H=z.append("g").attr("class","wardley-annotation");H.append("circle").attr("cx",G.x).attr("cy",G.y).attr("r",10).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5),H.append("text").attr("x",G.x).attr("y",G.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.number)})}),l.annotationsBox){let V=v(l.annotationsBox.x),B=T(l.annotationsBox.y);const G=10,H=16,q=11,Z=z.append("g").attr("class","wardley-annotations-box"),Y=[...l.annotations].filter(K=>K.text).sort((K,Q)=>K.number-Q.number),ie=[];if(Y.forEach((K,Q)=>{const te=Z.append("text").attr("x",V+G).attr("y",B+G+(Q+1)*H).attr("font-size",q).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${K.number}. ${K.text}`);ie.push(te)}),ie.length>0){let K=0,Q=0;ie.forEach(Be=>{const ce=Be.node(),oe=ce.getComputedTextLength();K=Math.max(K,oe);const be=ce.getBBox();Q=Math.max(Q,be.height)});const te=K+G*2+105,J=Y.length*H+G*2+Q/2,ge=i.padding,ee=h-i.padding-te,Re=i.padding,Ie=d-i.padding-J;V=Math.max(ge,Math.min(V,ee)),B=Math.max(Re,Math.min(B,Ie)),ie.forEach((Be,ce)=>{Be.attr("x",V+G).attr("y",B+G+(ce+1)*H)}),Z.insert("rect","text").attr("x",V).attr("y",B).attr("width",te).attr("height",J).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const z=p.append("g").attr("class","wardley-notes");l.notes.forEach(V=>{const B=v(V.x),G=T(V.y);z.append("text").attr("x",B).attr("y",G).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.text)})}if(l.accelerators.length>0){const z=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(V=>{const B=v(V.x),G=T(V.y),H=60,q=30,Z=20,Y=` M ${B} ${G-q/2} L ${B+H-Z} ${G-q/2} L ${B+H-Z} ${G-q/2-8} @@ -3579,7 +3581,7 @@ Expecting `+te.join(", ")+", got '"+(this.terminals_[G]||G)+"'":J="Parse error o L ${B+Z} ${G+q/2} L ${B+H} ${G+q/2} Z - `;z.append("path").attr("d",Y).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),z.append("text").attr("x",B+H/2).attr("y",G+q/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.name)})}},"draw"),BOt={draw:POt},FOt=x(({wardley:t}={})=>{const e=Dh(),r=Xt(),n=ri(e,r.themeVariables),i=ri(n.wardley,t);return` + `;z.append("path").attr("d",Y).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),z.append("text").attr("x",B+H/2).attr("y",G+q/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.name)})}},"draw"),VOt={draw:zOt},GOt=x(({wardley:t}={})=>{const e=Dh(),r=Xt(),n=ri(e,r.themeVariables),i=ri(n.wardley,t);return` .wardley-background { fill: ${i.backgroundColor}; } @@ -3637,7 +3639,7 @@ Expecting `+te.join(", ")+", got '"+(this.terminals_[G]||G)+"'":J="Parse error o .wardley-notes text { fill: ${i.axisTextColor}; } - `},"styles"),zOt={parser:CLe,db:NOt,renderer:BOt,styles:FOt};const VOt=Object.freeze(Object.defineProperty({__proto__:null,diagram:zOt},Symbol.toStringTag,{value:"Module"}));var VLe=x(()=>({domains:new Map,transitions:[]}),"createDefaultData"),KS=VLe(),GOt=x(()=>KS.domains,"getDomains"),WOt=x(()=>KS.transitions,"getTransitions"),HOt=x(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));KS.domains.set(r,{name:r,items:n})}},"setDomains"),qOt=x(t=>{t&&(KS.transitions=t.filter(e=>e.from===e.to?(le.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),UOt=x(()=>ri({...Vr.cynefin,...Xt().cynefin}),"getConfig"),YOt=x(()=>{On(),KS=VLe()},"clear"),s5={getDomains:GOt,getTransitions:WOt,setDomains:HOt,setTransitions:qOt,getConfig:UOt,clear:YOt,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii},XOt=x(t=>{eo(t,s5),s5.setDomains(t.domains),s5.setTransitions(t.transitions)},"populate"),jOt={parse:x(async t=>{const e=await Al("cynefin",t);le.debug(e),XOt(e)},"parse")};function Pk(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}x(Pk,"seededRandom");function GLe(t){let e=0;for(let r=0;r{const r=t/2,n=e/2;return{complex:{cx:r/2,cy:n/2,x:0,y:0,w:r,h:n},complicated:{cx:r+r/2,cy:n/2,x:r,y:0,w:r,h:n},chaotic:{cx:r/2,cy:n+n/2,x:0,y:n,w:r,h:n},clear:{cx:r+r/2,cy:n+n/2,x:r,y:n,w:r,h:n},confusion:{cx:r,cy:n,x:r*.7,y:n*.7,w:r*.6,h:n*.6}}},"getDomainLayouts"),ZOt=x(()=>{const t=Dh(),e=Xt();return ri(t,e.themeVariables).cynefin},"getCynefinDomainColors"),QN=3,QOt=x((t,e,r,n)=>{const i=n.db,a=i.getDomains(),s=i.getTransitions(),o=i.getDiagramTitle(),l=i.getAccTitle(),u=i.getAccDescription(),h=i.getConfig(),d=ZOt();le.debug("Rendering Cynefin diagram");const f=h.width,p=h.height,g=h.padding,m=h.showDomainDescriptions,y=h.boundaryAmplitude,v=f+g*2,T=p+g*2,b={complex:d.complexBg,complicated:d.complicatedBg,clear:d.clearBg,chaotic:d.chaoticBg,confusion:d.confusionBg},w=xs(e);Ai(w,T,v,h.useMaxWidth??!0),w.attr("viewBox",`0 0 ${v} ${T}`),l&&w.append("title").text(l),u&&w.append("desc").text(u);const C=w.append("g").attr("transform",`translate(${g}, ${g})`),S=KOt(f,p),k=WLe(h.seed,e),E=C.append("g").attr("class","cynefin-backgrounds"),_=["complex","complicated","chaotic","clear"];for(const N of _){const F=S[N];E.append("rect").attr("class","cynefinDomain").attr("x",F.x).attr("y",F.y).attr("width",F.w).attr("height",F.h).attr("fill",b[N]).attr("fill-opacity",.4).attr("stroke","none")}const M=C.append("g").attr("class","cynefin-boundaries");M.append("path").attr("class","cynefinBoundary").attr("d",HLe(f,p,k,y)).attr("fill","none"),M.append("path").attr("class","cynefinBoundary").attr("d",qLe(f,p,k+100,y)).attr("fill","none"),M.append("path").attr("class","cynefinCliff").attr("d",ULe(f,p)).attr("fill","none");const L=f*.15,P=p*.15;C.append("path").attr("class","cynefinConfusion").attr("d",YLe(f/2,p/2,L,P)).attr("fill",b.confusion).attr("fill-opacity",.5);const D=C.append("g").attr("class","cynefin-labels");for(const N of _){const F=S[N];D.append("text").attr("class","cynefinDomainLabel").attr("x",F.cx).attr("y",m?F.cy-30:F.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(N.charAt(0).toUpperCase()+N.slice(1))}if(D.append("text").attr("class","cynefinDomainLabel").attr("x",f/2).attr("y",m?p/2-10:p/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),m){const N=C.append("g").attr("class","cynefin-subtitles");for(const F of _){const z=S[F],V=bae[F];N.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.model),N.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.practice)}N.append("text").attr("class","cynefinSubtitle").attr("x",f/2).attr("y",p/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(bae.confusion.practice)}const R=C.append("g").attr("class","cynefin-items"),I=26,$=10,O=["complex","complicated","chaotic","clear","confusion"];for(const N of O){const F=a.get(N);if(!F||F.items.length===0)continue;const z=S[N],V=N==="confusion";let B=F.items,G=0;V&&F.items.length>QN&&(G=F.items.length-QN,B=F.items.slice(0,QN));let H;if(V){const q=m?22:14;H=z.cy+q}else H=z.cy+(m?25:15);if([...B].forEach((q,Z)=>{const Y=H+Z*(I+4),ie=R.append("g"),K=ie.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(q.label);let Q=q.label.length*7;const te=K.node();if(te&&typeof te.getBBox=="function"){const ee=te.getBBox();ee.width>0&&(Q=ee.width)}const J=Q+$*2,ge=z.cx-J/2;ie.attr("transform",`translate(${ge}, ${Y})`),ie.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",J).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[N]).attr("fill-opacity",.95),K.attr("x",J/2).attr("y",I/2)}),G>0){const q=H+B.length*(I+4),Z=`+${G} more`,Y=R.append("g"),ie=Y.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(Z);let K=Z.length*7;const Q=ie.node();if(Q&&typeof Q.getBBox=="function"){const ge=Q.getBBox();ge.width>0&&(K=ge.width)}const te=K+$*2,J=z.cx-te/2;Y.attr("transform",`translate(${J}, ${q})`),Y.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",te).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[N]).attr("fill-opacity",.6),ie.attr("x",te/2).attr("y",I/2)}}if(s.length>0){const N=w.select("defs").empty()?w.append("defs"):w.select("defs"),F=`cynefin-arrow-${e}`;N.append("marker").attr("id",F).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const z=C.append("g").attr("class","cynefin-arrows");s.forEach(V=>{const B=S[V.from],G=S[V.to];if(!B||!G)return;if(V.from===V.to){le.warn(`Cynefin renderer: skipping self-loop on domain "${V.from}"`);return}const H=B.cx,q=B.cy,Z=G.cx,Y=G.cy,ie=(H+Z)/2,K=(q+Y)/2,Q=Z-H,te=Y-q,J=Math.sqrt(Q*Q+te*te),ge=J*.15,ee=-te/J,Re=Q/J,Ie=ie+ee*ge,Be=K+Re*ge;z.append("path").attr("class","cynefinArrowLine").attr("d",`M${H},${q} Q${Ie},${Be} ${Z},${Y}`).attr("fill","none").attr("marker-end",`url(#${F})`),V.label&&z.append("text").attr("class","cynefinArrowLabel").attr("x",Ie).attr("y",Be-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(V.label)})}o&&C.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(o)},"draw"),JOt={draw:QOt},e$t=x(()=>{const t=Dh(),e=Xt();return ri(t,e.themeVariables).cynefin},"getCynefinTheme"),t$t=x(()=>{const t=e$t();return` + `},"styles"),WOt={parser:kLe,db:$Ot,renderer:VOt,styles:GOt};const HOt=Object.freeze(Object.defineProperty({__proto__:null,diagram:WOt},Symbol.toStringTag,{value:"Module"}));var GLe=x(()=>({domains:new Map,transitions:[]}),"createDefaultData"),KS=GLe(),qOt=x(()=>KS.domains,"getDomains"),UOt=x(()=>KS.transitions,"getTransitions"),YOt=x(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));KS.domains.set(r,{name:r,items:n})}},"setDomains"),XOt=x(t=>{t&&(KS.transitions=t.filter(e=>e.from===e.to?(le.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),jOt=x(()=>ri({...Vr.cynefin,...Xt().cynefin}),"getConfig"),KOt=x(()=>{$n(),KS=GLe()},"clear"),s5={getDomains:qOt,getTransitions:UOt,setDomains:YOt,setTransitions:XOt,getConfig:jOt,clear:KOt,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii},ZOt=x(t=>{eo(t,s5),s5.setDomains(t.domains),s5.setTransitions(t.transitions)},"populate"),QOt={parse:x(async t=>{const e=await Al("cynefin",t);le.debug(e),ZOt(e)},"parse")};function Pk(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}x(Pk,"seededRandom");function WLe(t){let e=0;for(let r=0;r{const r=t/2,n=e/2;return{complex:{cx:r/2,cy:n/2,x:0,y:0,w:r,h:n},complicated:{cx:r+r/2,cy:n/2,x:r,y:0,w:r,h:n},chaotic:{cx:r/2,cy:n+n/2,x:0,y:n,w:r,h:n},clear:{cx:r+r/2,cy:n+n/2,x:r,y:n,w:r,h:n},confusion:{cx:r,cy:n,x:r*.7,y:n*.7,w:r*.6,h:n*.6}}},"getDomainLayouts"),e$t=x(()=>{const t=Dh(),e=Xt();return ri(t,e.themeVariables).cynefin},"getCynefinDomainColors"),QN=3,t$t=x((t,e,r,n)=>{const i=n.db,a=i.getDomains(),s=i.getTransitions(),o=i.getDiagramTitle(),l=i.getAccTitle(),u=i.getAccDescription(),h=i.getConfig(),d=e$t();le.debug("Rendering Cynefin diagram");const f=h.width,p=h.height,g=h.padding,m=h.showDomainDescriptions,y=h.boundaryAmplitude,v=f+g*2,T=p+g*2,b={complex:d.complexBg,complicated:d.complicatedBg,clear:d.clearBg,chaotic:d.chaoticBg,confusion:d.confusionBg},w=xs(e);Ai(w,T,v,h.useMaxWidth??!0),w.attr("viewBox",`0 0 ${v} ${T}`),l&&w.append("title").text(l),u&&w.append("desc").text(u);const C=w.append("g").attr("transform",`translate(${g}, ${g})`),S=JOt(f,p),k=HLe(h.seed,e),E=C.append("g").attr("class","cynefin-backgrounds"),_=["complex","complicated","chaotic","clear"];for(const N of _){const F=S[N];E.append("rect").attr("class","cynefinDomain").attr("x",F.x).attr("y",F.y).attr("width",F.w).attr("height",F.h).attr("fill",b[N]).attr("fill-opacity",.4).attr("stroke","none")}const M=C.append("g").attr("class","cynefin-boundaries");M.append("path").attr("class","cynefinBoundary").attr("d",qLe(f,p,k,y)).attr("fill","none"),M.append("path").attr("class","cynefinBoundary").attr("d",ULe(f,p,k+100,y)).attr("fill","none"),M.append("path").attr("class","cynefinCliff").attr("d",YLe(f,p)).attr("fill","none");const L=f*.15,P=p*.15;C.append("path").attr("class","cynefinConfusion").attr("d",XLe(f/2,p/2,L,P)).attr("fill",b.confusion).attr("fill-opacity",.5);const D=C.append("g").attr("class","cynefin-labels");for(const N of _){const F=S[N];D.append("text").attr("class","cynefinDomainLabel").attr("x",F.cx).attr("y",m?F.cy-30:F.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(N.charAt(0).toUpperCase()+N.slice(1))}if(D.append("text").attr("class","cynefinDomainLabel").attr("x",f/2).attr("y",m?p/2-10:p/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),m){const N=C.append("g").attr("class","cynefin-subtitles");for(const F of _){const z=S[F],V=xae[F];N.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.model),N.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.practice)}N.append("text").attr("class","cynefinSubtitle").attr("x",f/2).attr("y",p/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(xae.confusion.practice)}const R=C.append("g").attr("class","cynefin-items"),I=26,$=10,O=["complex","complicated","chaotic","clear","confusion"];for(const N of O){const F=a.get(N);if(!F||F.items.length===0)continue;const z=S[N],V=N==="confusion";let B=F.items,G=0;V&&F.items.length>QN&&(G=F.items.length-QN,B=F.items.slice(0,QN));let H;if(V){const q=m?22:14;H=z.cy+q}else H=z.cy+(m?25:15);if([...B].forEach((q,Z)=>{const Y=H+Z*(I+4),ie=R.append("g"),K=ie.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(q.label);let Q=q.label.length*7;const te=K.node();if(te&&typeof te.getBBox=="function"){const ee=te.getBBox();ee.width>0&&(Q=ee.width)}const J=Q+$*2,ge=z.cx-J/2;ie.attr("transform",`translate(${ge}, ${Y})`),ie.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",J).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[N]).attr("fill-opacity",.95),K.attr("x",J/2).attr("y",I/2)}),G>0){const q=H+B.length*(I+4),Z=`+${G} more`,Y=R.append("g"),ie=Y.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(Z);let K=Z.length*7;const Q=ie.node();if(Q&&typeof Q.getBBox=="function"){const ge=Q.getBBox();ge.width>0&&(K=ge.width)}const te=K+$*2,J=z.cx-te/2;Y.attr("transform",`translate(${J}, ${q})`),Y.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",te).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[N]).attr("fill-opacity",.6),ie.attr("x",te/2).attr("y",I/2)}}if(s.length>0){const N=w.select("defs").empty()?w.append("defs"):w.select("defs"),F=`cynefin-arrow-${e}`;N.append("marker").attr("id",F).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const z=C.append("g").attr("class","cynefin-arrows");s.forEach(V=>{const B=S[V.from],G=S[V.to];if(!B||!G)return;if(V.from===V.to){le.warn(`Cynefin renderer: skipping self-loop on domain "${V.from}"`);return}const H=B.cx,q=B.cy,Z=G.cx,Y=G.cy,ie=(H+Z)/2,K=(q+Y)/2,Q=Z-H,te=Y-q,J=Math.sqrt(Q*Q+te*te),ge=J*.15,ee=-te/J,Re=Q/J,Ie=ie+ee*ge,Be=K+Re*ge;z.append("path").attr("class","cynefinArrowLine").attr("d",`M${H},${q} Q${Ie},${Be} ${Z},${Y}`).attr("fill","none").attr("marker-end",`url(#${F})`),V.label&&z.append("text").attr("class","cynefinArrowLabel").attr("x",Ie).attr("y",Be-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(V.label)})}o&&C.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(o)},"draw"),r$t={draw:t$t},n$t=x(()=>{const t=Dh(),e=Xt();return ri(t,e.themeVariables).cynefin},"getCynefinTheme"),i$t=x(()=>{const t=n$t();return` .cynefinDomain { stroke: none; } @@ -3698,8 +3700,8 @@ Expecting `+te.join(", ")+", got '"+(this.terminals_[G]||G)+"'":J="Parse error o font-weight: bold; fill: ${t.labelColor}; } - `},"styles"),r$t=t$t,n$t={parser:jOt,db:s5,renderer:JOt,styles:r$t};const i$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:n$t},Symbol.toStringTag,{value:"Module"}));var sY="",oY="",lY="",cY=[],M6=new Map,Yd=x(t=>Wr(t,Fe()),"sanitizeText"),zm=x(t=>{switch(t.type){case"terminal":return{...t,value:Yd(t.value)};case"nonterminal":return{...t,name:Yd(t.name)};case"sequence":return{...t,elements:t.elements.map(zm)};case"choice":return{...t,alternatives:t.alternatives.map(zm)};case"optional":return{...t,element:zm(t.element)};case"repetition":return{...t,element:zm(t.element),separator:t.separator?zm(t.separator):void 0};case"special":return{...t,text:Yd(t.text)}}},"sanitizeAstNode"),a$t=x(()=>{sY="",oY="",lY="",cY.length=0,M6.clear(),On(),le.debug("[Railroad] Database cleared")},"clear"),XLe=x(t=>{sY=Yd(t),le.debug("[Railroad] Title set:",t)},"setTitle"),jLe=x(()=>sY,"getTitle"),s$t=x(t=>{const e={...t,name:Yd(t.name),definition:zm(t.definition),comment:t.comment?Yd(t.comment):void 0};le.debug("[Railroad] Adding rule:",e.name),M6.has(e.name)&&le.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),cY.push(e),M6.set(e.name,e)},"addRule"),o$t=x(()=>cY,"getRules"),l$t=x(t=>M6.get(t),"getRule"),c$t=x(t=>{oY=Yd(t).replace(/^\s+/g,""),le.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),u$t=x(()=>oY,"getAccTitle"),h$t=x(t=>{lY=Yd(t).replace(/\n\s+/g,` -`),le.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),d$t=x(()=>lY,"getAccDescription"),f$t=XLe,p$t=jLe,ei={clear:a$t,setTitle:XLe,getTitle:jLe,addRule:s$t,getRules:o$t,getRule:l$t,setAccTitle:c$t,getAccTitle:u$t,setAccDescription:h$t,getAccDescription:d$t,setDiagramTitle:f$t,getDiagramTitle:p$t},$a={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},g$t=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,m$t=/^[\w "',.-]+$/,y$t=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),KLe=x(t=>t?Object.keys(t).every(e=>e==="railroad"||y$t.has(e)):!1,"isRailroadStyleOptions"),v$t=x(t=>t?"railroad"in t&&t.railroad?t.railroad:KLe(t)?t:{}:{},"extractRailroadOverrides"),b$t=x(t=>{if(!t||KLe(t))return{};const{railroad:e,svgId:r,theme:n,look:i,...a}=t;return a},"extractThemeOverrides"),Ln=x((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return g$t.test(r)?r:e},"sanitizeColorValue"),ZLe=x((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return m$t.test(r)?r:e},"sanitizeFontFamilyValue"),ap=x((t,e)=>{const r=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(r)&&r>=0?r:e},"sanitizeNumberValue"),x$t=x(t=>{const e=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(e)&&e>0?e:void 0},"parseThemeFontSize"),T$t=x(t=>{const e=ZLe(t.fontFamily,$a.fontFamily),r=x$t(t.fontSize)??$a.fontSize;return{...$a,fontFamily:e,fontSize:r,terminalFill:Ln(t.secondBkg??t.secondaryColor,$a.terminalFill),terminalStroke:Ln(t.secondaryBorderColor??t.lineColor,$a.terminalStroke),terminalTextColor:Ln(t.secondaryTextColor??t.textColor,$a.terminalTextColor),nonTerminalFill:Ln(t.mainBkg??t.background,$a.nonTerminalFill),nonTerminalStroke:Ln(t.primaryBorderColor??t.lineColor,$a.nonTerminalStroke),nonTerminalTextColor:Ln(t.primaryTextColor??t.textColor,$a.nonTerminalTextColor),lineColor:Ln(t.lineColor,$a.lineColor),markerFill:Ln(t.lineColor,$a.markerFill),commentFill:Ln(t.labelBackground??t.tertiaryColor,$a.commentFill),commentStroke:Ln(t.tertiaryBorderColor??t.lineColor,$a.commentStroke),commentTextColor:Ln(t.tertiaryTextColor??t.textColor,$a.commentTextColor),specialFill:Ln(t.tertiaryColor??t.secondaryColor,$a.specialFill),specialStroke:Ln(t.tertiaryBorderColor??t.secondaryBorderColor,$a.specialStroke),ruleNameColor:Ln(t.titleColor??t.textColor,$a.ruleNameColor)}},"buildThemeDefaults"),uY=x(t=>{const e=Xt(),r={...Dh(),...e.themeVariables??{},...b$t(t)},n=T$t(r),i={...e.railroad??{},...v$t(t)};return{compactMode:i.compactMode??n.compactMode,padding:ap(i.padding,n.padding),verticalSeparation:ap(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:ap(i.horizontalSeparation,n.horizontalSeparation),arcRadius:ap(i.arcRadius,n.arcRadius),fontSize:ap(i.fontSize,n.fontSize),fontFamily:ZLe(i.fontFamily,n.fontFamily),terminalFill:Ln(i.terminalFill,n.terminalFill),terminalStroke:Ln(i.terminalStroke,n.terminalStroke),terminalTextColor:Ln(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:Ln(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:Ln(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:Ln(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:Ln(i.lineColor,n.lineColor),strokeWidth:ap(i.strokeWidth,n.strokeWidth),markerFill:Ln(i.markerFill,n.markerFill),commentFill:Ln(i.commentFill,n.commentFill),commentStroke:Ln(i.commentStroke,n.commentStroke),commentTextColor:Ln(i.commentTextColor,n.commentTextColor),specialFill:Ln(i.specialFill,n.specialFill),specialStroke:Ln(i.specialStroke,n.specialStroke),ruleNameColor:Ln(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:ap(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),U7=x(t=>{const{fontFamily:e,fontSize:r,terminalFill:n,terminalStroke:i,terminalTextColor:a,nonTerminalFill:s,nonTerminalStroke:o,nonTerminalTextColor:l,lineColor:u,strokeWidth:h,markerFill:d,commentFill:f,commentStroke:p,commentTextColor:g,specialFill:m,specialStroke:y,ruleNameColor:v}=uY(t);return` + `},"styles"),a$t=i$t,s$t={parser:QOt,db:s5,renderer:r$t,styles:a$t};const o$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:s$t},Symbol.toStringTag,{value:"Module"}));var sY="",oY="",lY="",cY=[],M6=new Map,Yd=x(t=>Wr(t,Fe()),"sanitizeText"),zm=x(t=>{switch(t.type){case"terminal":return{...t,value:Yd(t.value)};case"nonterminal":return{...t,name:Yd(t.name)};case"sequence":return{...t,elements:t.elements.map(zm)};case"choice":return{...t,alternatives:t.alternatives.map(zm)};case"optional":return{...t,element:zm(t.element)};case"repetition":return{...t,element:zm(t.element),separator:t.separator?zm(t.separator):void 0};case"special":return{...t,text:Yd(t.text)}}},"sanitizeAstNode"),l$t=x(()=>{sY="",oY="",lY="",cY.length=0,M6.clear(),$n(),le.debug("[Railroad] Database cleared")},"clear"),jLe=x(t=>{sY=Yd(t),le.debug("[Railroad] Title set:",t)},"setTitle"),KLe=x(()=>sY,"getTitle"),c$t=x(t=>{const e={...t,name:Yd(t.name),definition:zm(t.definition),comment:t.comment?Yd(t.comment):void 0};le.debug("[Railroad] Adding rule:",e.name),M6.has(e.name)&&le.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),cY.push(e),M6.set(e.name,e)},"addRule"),u$t=x(()=>cY,"getRules"),h$t=x(t=>M6.get(t),"getRule"),d$t=x(t=>{oY=Yd(t).replace(/^\s+/g,""),le.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),f$t=x(()=>oY,"getAccTitle"),p$t=x(t=>{lY=Yd(t).replace(/\n\s+/g,` +`),le.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),g$t=x(()=>lY,"getAccDescription"),m$t=jLe,y$t=KLe,ei={clear:l$t,setTitle:jLe,getTitle:KLe,addRule:c$t,getRules:u$t,getRule:h$t,setAccTitle:d$t,getAccTitle:f$t,setAccDescription:p$t,getAccDescription:g$t,setDiagramTitle:m$t,getDiagramTitle:y$t},$a={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},v$t=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,b$t=/^[\w "',.-]+$/,x$t=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),ZLe=x(t=>t?Object.keys(t).every(e=>e==="railroad"||x$t.has(e)):!1,"isRailroadStyleOptions"),T$t=x(t=>t?"railroad"in t&&t.railroad?t.railroad:ZLe(t)?t:{}:{},"extractRailroadOverrides"),w$t=x(t=>{if(!t||ZLe(t))return{};const{railroad:e,svgId:r,theme:n,look:i,...a}=t;return a},"extractThemeOverrides"),Ln=x((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return v$t.test(r)?r:e},"sanitizeColorValue"),QLe=x((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return b$t.test(r)?r:e},"sanitizeFontFamilyValue"),ap=x((t,e)=>{const r=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(r)&&r>=0?r:e},"sanitizeNumberValue"),C$t=x(t=>{const e=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(e)&&e>0?e:void 0},"parseThemeFontSize"),k$t=x(t=>{const e=QLe(t.fontFamily,$a.fontFamily),r=C$t(t.fontSize)??$a.fontSize;return{...$a,fontFamily:e,fontSize:r,terminalFill:Ln(t.secondBkg??t.secondaryColor,$a.terminalFill),terminalStroke:Ln(t.secondaryBorderColor??t.lineColor,$a.terminalStroke),terminalTextColor:Ln(t.secondaryTextColor??t.textColor,$a.terminalTextColor),nonTerminalFill:Ln(t.mainBkg??t.background,$a.nonTerminalFill),nonTerminalStroke:Ln(t.primaryBorderColor??t.lineColor,$a.nonTerminalStroke),nonTerminalTextColor:Ln(t.primaryTextColor??t.textColor,$a.nonTerminalTextColor),lineColor:Ln(t.lineColor,$a.lineColor),markerFill:Ln(t.lineColor,$a.markerFill),commentFill:Ln(t.labelBackground??t.tertiaryColor,$a.commentFill),commentStroke:Ln(t.tertiaryBorderColor??t.lineColor,$a.commentStroke),commentTextColor:Ln(t.tertiaryTextColor??t.textColor,$a.commentTextColor),specialFill:Ln(t.tertiaryColor??t.secondaryColor,$a.specialFill),specialStroke:Ln(t.tertiaryBorderColor??t.secondaryBorderColor,$a.specialStroke),ruleNameColor:Ln(t.titleColor??t.textColor,$a.ruleNameColor)}},"buildThemeDefaults"),uY=x(t=>{const e=Xt(),r={...Dh(),...e.themeVariables??{},...w$t(t)},n=k$t(r),i={...e.railroad??{},...T$t(t)};return{compactMode:i.compactMode??n.compactMode,padding:ap(i.padding,n.padding),verticalSeparation:ap(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:ap(i.horizontalSeparation,n.horizontalSeparation),arcRadius:ap(i.arcRadius,n.arcRadius),fontSize:ap(i.fontSize,n.fontSize),fontFamily:QLe(i.fontFamily,n.fontFamily),terminalFill:Ln(i.terminalFill,n.terminalFill),terminalStroke:Ln(i.terminalStroke,n.terminalStroke),terminalTextColor:Ln(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:Ln(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:Ln(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:Ln(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:Ln(i.lineColor,n.lineColor),strokeWidth:ap(i.strokeWidth,n.strokeWidth),markerFill:Ln(i.markerFill,n.markerFill),commentFill:Ln(i.commentFill,n.commentFill),commentStroke:Ln(i.commentStroke,n.commentStroke),commentTextColor:Ln(i.commentTextColor,n.commentTextColor),specialFill:Ln(i.specialFill,n.specialFill),specialStroke:Ln(i.specialStroke,n.specialStroke),ruleNameColor:Ln(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:ap(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),U7=x(t=>{const{fontFamily:e,fontSize:r,terminalFill:n,terminalStroke:i,terminalTextColor:a,nonTerminalFill:s,nonTerminalStroke:o,nonTerminalTextColor:l,lineColor:u,strokeWidth:h,markerFill:d,commentFill:f,commentStroke:p,commentTextColor:g,specialFill:m,specialStroke:y,ruleNameColor:v}=uY(t);return` .railroad-diagram { font-family: ${e}; font-size: ${r}px; @@ -3784,9 +3786,9 @@ Expecting `+te.join(", ")+", got '"+(this.terminals_[G]||G)+"'":J="Parse error o .railroad-group { /* Grouping container, no specific styles */ } -`},"getStyles"),db,tl=(db=class{constructor(){this.d=""}moveTo(e,r){return this.d+=`M ${e} ${r} `,this}lineTo(e,r){return this.d+=`L ${e} ${r} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,r,n,i,a,s,o){return this.d+=`A ${e} ${r} ${n} ${i?1:0} ${a?1:0} ${s} ${o} `,this}build(){return this.d.trim()}},x(db,"PathBuilder"),db),fb,w$t=(fb=class{constructor(e,r=uY()){this.textCache=new Map,this.svg=e,this.config=r}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const r=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),n=r.node().getBBox(),i={width:n.width,height:n.height};return r.remove(),this.textCache.set(e,i),i}renderTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-terminal");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a).attr("rx",10).attr("ry",10),s.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderNonTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-nonterminal");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),s.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderSequence(e,r){const n=r.map(u=>this.renderExpression(e,u));let i=0,a=0,s=0;for(const u of n)i+=u.dimensions.width,a=Math.max(a,u.dimensions.up),s=Math.max(s,u.dimensions.down);i+=(n.length-1)*this.config.horizontalSeparation;const o=e.append("g").attr("class","railroad-sequence");let l=0;for(let u=0;uthis.renderExpression(e,f));let i=0,a=0;for(const f of n)i=Math.max(i,f.dimensions.width),a+=f.dimensions.height;a+=(n.length-1)*this.config.verticalSeparation;const s=this.config.arcRadius,o=s*4,l=i+o,u=e.append("g").attr("class","railroad-choice");let h=0;const d=a/2;for(const f of n){const p=h,g=p+f.dimensions.up,m=s*2+(i-f.dimensions.width)/2;u.node().appendChild(f.element).setAttribute("transform",`translate(${m}, ${p})`);const v=new tl,T=g>d;g===d?v.moveTo(0,d).lineTo(m,g):v.moveTo(0,d).arcTo(s,s,0,!1,T,s,d+(T?s:-s)).lineTo(s,g-(T?s:-s)).arcTo(s,s,0,!1,!T,s*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",v.build());const b=new tl,w=m+f.dimensions.width,C=l-s*2;g===d?b.moveTo(w,g).lineTo(l,d):b.moveTo(w,g).lineTo(C,g).arcTo(s,s,0,!1,!T,l-s,g+(T?-s:s)).lineTo(l-s,d+(T?s:-s)).arcTo(s,s,0,!1,T,l,d),u.append("path").attr("class","railroad-line").attr("d",b.build()),h+=f.dimensions.height+this.config.verticalSeparation}return{element:u.node(),dimensions:{width:l,height:a,up:d,down:a-d}}}renderOptional(e,r){const n=this.renderExpression(e,r),i=this.config.arcRadius,a=i*2,s=n.dimensions.width+i*4,o=n.dimensions.height+a,l=e.append("g").attr("class","railroad-optional"),u=i*2,h=a;l.node().appendChild(n.element).setAttribute("transform",`translate(${u}, ${h})`);const f=h+n.dimensions.up,p=new tl().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new tl().moveTo(u+n.dimensions.width,f).lineTo(s,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new tl().moveTo(0,f).arcTo(i,i,0,!1,!1,i,f-i).lineTo(i,i).arcTo(i,i,0,!1,!0,i*2,0).lineTo(s-i*2,0).arcTo(i,i,0,!1,!0,s-i,i).lineTo(s-i,f-i).arcTo(i,i,0,!1,!1,s,f);return l.append("path").attr("class","railroad-line").attr("d",m.build()),{element:l.node(),dimensions:{width:s,height:o,up:f,down:o-f}}}renderRepetition(e,r,n){const i=this.renderExpression(e,r),a=this.config.arcRadius,s=a*2,o=i.dimensions.width+a*4,l=n===0,u=i.dimensions.height+s+(l?s:0),h=e.append("g").attr("class","railroad-repetition"),d=a*2,f=l?s:0;h.node().appendChild(i.element).setAttribute("transform",`translate(${d}, ${f})`);const g=f+i.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(0,g).lineTo(a*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+a,y=new tl().moveTo(d+i.dimensions.width,g).arcTo(a,a,0,!1,!0,d+i.dimensions.width+a,g+a).lineTo(d+i.dimensions.width+a,m).arcTo(a,a,0,!1,!0,d+i.dimensions.width,m+a).lineTo(a*2,m+a).arcTo(a,a,0,!1,!0,a,m).lineTo(a,g+a).arcTo(a,a,0,!1,!0,a*2,g);if(h.append("path").attr("class","railroad-line").attr("d",y.build()),l){const v=new tl().moveTo(0,g).arcTo(a,a,0,!1,!1,a,g-a).lineTo(a,a).arcTo(a,a,0,!1,!0,a*2,0).lineTo(o-a*2,0).arcTo(a,a,0,!1,!0,o-a,a).lineTo(o-a,g-a).arcTo(a,a,0,!1,!1,o,g);h.append("path").attr("class","railroad-line").attr("d",v.build())}return{element:h.node(),dimensions:{width:o,height:u,up:g,down:u-g}}}renderSpecial(e,r){const n=this.measureText("? "+r+" ?"),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-special");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),s.append("text").attr("x",i/2).attr("y",a/2).text("? "+r+" ?"),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderExpression(e,r){switch(r.type){case"terminal":return this.renderTerminal(e,r.value);case"nonterminal":return this.renderNonTerminal(e,r.name);case"sequence":return this.renderSequence(e,r.elements);case"choice":return this.renderChoice(e,r.alternatives);case"optional":return this.renderOptional(e,r.element);case"repetition":return this.renderRepetition(e,r.element,r.min);case"special":return this.renderSpecial(e,r.text);default:throw new Error(`Unknown node type: ${r.type}`)}}renderRule(e,r){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${r})`),i=e.name+" =",a=this.measureText(i).width+20,s=a+20,o=n.append("g"),l=this.renderExpression(o,e.definition),u=Math.max(20,l.dimensions.up),h=u-l.dimensions.up;return o.attr("transform",`translate(${s}, ${h})`),n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",u).text(i),n.append("g").attr("class","railroad-start").append("circle").attr("cx",a).attr("cy",u).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",s+l.dimensions.width+10).attr("cy",u).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(a+this.config.markerRadius,u).lineTo(s,u).build()),n.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(s+l.dimensions.width,u).lineTo(s+l.dimensions.width+10-this.config.markerRadius,u).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:s+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let r=this.config.padding,n=0;for(const i of e){const a=this.renderRule(i,r);r+=a.height+this.config.verticalSeparation,n=Math.max(n,a.width)}return{width:n+this.config.padding*2,height:r+this.config.padding}}},x(fb,"RailroadRenderer"),fb),xae=x((t,e,r)=>{Ai(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),C$t=x((t,e,r)=>{le.debug(`[Railroad] Rendering diagram -`+t);try{const n=xs(e);n.attr("class","railroad-diagram");const i=Xt().railroad,a=(i==null?void 0:i.useMaxWidth)??!0,s=ei.getRules();if(le.debug(`[Railroad] Rendering ${s.length} rules`),s.length===0){le.warn("[Railroad] No rules to render"),xae(n,{height:100,width:200},a);return}const l=new w$t(n,uY()).renderDiagram(s);xae(n,l,a),le.debug("[Railroad] Render complete")}catch(n){throw le.error("[Railroad] Render error:",n),n}},"draw"),Y7={draw:C$t},k$t=oU().Railroad.parser.LangiumParser,Vm=x(t=>{switch(t.$type){case"RailroadTerminalExpr":return{type:"terminal",value:t.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:t.name};case"RailroadSpecialExpr":return{type:"special",text:t.text};case"RailroadSequenceExpr":{const e=t.elements.map(Vm);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(Vm);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:Vm(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:Vm(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:Vm(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),S$t=x(t=>({name:t.name,definition:Vm(t.definition)}),"transformRule"),E$t=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(S$t(e)))},"populateDb"),A$t={parse:x(t=>{ei.clear(),le.debug("[Railroad Parser] Starting Langium parse");const e=k$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[Railroad Parser] Parsed rules:",r.rules.length),E$t(r),le.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:ei}},_$t={parser:A$t,db:ei,renderer:Y7,styles:U7};const R$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:_$t},Symbol.toStringTag,{value:"Module"}));var L$t=lU().RailroadEbnf.parser.LangiumParser,o5=x(t=>{const e=t.alternatives.map(M$t);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),M$t=x(t=>{const e=t.elements.map(N$t);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),QLe=x(t=>{switch(t.$type){case"EbnfTerminal":return{type:"terminal",value:t.value};case"EbnfNonTerminal":return{type:"nonterminal",name:t.name};case"EbnfSpecial":return{type:"special",text:t.text};case"EbnfGroup":return o5(t.element);case"EbnfOptional":return{type:"optional",element:o5(t.element)};case"EbnfRepetition":return{type:"repetition",element:o5(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),I$t=x((t,e)=>{switch(e.$type){case"EbnfOptionalPostfix":return{type:"optional",element:t};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:t,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:t,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[t,{type:"terminal",value:"-"},QLe(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),N$t=x(t=>t.postfixes.reduce((e,r)=>I$t(e,r),QLe(t.base)),"transformTerm"),D$t=x(t=>({name:t.name,definition:o5(t.definition)}),"transformRule"),O$t=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(D$t(e)))},"populateDb"),$$t={parse:x(t=>{ei.clear(),le.debug("[EBNF Parser] Starting Langium parse");const e=L$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[EBNF Parser] Parsed rules:",r.rules.length),O$t(r),le.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:ei}},P$t={parser:$$t,db:ei,renderer:Y7,styles:U7};const B$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:P$t},Symbol.toStringTag,{value:"Module"}));var F$t=cU().RailroadAbnf.parser.LangiumParser,TF=x(t=>{const e=t.alternatives.map(z$t);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),z$t=x(t=>{const e=t.elements.map(G$t);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),V$t=x(t=>{if(t.includes("*")){const[r,n]=t.split("*"),i=r?parseInt(r,10):0,a=n?parseInt(n,10):1/0;return{min:i,max:a}}const e=parseInt(t,10);return{min:e,max:e}},"parseRepeat"),G$t=x(t=>{const e=W$t(t.primary);if(!t.repeat)return e;const{min:r,max:n}=V$t(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),W$t=x(t=>{switch(t.$type){case"AbnfStringLiteral":return{type:"terminal",value:t.value};case"AbnfNumVal":return{type:"terminal",value:t.value};case"AbnfRuleName":return{type:"nonterminal",name:t.name};case"AbnfGroup":return TF(t.element);case"AbnfOptionalGroup":return{type:"optional",element:TF(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),H$t=x(t=>({name:t.name,definition:TF(t.definition)}),"transformRule"),q$t=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(H$t(e)))},"populateDb"),U$t={parse:x(t=>{ei.clear(),le.debug("[ABNF Parser] Starting Langium parse");const e=F$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[ABNF Parser] Parsed rules:",r.rules.length),q$t(r),le.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:ei}},Y$t={parser:U$t,db:ei,renderer:Y7,styles:U7};const X$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:Y$t},Symbol.toStringTag,{value:"Module"}));var j$t=uU().RailroadPeg.parser.LangiumParser,JLe=x(t=>{const e=t.alternatives.map(K$t);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),K$t=x(t=>{const e=t.elements.map(Z$t);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),Z$t=x(t=>{const e=Q$t(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${Tae(e)}`:`!${Tae(e)}`}:e},"transformPrefix"),Tae=x(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),Q$t=x(t=>{const e=J$t(t.primary);if(!t.operator)return e;switch(t.operator){case"?":return{type:"optional",element:e};case"*":return{type:"repetition",element:e,min:0,max:1/0};case"+":return{type:"repetition",element:e,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${t.operator}`)}},"transformSuffix"),J$t=x(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return JLe(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),ePt=x(t=>({name:t.name,definition:JLe(t.definition)}),"transformRule"),tPt=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(ePt(e)))},"populateDb"),rPt={parse:x(t=>{ei.clear(),le.debug("[PEG Parser] Starting Langium parse");const e=j$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[PEG Parser] Parsed rules:",r.rules.length),tPt(r),le.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:ei}},nPt={parser:rPt,db:ei,renderer:Y7,styles:U7};const iPt=Object.freeze(Object.defineProperty({__proto__:null,diagram:nPt},Symbol.toStringTag,{value:"Module"}));var aPt=1;function hY(){if(!(typeof globalThis>"u"))return globalThis}x(hY,"getCaptureGlobal");function e7e(){var t;return!!((t=hY())!=null&&t.mermaidCaptureSizes)}x(e7e,"shouldCaptureSizes");function t7e(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}x(t7e,"capturedFromLocation");function r7e(t,e){const r=hY();if(!r)return;const n=e.node(),i=(n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n,a=(i==null?void 0:i.id)??"(unknown)";r.mermaidCapturedSizes??(r.mermaidCapturedSizes=[]);const s={svgId:a,sizes:t};r.mermaidCapturedSizes.push(s),r.mermaidLastCapturedSizes=s}x(r7e,"emitCapturedSizes");function n7e(t,e){const r=[];for(const n of e.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&r7e({metadata:{captureVersion:aPt,capturedAt:new Date().toISOString(),capturedFrom:t7e()},nodes:r},t)}x(n7e,"captureNodeSizes");const sPt=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:n7e,shouldCaptureSizes:e7e},Symbol.toStringTag,{value:"Module"})),oPt=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:yAe,createInfoServices:vAe},Symbol.toStringTag,{value:"Module"})),lPt=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:bAe,createPacketServices:xAe},Symbol.toStringTag,{value:"Module"})),cPt=Object.freeze(Object.defineProperty({__proto__:null,PieModule:TAe,createPieServices:wAe},Symbol.toStringTag,{value:"Module"})),uPt=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:CAe,createTreeViewServices:kAe},Symbol.toStringTag,{value:"Module"})),hPt=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:SAe,createArchitectureServices:EAe},Symbol.toStringTag,{value:"Module"})),dPt=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:gAe,createGitGraphServices:mAe},Symbol.toStringTag,{value:"Module"})),fPt=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:_Ae,createEventModelingServices:RAe},Symbol.toStringTag,{value:"Module"})),pPt=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:rAe,createRadarServices:nAe},Symbol.toStringTag,{value:"Module"})),gPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:iAe,createRailroadServices:oU},Symbol.toStringTag,{value:"Module"})),mPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:aAe,createRailroadEbnfServices:lU},Symbol.toStringTag,{value:"Module"})),yPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:sAe,createRailroadAbnfServices:cU},Symbol.toStringTag,{value:"Module"})),vPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:oAe,createRailroadPegServices:uU},Symbol.toStringTag,{value:"Module"})),bPt=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:cAe,createTreemapServices:uAe},Symbol.toStringTag,{value:"Module"})),xPt=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:hAe,createWardleyServices:dAe},Symbol.toStringTag,{value:"Module"})),TPt=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:fAe,createCynefinServices:pAe},Symbol.toStringTag,{value:"Module"})); - +`},"getStyles"),db,tl=(db=class{constructor(){this.d=""}moveTo(e,r){return this.d+=`M ${e} ${r} `,this}lineTo(e,r){return this.d+=`L ${e} ${r} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,r,n,i,a,s,o){return this.d+=`A ${e} ${r} ${n} ${i?1:0} ${a?1:0} ${s} ${o} `,this}build(){return this.d.trim()}},x(db,"PathBuilder"),db),fb,S$t=(fb=class{constructor(e,r=uY()){this.textCache=new Map,this.svg=e,this.config=r}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const r=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),n=r.node().getBBox(),i={width:n.width,height:n.height};return r.remove(),this.textCache.set(e,i),i}renderTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-terminal");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a).attr("rx",10).attr("ry",10),s.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderNonTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-nonterminal");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),s.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderSequence(e,r){const n=r.map(u=>this.renderExpression(e,u));let i=0,a=0,s=0;for(const u of n)i+=u.dimensions.width,a=Math.max(a,u.dimensions.up),s=Math.max(s,u.dimensions.down);i+=(n.length-1)*this.config.horizontalSeparation;const o=e.append("g").attr("class","railroad-sequence");let l=0;for(let u=0;uthis.renderExpression(e,f));let i=0,a=0;for(const f of n)i=Math.max(i,f.dimensions.width),a+=f.dimensions.height;a+=(n.length-1)*this.config.verticalSeparation;const s=this.config.arcRadius,o=s*4,l=i+o,u=e.append("g").attr("class","railroad-choice");let h=0;const d=a/2;for(const f of n){const p=h,g=p+f.dimensions.up,m=s*2+(i-f.dimensions.width)/2;u.node().appendChild(f.element).setAttribute("transform",`translate(${m}, ${p})`);const v=new tl,T=g>d;g===d?v.moveTo(0,d).lineTo(m,g):v.moveTo(0,d).arcTo(s,s,0,!1,T,s,d+(T?s:-s)).lineTo(s,g-(T?s:-s)).arcTo(s,s,0,!1,!T,s*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",v.build());const b=new tl,w=m+f.dimensions.width,C=l-s*2;g===d?b.moveTo(w,g).lineTo(l,d):b.moveTo(w,g).lineTo(C,g).arcTo(s,s,0,!1,!T,l-s,g+(T?-s:s)).lineTo(l-s,d+(T?s:-s)).arcTo(s,s,0,!1,T,l,d),u.append("path").attr("class","railroad-line").attr("d",b.build()),h+=f.dimensions.height+this.config.verticalSeparation}return{element:u.node(),dimensions:{width:l,height:a,up:d,down:a-d}}}renderOptional(e,r){const n=this.renderExpression(e,r),i=this.config.arcRadius,a=i*2,s=n.dimensions.width+i*4,o=n.dimensions.height+a,l=e.append("g").attr("class","railroad-optional"),u=i*2,h=a;l.node().appendChild(n.element).setAttribute("transform",`translate(${u}, ${h})`);const f=h+n.dimensions.up,p=new tl().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new tl().moveTo(u+n.dimensions.width,f).lineTo(s,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new tl().moveTo(0,f).arcTo(i,i,0,!1,!1,i,f-i).lineTo(i,i).arcTo(i,i,0,!1,!0,i*2,0).lineTo(s-i*2,0).arcTo(i,i,0,!1,!0,s-i,i).lineTo(s-i,f-i).arcTo(i,i,0,!1,!1,s,f);return l.append("path").attr("class","railroad-line").attr("d",m.build()),{element:l.node(),dimensions:{width:s,height:o,up:f,down:o-f}}}renderRepetition(e,r,n){const i=this.renderExpression(e,r),a=this.config.arcRadius,s=a*2,o=i.dimensions.width+a*4,l=n===0,u=i.dimensions.height+s+(l?s:0),h=e.append("g").attr("class","railroad-repetition"),d=a*2,f=l?s:0;h.node().appendChild(i.element).setAttribute("transform",`translate(${d}, ${f})`);const g=f+i.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(0,g).lineTo(a*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+a,y=new tl().moveTo(d+i.dimensions.width,g).arcTo(a,a,0,!1,!0,d+i.dimensions.width+a,g+a).lineTo(d+i.dimensions.width+a,m).arcTo(a,a,0,!1,!0,d+i.dimensions.width,m+a).lineTo(a*2,m+a).arcTo(a,a,0,!1,!0,a,m).lineTo(a,g+a).arcTo(a,a,0,!1,!0,a*2,g);if(h.append("path").attr("class","railroad-line").attr("d",y.build()),l){const v=new tl().moveTo(0,g).arcTo(a,a,0,!1,!1,a,g-a).lineTo(a,a).arcTo(a,a,0,!1,!0,a*2,0).lineTo(o-a*2,0).arcTo(a,a,0,!1,!0,o-a,a).lineTo(o-a,g-a).arcTo(a,a,0,!1,!1,o,g);h.append("path").attr("class","railroad-line").attr("d",v.build())}return{element:h.node(),dimensions:{width:o,height:u,up:g,down:u-g}}}renderSpecial(e,r){const n=this.measureText("? "+r+" ?"),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-special");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),s.append("text").attr("x",i/2).attr("y",a/2).text("? "+r+" ?"),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderExpression(e,r){switch(r.type){case"terminal":return this.renderTerminal(e,r.value);case"nonterminal":return this.renderNonTerminal(e,r.name);case"sequence":return this.renderSequence(e,r.elements);case"choice":return this.renderChoice(e,r.alternatives);case"optional":return this.renderOptional(e,r.element);case"repetition":return this.renderRepetition(e,r.element,r.min);case"special":return this.renderSpecial(e,r.text);default:throw new Error(`Unknown node type: ${r.type}`)}}renderRule(e,r){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${r})`),i=e.name+" =",a=this.measureText(i).width+20,s=a+20,o=n.append("g"),l=this.renderExpression(o,e.definition),u=Math.max(20,l.dimensions.up),h=u-l.dimensions.up;return o.attr("transform",`translate(${s}, ${h})`),n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",u).text(i),n.append("g").attr("class","railroad-start").append("circle").attr("cx",a).attr("cy",u).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",s+l.dimensions.width+10).attr("cy",u).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(a+this.config.markerRadius,u).lineTo(s,u).build()),n.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(s+l.dimensions.width,u).lineTo(s+l.dimensions.width+10-this.config.markerRadius,u).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:s+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let r=this.config.padding,n=0;for(const i of e){const a=this.renderRule(i,r);r+=a.height+this.config.verticalSeparation,n=Math.max(n,a.width)}return{width:n+this.config.padding*2,height:r+this.config.padding}}},x(fb,"RailroadRenderer"),fb),Tae=x((t,e,r)=>{Ai(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),E$t=x((t,e,r)=>{le.debug(`[Railroad] Rendering diagram +`+t);try{const n=xs(e);n.attr("class","railroad-diagram");const i=Xt().railroad,a=(i==null?void 0:i.useMaxWidth)??!0,s=ei.getRules();if(le.debug(`[Railroad] Rendering ${s.length} rules`),s.length===0){le.warn("[Railroad] No rules to render"),Tae(n,{height:100,width:200},a);return}const l=new S$t(n,uY()).renderDiagram(s);Tae(n,l,a),le.debug("[Railroad] Render complete")}catch(n){throw le.error("[Railroad] Render error:",n),n}},"draw"),Y7={draw:E$t},A$t=oU().Railroad.parser.LangiumParser,Vm=x(t=>{switch(t.$type){case"RailroadTerminalExpr":return{type:"terminal",value:t.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:t.name};case"RailroadSpecialExpr":return{type:"special",text:t.text};case"RailroadSequenceExpr":{const e=t.elements.map(Vm);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(Vm);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:Vm(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:Vm(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:Vm(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),_$t=x(t=>({name:t.name,definition:Vm(t.definition)}),"transformRule"),R$t=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(_$t(e)))},"populateDb"),L$t={parse:x(t=>{ei.clear(),le.debug("[Railroad Parser] Starting Langium parse");const e=A$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[Railroad Parser] Parsed rules:",r.rules.length),R$t(r),le.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:ei}},M$t={parser:L$t,db:ei,renderer:Y7,styles:U7};const I$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:M$t},Symbol.toStringTag,{value:"Module"}));var N$t=lU().RailroadEbnf.parser.LangiumParser,o5=x(t=>{const e=t.alternatives.map(D$t);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),D$t=x(t=>{const e=t.elements.map($$t);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),JLe=x(t=>{switch(t.$type){case"EbnfTerminal":return{type:"terminal",value:t.value};case"EbnfNonTerminal":return{type:"nonterminal",name:t.name};case"EbnfSpecial":return{type:"special",text:t.text};case"EbnfGroup":return o5(t.element);case"EbnfOptional":return{type:"optional",element:o5(t.element)};case"EbnfRepetition":return{type:"repetition",element:o5(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),O$t=x((t,e)=>{switch(e.$type){case"EbnfOptionalPostfix":return{type:"optional",element:t};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:t,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:t,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[t,{type:"terminal",value:"-"},JLe(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),$$t=x(t=>t.postfixes.reduce((e,r)=>O$t(e,r),JLe(t.base)),"transformTerm"),P$t=x(t=>({name:t.name,definition:o5(t.definition)}),"transformRule"),B$t=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(P$t(e)))},"populateDb"),F$t={parse:x(t=>{ei.clear(),le.debug("[EBNF Parser] Starting Langium parse");const e=N$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[EBNF Parser] Parsed rules:",r.rules.length),B$t(r),le.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:ei}},z$t={parser:F$t,db:ei,renderer:Y7,styles:U7};const V$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:z$t},Symbol.toStringTag,{value:"Module"}));var G$t=cU().RailroadAbnf.parser.LangiumParser,TF=x(t=>{const e=t.alternatives.map(W$t);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),W$t=x(t=>{const e=t.elements.map(q$t);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),H$t=x(t=>{if(t.includes("*")){const[r,n]=t.split("*"),i=r?parseInt(r,10):0,a=n?parseInt(n,10):1/0;return{min:i,max:a}}const e=parseInt(t,10);return{min:e,max:e}},"parseRepeat"),q$t=x(t=>{const e=U$t(t.primary);if(!t.repeat)return e;const{min:r,max:n}=H$t(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),U$t=x(t=>{switch(t.$type){case"AbnfStringLiteral":return{type:"terminal",value:t.value};case"AbnfNumVal":return{type:"terminal",value:t.value};case"AbnfRuleName":return{type:"nonterminal",name:t.name};case"AbnfGroup":return TF(t.element);case"AbnfOptionalGroup":return{type:"optional",element:TF(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),Y$t=x(t=>({name:t.name,definition:TF(t.definition)}),"transformRule"),X$t=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(Y$t(e)))},"populateDb"),j$t={parse:x(t=>{ei.clear(),le.debug("[ABNF Parser] Starting Langium parse");const e=G$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[ABNF Parser] Parsed rules:",r.rules.length),X$t(r),le.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:ei}},K$t={parser:j$t,db:ei,renderer:Y7,styles:U7};const Z$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:K$t},Symbol.toStringTag,{value:"Module"}));var Q$t=uU().RailroadPeg.parser.LangiumParser,e7e=x(t=>{const e=t.alternatives.map(J$t);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),J$t=x(t=>{const e=t.elements.map(ePt);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),ePt=x(t=>{const e=tPt(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${wae(e)}`:`!${wae(e)}`}:e},"transformPrefix"),wae=x(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),tPt=x(t=>{const e=rPt(t.primary);if(!t.operator)return e;switch(t.operator){case"?":return{type:"optional",element:e};case"*":return{type:"repetition",element:e,min:0,max:1/0};case"+":return{type:"repetition",element:e,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${t.operator}`)}},"transformSuffix"),rPt=x(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return e7e(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),nPt=x(t=>({name:t.name,definition:e7e(t.definition)}),"transformRule"),iPt=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(nPt(e)))},"populateDb"),aPt={parse:x(t=>{ei.clear(),le.debug("[PEG Parser] Starting Langium parse");const e=Q$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[PEG Parser] Parsed rules:",r.rules.length),iPt(r),le.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:ei}},sPt={parser:aPt,db:ei,renderer:Y7,styles:U7};const oPt=Object.freeze(Object.defineProperty({__proto__:null,diagram:sPt},Symbol.toStringTag,{value:"Module"}));var lPt=1;function hY(){if(!(typeof globalThis>"u"))return globalThis}x(hY,"getCaptureGlobal");function t7e(){var t;return!!((t=hY())!=null&&t.mermaidCaptureSizes)}x(t7e,"shouldCaptureSizes");function r7e(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}x(r7e,"capturedFromLocation");function n7e(t,e){const r=hY();if(!r)return;const n=e.node(),i=(n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n,a=(i==null?void 0:i.id)??"(unknown)";r.mermaidCapturedSizes??(r.mermaidCapturedSizes=[]);const s={svgId:a,sizes:t};r.mermaidCapturedSizes.push(s),r.mermaidLastCapturedSizes=s}x(n7e,"emitCapturedSizes");function i7e(t,e){const r=[];for(const n of e.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&n7e({metadata:{captureVersion:lPt,capturedAt:new Date().toISOString(),capturedFrom:r7e()},nodes:r},t)}x(i7e,"captureNodeSizes");const cPt=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:i7e,shouldCaptureSizes:t7e},Symbol.toStringTag,{value:"Module"})),uPt=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:vAe,createInfoServices:bAe},Symbol.toStringTag,{value:"Module"})),hPt=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:xAe,createPacketServices:TAe},Symbol.toStringTag,{value:"Module"})),dPt=Object.freeze(Object.defineProperty({__proto__:null,PieModule:wAe,createPieServices:CAe},Symbol.toStringTag,{value:"Module"})),fPt=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:kAe,createTreeViewServices:SAe},Symbol.toStringTag,{value:"Module"})),pPt=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:EAe,createArchitectureServices:AAe},Symbol.toStringTag,{value:"Module"})),gPt=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:mAe,createGitGraphServices:yAe},Symbol.toStringTag,{value:"Module"})),mPt=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:RAe,createEventModelingServices:LAe},Symbol.toStringTag,{value:"Module"})),yPt=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:nAe,createRadarServices:iAe},Symbol.toStringTag,{value:"Module"})),vPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:aAe,createRailroadServices:oU},Symbol.toStringTag,{value:"Module"})),bPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:sAe,createRailroadEbnfServices:lU},Symbol.toStringTag,{value:"Module"})),xPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:oAe,createRailroadAbnfServices:cU},Symbol.toStringTag,{value:"Module"})),TPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:lAe,createRailroadPegServices:uU},Symbol.toStringTag,{value:"Module"})),wPt=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:uAe,createTreemapServices:hAe},Symbol.toStringTag,{value:"Module"})),CPt=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:dAe,createWardleyServices:fAe},Symbol.toStringTag,{value:"Module"})),kPt=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:pAe,createCynefinServices:gAe},Symbol.toStringTag,{value:"Module"})); + "; +const MERGE_DIVIDER_TOKENIZER = + /^\s*(?:\n+---[ \t]*(?:\n+|$)|(?:\n+|$))/; + const MergeDivider = Node.create({ name: "edgeeverMergeDivider", group: "block", @@ -28,6 +32,28 @@ const MergeDivider = Node.create({ }), ]; }, + renderMarkdown() { + return `${MERGE_DIVIDER_MARKDOWN_MARKER}\n\n---`; + }, + parseMarkdown(_token, helpers) { + return helpers.createNode("edgeeverMergeDivider"); + }, + markdownTokenizer: { + name: "edgeeverMergeDivider", + level: "block", + start(source: string) { + return source.indexOf(MERGE_DIVIDER_MARKDOWN_MARKER); + }, + tokenize(source: string) { + const match = MERGE_DIVIDER_TOKENIZER.exec(source); + if (!match) return undefined; + return { + type: "edgeeverMergeDivider", + raw: match[0], + text: "", + }; + }, + }, }); type BridgeMessage = diff --git a/apps/ios/Tests/EdgeEverTests/ChromeParityTests.swift b/apps/ios/Tests/EdgeEverTests/ChromeParityTests.swift index 1923a4a9..5fb3e4b4 100644 --- a/apps/ios/Tests/EdgeEverTests/ChromeParityTests.swift +++ b/apps/ios/Tests/EdgeEverTests/ChromeParityTests.swift @@ -151,7 +151,10 @@ final class ChromeParityTests: XCTestCase { func testWorkspacePresentsCreateAsFullScreenCover() throws { let src = try readShippedSource("Features/Workspace/WorkspaceView.swift") XCTAssertTrue(src.contains("fullScreenCover(isPresented: $showNewNote)"), src) - XCTAssertTrue(src.contains("MemoEditView(mode: .create"), "create wiring") + XCTAssertTrue( + src.contains("mode: .create(") || src.contains("MemoEditView(mode: .create"), + "create wiring" + ) XCTAssertTrue(src.contains("fullScreenCover(isPresented: $showSettings)"), "Me full screen") } diff --git a/apps/ios/Tests/EdgeEverTests/MobileUIParityTests.swift b/apps/ios/Tests/EdgeEverTests/MobileUIParityTests.swift index f7a60bda..e160729e 100644 --- a/apps/ios/Tests/EdgeEverTests/MobileUIParityTests.swift +++ b/apps/ios/Tests/EdgeEverTests/MobileUIParityTests.swift @@ -187,8 +187,16 @@ final class MobileUIParityTests: XCTestCase { token: nil, resourceCache: cache ) - XCTAssertTrue(out.contains("data:image/svg+xml"), out) - XCTAssertFalse(out.contains("/api/v1/resources/\(testId)/blob"), "protected path must be rewritten before setContent") + let data = try XCTUnwrap(out.data(using: .utf8)) + let document = try XCTUnwrap(try JSONSerialization.jsonObject(with: data) as? [String: Any]) + let content = try XCTUnwrap(document["content"] as? [[String: Any]]) + let attrs = try XCTUnwrap(content.first?["attrs"] as? [String: Any]) + let hydratedSource = try XCTUnwrap(attrs["src"] as? String) + XCTAssertTrue(hydratedSource.hasPrefix("data:image/svg+xml"), hydratedSource) + XCTAssertFalse( + hydratedSource.contains("/api/v1/resources/\(testId)/blob"), + "protected path must be rewritten before setContent" + ) let stale = await cache.fileURL(for: testId) try? FileManager.default.removeItem(at: stale) } diff --git a/apps/ios/Tests/EdgeEverTests/TipTapContentSourceTests.swift b/apps/ios/Tests/EdgeEverTests/TipTapContentSourceTests.swift index e82668bb..e0a0f430 100644 --- a/apps/ios/Tests/EdgeEverTests/TipTapContentSourceTests.swift +++ b/apps/ios/Tests/EdgeEverTests/TipTapContentSourceTests.swift @@ -3,6 +3,56 @@ import XCTest @testable import EdgeEver final class TipTapContentSourceTests: XCTestCase { + func testEditorMarkdownRemainsAuthoritativeForRichStructures() { + let markdown = """ + 1. first + 1. nested + + ```swift + let value = 1 + ``` + """ + let json = """ + {"type":"doc","content":[{"type":"orderedList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"first"}]}]}]},{"type":"codeBlock","attrs":{"language":"swift"},"content":[{"type":"text","text":"let value = 1"}]}]} + """ + + XCTAssertEqual( + EditorContentCodec.preferredMarkdown( + editorMarkdown: markdown, + documentJSON: json, + fallback: "" + ), + markdown + ) + } + + func testEditorMarkdownFallbackDoesNotReplaceExistingCompatibilityCopy() { + let fallback = "| A | B |\n| --- | --- |\n| 1 | 2 |\n" + let json = """ + {"type":"doc","content":[{"type":"table","content":[]}]} + """ + + XCTAssertEqual( + EditorContentCodec.preferredMarkdown( + editorMarkdown: nil, + documentJSON: json, + fallback: fallback + ), + fallback + ) + } + + func testEmptyEditorMarkdownRemainsAuthoritative() { + XCTAssertEqual( + EditorContentCodec.preferredMarkdown( + editorMarkdown: "", + documentJSON: #"{"type":"doc","content":[]}"#, + fallback: "previous content" + ), + "" + ) + } + /// Flattened JSON + rich markdown must NOT drive the detail viewer (regression). func testViewerAlwaysPrefersMarkdownWhenPresent() { let richMD = """ diff --git a/apps/mobile/src/screens/WorkspaceScreen.tsx b/apps/mobile/src/screens/WorkspaceScreen.tsx index 48050993..e3f90bda 100644 --- a/apps/mobile/src/screens/WorkspaceScreen.tsx +++ b/apps/mobile/src/screens/WorkspaceScreen.tsx @@ -1801,6 +1801,8 @@ const CreateMemoModal = ({ const [dirty, setDirty] = useState(false); const [editorReady, setEditorReady] = useState(false); const [imageOperation, setImageOperation] = useState<"idle" | "creating" | "uploading">("idle"); + const imageOperationRef = useRef(imageOperation); + const createPendingRef = useRef(false); const [resourceTarget, setResourceTarget] = useState(null); const targetNotebookId = notebookId || fallbackNotebookId; const selectedNotebookName = notebooks.find((notebook) => notebook.id === targetNotebookId)?.name ?? "选择笔记本"; @@ -1813,6 +1815,7 @@ const CreateMemoModal = ({ titleRef.current = title; tagsTextRef.current = tagsText; targetNotebookIdRef.current = targetNotebookId; + imageOperationRef.current = imageOperation; const focusTimerRef = useRef | null>(null); const keyboardTimerRef = useRef | null>(null); @@ -2093,6 +2096,7 @@ const CreateMemoModal = ({ onCreated(memo); }, }); + createPendingRef.current = createMutation.isPending; const canSubmitCreateMemo = Boolean(targetNotebookId) && !createMutation.isPending && imageOperation === "idle"; const canUseTemplate = imageOperation === "idle" && !createMutation.isPending; @@ -2193,7 +2197,7 @@ const CreateMemoModal = ({ }; const requestClose = async () => { - if (createMutation.isPending || imageOperation !== "idle") { + if (createPendingRef.current || imageOperationRef.current !== "idle") { return; } await flushEditor(); diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts index 60a78d58..22658e1e 100644 --- a/apps/web/vite.config.ts +++ b/apps/web/vite.config.ts @@ -163,6 +163,9 @@ export default defineConfig({ ], globIgnores: [ "index.html", + // Noto Sans SC is used only by the on-demand print entry. Precaching every + // CJK unicode-range shard adds ~4.5 MiB to every PWA installation. + "**/noto-sans-sc-*.woff2", "**/*beautiful-mermaid*.js", "**/*mermaid.core-*.js", "**/vendor-mermaid-*.js", diff --git a/scripts/verify-web-performance.mjs b/scripts/verify-web-performance.mjs index e86e6f93..d63f3943 100644 --- a/scripts/verify-web-performance.mjs +++ b/scripts/verify-web-performance.mjs @@ -23,9 +23,17 @@ assert.doesNotMatch(precacheManifest, /\{url:"index\.html",/, "Current HTML must assert.match(precacheManifest, /index\.html\?edgeever-offline-shell=/, "PWA must retain a versioned offline HTML shell"); const optionalDiagramPattern = /(?:beautiful-mermaid|vendor-mermaid|mermaid\.core|[^"']*Diagram-)[^"']*\.js/; assert.doesNotMatch(precacheManifest, optionalDiagramPattern, "Optional diagram chunks must remain out of the initial PWA precache"); +assert.doesNotMatch(precacheManifest, /noto-sans-sc-[^"']*\.woff2/, "Print-only Noto Sans SC shards must remain out of the PWA precache"); -const entryCount = (precacheManifest.match(/\{url:/g) ?? []).length; +const precacheURLs = [...precacheManifest.matchAll(/\{url:"([^"]+)"/g)].map((match) => match[1]); +const entryCount = precacheURLs.length; assert.ok(entryCount > 0, "Web service worker precache manifest must not be empty"); +const precacheBytes = precacheURLs + .filter((url) => !url.startsWith("/") && !url.includes("?")) + .map((url) => statSync(join(distDirectory, url)).size) + .reduce((total, size) => total + size, 0); +const PRECACHE_BUDGET = 5 * 1024 * 1024; +assert.ok(precacheBytes <= PRECACHE_BUDGET, `PWA precache budget exceeded: ${precacheBytes} > ${PRECACHE_BUDGET}`); const modulePreloads = indexHtml.match(/]+>/g)?.join("\n") ?? ""; const initialOptionalPattern = /vendor-code-highlight|vendor-D3|beautiful-mermaid|vendor-(?:mermaid|tiptap|prosemirror|floating)|ui-primitives|mermaid\.core|[^"']*Diagram-/; assert.doesNotMatch(modulePreloads, initialOptionalPattern, "Optional editor and diagram chunks must remain out of the initial HTML modulepreload list"); @@ -60,6 +68,8 @@ assert.ok( console.log(JSON.stringify({ ok: true, precacheEntries: entryCount, + precacheBytes, + precacheBudget: PRECACHE_BUDGET, initialModulePreloadBytes, initialModulePreloadBudget: INITIAL_MODULE_PRELOAD_BUDGET, largeDeferredChunks: largeChunks, diff --git a/tests/mobile-app-scope.test.ts b/tests/mobile-app-scope.test.ts index ce8e330c..61cf9f64 100644 --- a/tests/mobile-app-scope.test.ts +++ b/tests/mobile-app-scope.test.ts @@ -86,6 +86,10 @@ describe("mobile app scope", () => { expect(memoDetailSource).toContain("SAFE_DOM_WEBVIEW_PROPS"); }); + test("reads the latest create and upload state from the hardware-back handler", () => { + expect(workspaceSource).toContain("createPendingRef.current || imageOperationRef.current"); + }); + test("declares iOS privacy strings and full-screen phone-on-iPad presentation", () => { const infoPlist = appJson.expo.ios?.infoPlist ?? {}; expect(appJson.expo.ios?.supportsTablet).toBe(false);